readline,repl: add substring history search#31112
Closed
BridgeAR wants to merge 14 commits intonodejs:masterfrom
Closed
readline,repl: add substring history search#31112BridgeAR wants to merge 14 commits intonodejs:masterfrom
BridgeAR wants to merge 14 commits intonodejs:masterfrom
Conversation
5b21b6c to
a36f1a8
Compare
Member
Author
|
@nodejs/repl @nodejs/readline PTAL. I included a couple of smaller things that are all somewhat connected. I can split this into multiple PRs if requested. This
|
This comment has been minimized.
This comment has been minimized.
addaleax
reviewed
Jan 5, 2020
This comment has been minimized.
This comment has been minimized.
jasnell
reviewed
Jan 7, 2020
97ecd26 to
6c73393
Compare
The preview had an off by one error in case colors where deactivated and did not take fullwidth unicode characters into account when displaying the preview.
This improves the current history search feature by adding substring based history search similar to ZSH. In case the `UP` or `DOWN` buttons are pressed after writing a few characters, the start string up to the current cursor is used to search the history. All other history features work exactly as they used to. Fixes: nodejs#28437
Skip history entries that are identical to the currently visible line to improve the user experience.
Reaching the history end caused the last entry to be persistent. That way there's no actualy feedback to the user that the history end is reached. Instead, visualize the original input line and keep the history index at the history end in case the user wants to go back again.
6c73393 to
9e958f3
Compare
This comment has been minimized.
This comment has been minimized.
Simplify getStringWidth by removing dead code (the options were unused) and by refactoring the logic.
This moves the charLengthLeft() and charLengthAt() into the internal readline file. This allows sharing the functions internally with other code.
This improves the performance in GetColumnWidth for full width characters.
The option is now set to true by default. Most terminals do not have full emoji support and visualize emojis with zero width joiners as individual emojis. Also verify that at least one argument is always passed through to the function and remove support for passing through code points. Only accept strings from now on to simplify the API.
This improves the completion previews by activating them for lines that exceed the current terminal columns. As a drive-by fix it also simplifies some statements.
This also adds a test to verify that changed writer options also change the preview output depending on the options.
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
The preview had an off by one error in case colors where deactivated and did not take fullwidth unicode characters into account when displaying the preview. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This improves the current history search feature by adding substring based history search similar to ZSH. In case the `UP` or `DOWN` buttons are pressed after writing a few characters, the start string up to the current cursor is used to search the history. All other history features work exactly as they used to. PR-URL: nodejs#31112 Fixes: nodejs#28437 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
Skip history entries that are identical to the currently visible line to improve the user experience. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
Reaching the history end caused the last entry to be persistent. That way there's no actualy feedback to the user that the history end is reached. Instead, visualize the original input line and keep the history index at the history end in case the user wants to go back again. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
1. Simplify the getStringWidth function used by Intl builds by removing dead code (the options were unused) and by refactoring the logic. 2. Improve the getStringWidth unicode handling used by non-Intl builds. The getStringWidth function returned the wrong width for multiple inputs. It's now improved by supporting various zero width characters and more full width characters. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This moves the charLengthLeft() and charLengthAt() into the internal readline file. This allows sharing the functions internally with other code. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This improves the performance in GetColumnWidth for full width characters. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
The option is now set to true by default. Most terminals do not have full emoji support and visualize emojis with zero width joiners as individual emojis. Also verify that at least one argument is always passed through to the function and remove support for passing through code points. Only accept strings from now on to simplify the API. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
PR-URL: nodejs#31112 Fixes: nodejs#25272 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This improves the completion previews by activating them for lines that exceed the current terminal columns. As a drive-by fix it also simplifies some statements. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This also adds a test to verify that changed writer options also change the preview output depending on the options. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
The preview had an off by one error in case colors where deactivated and did not take fullwidth unicode characters into account when displaying the preview. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This improves the current history search feature by adding substring based history search similar to ZSH. In case the `UP` or `DOWN` buttons are pressed after writing a few characters, the start string up to the current cursor is used to search the history. All other history features work exactly as they used to. PR-URL: #31112 Fixes: #28437 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
Skip history entries that are identical to the currently visible line to improve the user experience. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
Reaching the history end caused the last entry to be persistent. That way there's no actualy feedback to the user that the history end is reached. Instead, visualize the original input line and keep the history index at the history end in case the user wants to go back again. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
1. Simplify the getStringWidth function used by Intl builds by removing dead code (the options were unused) and by refactoring the logic. 2. Improve the getStringWidth unicode handling used by non-Intl builds. The getStringWidth function returned the wrong width for multiple inputs. It's now improved by supporting various zero width characters and more full width characters. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This moves the charLengthLeft() and charLengthAt() into the internal readline file. This allows sharing the functions internally with other code. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This improves the performance in GetColumnWidth for full width characters. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
The option is now set to true by default. Most terminals do not have full emoji support and visualize emojis with zero width joiners as individual emojis. Also verify that at least one argument is always passed through to the function and remove support for passing through code points. Only accept strings from now on to simplify the API. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This improves the completion previews by activating them for lines that exceed the current terminal columns. As a drive-by fix it also simplifies some statements. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This also adds a test to verify that changed writer options also change the preview output depending on the options. PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please see the individual commit messages for details.
Fixes: #28437
Fixes: #25272
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes