Skip to content

[FIX] Ctrl+arrow keys navigation fixed#22

Open
kvokka wants to merge 4 commits intoMon-Ouie:masterfrom
kvokka:master
Open

[FIX] Ctrl+arrow keys navigation fixed#22
kvokka wants to merge 4 commits intoMon-Ouie:masterfrom
kvokka:master

Conversation

@kvokka
Copy link

@kvokka kvokka commented Jan 19, 2016

In pry you get 5D or 5C symbols, when try move over the line by ctrl+arrow keys.

This will fix it

@arlimus
Copy link

arlimus commented Apr 10, 2016

Same problem over here :)

But I think that \e[5D or \e[5C are not really a word-wise movements (see this or e.g.:

[8] pry(main)> print "12345\e[1D"
1234=> nil
[9] pry(main)> print "123456\e[5D"
1=> nil

@kvokka
Copy link
Author

kvokka commented Apr 10, 2016

This fix will not be enough, you can see in my pull request.
With it it works not bad at all, but not good enough (i use this gem only as a part of pry-coolline), and if I paste more than 500 bytes of data i got too much lag.

But better look into m first commit, there is CORRECT solution, your one will not works correcnt in case of buffer length.

@ibrahima
Copy link

ibrahima commented Jun 1, 2016

@kvokka Do you mean that your fix or the fix in #23 is not good enough? @arlimus 's fix seems to work for me, and is a less invasive change. It seems undesirable to insert delays into the input process, especially since coolline itself also adds some delay for syntax highlighting. Could you explain why your fix is necessary/better? Thanks!

@kvokka
Copy link
Author

kvokka commented Jun 2, 2016

I've done it because ih @arlimus implementation you will get bug outpt with long press. Try to paste 300-500 symbols snippet od text (with spaces of course) and nav it with his method, holdind the cthl+arrow buttons and you will get '5D' and '5E' symbols as artifact, that was not readed from buffer and pushed to console input. I tried to add the delay for preventing this artifacts, but got too slow working with bigger parts of code.

Now I had to cut coolline, but I'll be very happy to use it againg (if it will works ;)

@ibrahima
Copy link

ibrahima commented Jun 2, 2016

Hmm I don't experience that actually, though pasting in long strings of text is generally pretty slow with coolline enabled, even without the extra delay. But I haven't seen the 5D/5E artifacts with @arlimus 's fix even with a long string of text.

@kvokka
Copy link
Author

kvokka commented Jun 2, 2016

Bug will be raided not after insert, but after navigating on the string. Copy this message(maybe twice), for example, and then try to go back and forward on it with ctrl+arrows. after few times you'll get the bug. And it is really annoying, is you have to deal will long sql queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants