Skip to content

Cannot edit search string effectively on Windows with up arrow #83644

Closed

Description

Open the search viewlet

  • paste a string like src/vs/base/common/buffer.ts
  • have the search viewlet be small such that the text wraps
  • try to press up arrow to go up inside the string to reach its beginning and remove src/

image

Observe that the up arrow does not move the cursor up, but changes the text input to the previous searched string.

Activity

  1. sashikanth1994 commented on Oct 30, 2019

    @sashikanth1994

    The search text is in a single line so we don't expect the up arrow to work.

  2. alexdima commented on Oct 30, 2019

    @alexdima
    MemberAuthor

    Sashikanth Palleti (@sashikanth1994) The search text is multiline, please see the screenshot, and the up arrow should work.

  3. roblourens commented on Oct 30, 2019

    @roblourens
    Member

    But it is a single line that has wrapped, not multiple lines of text. We should be able to make this work the same. Although I don't really like the new text wrapping anyway (it didn't wrap at all before multiline search)

  4. added
    bug
    search
    help wanted
    on Oct 30, 2019
  5. alexdima commented on Oct 31, 2019

    @alexdima
    MemberAuthor

    Ok, now I see where the difficulty comes from... Perhaps the following could be done:

    • when the selection changes,
    • only if the selection is collapsed,
    • and only of the <textarea> is multiline (height can be checked),
    • then read the client rect and determine if it on the first or last line of text by comparing the rect with the <textarea> rect

    Based on the above, set the context keys for enabling up/down to go through history...

  6. romainHainaut commented on Dec 6, 2019

    @romainHainaut
    Contributor

    I could reproduce the exact same bug, so i will be looking if i can fix it

  7. romainHainaut commented on Dec 8, 2019

    @romainHainaut
    Contributor

    Hey again, so i could find everything and know how to correct the bug but the only things i need to have is the height of the Search when it is one line to avoid hardcoding a value that only work for my spec. And i don't know where it is and if the Search height change from different spec.

    Anyways here is how i will correct the bug:
    So the bug is in this file: https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/search/browser/searchWidget.ts#L83
    the current function only look for /n , so the equivalent of manually adding a line.
    To correct just need to modify the line by
    if (textarea &&( isMultiline || textarea.clientHeight>THE_HEIGHT_OF_A_SINGLE_LINE) && textarea.selectionStart > 0) {
    The same for the downward
    As you can see i don't have "THE_HEIGHT_OF_A_SINGLE_LINE", in my case it is 24 but has previously said i don't know if it is for my spec or for everyone.

  8. added a commit that references this issue on Dec 9, 2019
    dfcd728
  9. romainHainaut commented on Dec 9, 2019

    @romainHainaut
    Contributor

    Ok so after looking into the CSS file of the search widget i have fin that the maxheight value was the same has the value clientHeight return. As i dont master CSS i could play with the file to see if it was the same for the height but i assume it is (would be weird if the fonctionnality is diffirent). So i assume it is the same value for all spec.

    So i have put the value 24 and commit.
    I have debug for the up ward and down ward

    I hope my assumption are right :)

  10. added a commit that references this issue on Dec 11, 2019
    b099d57
  11. locked and limited conversation to collaborators on Jan 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wantedsearch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions