GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — readline,repl: add substring history search by BridgeAR · Pull Request #31112 · nodejs/node Conversation
|
|
@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
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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
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.
|
@BridgeAR should this go back to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
This improves the performance in GetColumnWidth for full width characters. PR-URL: nodejs#31112 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#31112 Fixes: nodejs#25272 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
repl: substring based search history Tabs in the repl cause display issues
There was an error while loading. Please reload this page.