New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readline,repl: add substring history search #31112
readline,repl: add substring history search #31112
Commits on Jan 8, 2020
-
repl: improve preview length calculation
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.
-
readline,repl: add substring based history search
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
-
readline,repl: skip history entries identical to the current line
Skip history entries that are identical to the currently visible line to improve the user experience.
-
readline,repl: improve history up/previous
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.
-
readline: simplify getStringWidth()
Simplify getStringWidth by removing dead code (the options were unused) and by refactoring the logic.
-
readline: move charLengthLeft() and charLengthAt()
This moves the charLengthLeft() and charLengthAt() into the internal readline file. This allows sharing the functions internally with other code.
-
src: improve GetColumnWidth performance
This improves the performance in GetColumnWidth for full width characters.
-
src: change GetStringWidth's expand_emoji_sequence option default
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.
-
repl: activate previews for lines exceeding the terminal columns
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.
-
test: add repl tests to verify unicode support in previews
This also adds a test to verify that changed writer options also change the preview output depending on the options.
-
Commits on Jan 9, 2020
-
squash: readline: simplify getStringWidth()
readline: improve getStringWidth on 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.