repl,readline: improve unicode support and tab completion#31288
Closed
BridgeAR wants to merge 2 commits intonodejs:masterfrom
Closed
repl,readline: improve unicode support and tab completion#31288BridgeAR wants to merge 2 commits intonodejs:masterfrom
BridgeAR wants to merge 2 commits intonodejs:masterfrom
Conversation
jasnell
approved these changes
Jan 10, 2020
1. This reduces the number of write operations used during tab completion. 2. The tab completion calculated the string width using the length of the string instead of using the actual width. That is fixed. 3. The key decoder is now capable of handling characters composed out of two code points. That reduces the number of "keypress" events that are emitted which again lowers the amount of writes triggered.
2e65b26 to
a019c62
Compare
This simplifies code that was more complicated than it had to be and removes code that should never be reached.
9211679 to
23c754f
Compare
Member
Author
|
@jasnell I pushed another commit that cleans up some code. It would have conflicted with the former commit if I would have opened another PR for it instead. PTAL. |
Collaborator
BridgeAR
commented
Jan 10, 2020
| getStringWidth(this.line[this.cursor]) > 1) { | ||
| rows++; | ||
| cols = 0; | ||
| } |
Member
Author
There was a problem hiding this comment.
Our cursor can't be between two code points. We move the cursor by the correct length since a while.
4 tasks
Collaborator
Trott
approved these changes
Jan 11, 2020
Member
Trott
left a comment
There was a problem hiding this comment.
LGTM but I'm going to kick off a CITGM just to make sure the readline changes aren't breaking in an unexpected way.
Member
Collaborator
Member
|
Landed in a523283...fe05818 |
Trott
pushed a commit
that referenced
this pull request
Jan 11, 2020
1. This reduces the number of write operations used during tab completion. 2. The tab completion calculated the string width using the length of the string instead of using the actual width. That is fixed. 3. The key decoder is now capable of handling characters composed out of two code points. That reduces the number of "keypress" events that are emitted which again lowers the amount of writes triggered. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Trott
pushed a commit
that referenced
this pull request
Jan 11, 2020
This simplifies code that was more complicated than it had to be and removes code that should never be reached. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Jan 16, 2020
1. This reduces the number of write operations used during tab completion. 2. The tab completion calculated the string width using the length of the string instead of using the actual width. That is fixed. 3. The key decoder is now capable of handling characters composed out of two code points. That reduces the number of "keypress" events that are emitted which again lowers the amount of writes triggered. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Jan 16, 2020
This simplifies code that was more complicated than it had to be and removes code that should never be reached. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Merged
Member
|
@BridgeAR should this go back to |
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
1. This reduces the number of write operations used during tab completion. 2. The tab completion calculated the string width using the length of the string instead of using the actual width. That is fixed. 3. The key decoder is now capable of handling characters composed out of two code points. That reduces the number of "keypress" events that are emitted which again lowers the amount of writes triggered. PR-URL: nodejs#31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
This simplifies code that was more complicated than it had to be and removes code that should never be reached. PR-URL: nodejs#31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
1. This reduces the number of write operations used during tab completion. 2. The tab completion calculated the string width using the length of the string instead of using the actual width. That is fixed. 3. The key decoder is now capable of handling characters composed out of two code points. That reduces the number of "keypress" events that are emitted which again lowers the amount of writes triggered. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
This simplifies code that was more complicated than it had to be and removes code that should never be reached. PR-URL: #31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@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.
completion.
of the string instead of using the actual width. That is fixed.
out of two code points. That reduces the number of "keypress"
events that are emitted which again lowers the amount of writes
triggered.
This is currently blocked by #31112 (moving thecharLengthAtfunction).// cc @nodejs/repl @nodejs/readline
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes