Skip to content
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

Tabs in the repl cause display issues #25272

Closed
BridgeAR opened this issue Dec 29, 2018 · 3 comments
Closed

Tabs in the repl cause display issues #25272

BridgeAR opened this issue Dec 29, 2018 · 3 comments
Labels
confirmed-bug Issues with confirmed bugs. readline Issues and PRs related to the built-in readline module. repl Issues and PRs related to the REPL subsystem.

Comments

@BridgeAR
Copy link
Member

BridgeAR commented Dec 29, 2018

Just copy something like var abc = 5; in the repl and go back and forth and remove or add some characters. Push enter and go up and down in the history and further issues will resolve.

The marker is not correct and sometimes things are not visible that should be and the other way around.

I guess we could either just display tabs as space (that would likely resolve the problem easily) or

We have to properly fix this and to teach the code to jump to the correct position if there's a tab.

@BridgeAR BridgeAR added the repl Issues and PRs related to the REPL subsystem. label Dec 29, 2018
@juanarbol
Copy link
Member

It's weird because shows a very long space (as tab), but delete (looks like) works like spaces

@antsmartian
Copy link
Contributor

The marker is not correct and sometimes things are not visible that should be and the other way around.

I guess the cursor position movement doesn't take care of tabs here. Will check this sometime.

@antsmartian
Copy link
Contributor

Ok I had taken a look, there are few things we can do:

  1. Treat tabs as spaces as suggested by @BridgeAR. Should be simple fix.
  2. \t's are counted as a single entity hence the cursor length is wrong. Fixing it would be to take line count plus the tab count if any (but we need to then check wordLeft, wordRight and other cases if at all 🤔 ).

I would suggest 1 as there is no way user can emit tab within a line, apart from pasting strings to the repl.

antsmartian added a commit to antsmartian/node that referenced this issue Dec 30, 2018
@BridgeAR BridgeAR added the readline Issues and PRs related to the built-in readline module. label Jan 27, 2019
@targos targos added the confirmed-bug Issues with confirmed bugs. label Jul 21, 2019
BridgeAR added a commit to BridgeAR/node that referenced this issue Jan 8, 2020
MylesBorins pushed a commit that referenced this issue Jan 16, 2020
PR-URL: #31112
Fixes: #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 issue 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 that referenced this issue Apr 28, 2020
PR-URL: #31112
Fixes: #25272
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. readline Issues and PRs related to the built-in readline module. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
4 participants