Home Download Buy Blog Forum Support

Cannot use the same key for "eol" and "hardeol"

Cannot use the same key for "eol" and "hardeol"

Postby singw on Wed Jun 13, 2012 10:35 am

As the post viewtopic.php?f=2&t=7477 I posted before:

When a single line is wrapped into to 2 lines in view, say Line 1 & Line 2,
pressing the key "end" on Line 1, the caret will go to Line 1's end, but when "end" is pressed again, it will not go to Line 2's end.
The same situation is also happened when going to the beginning of Line 1 from Line 2 using the key "home".

Could this behavior be added to Sublime Text? I am missing this feature when switching from Notepad++.


tito tell me to use the "hardeol" and "hardbol" commands, but I am quite new in customizing Sublime Text. Could someone write me the keymmaping code for handling "eol" & "hardeol" using the same key, say "home"? :D
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Cannot use the same key for "eol" and "hardeol"

Postby quodlibet on Sat Jun 23, 2012 2:02 pm

It can *sort of* be done as follows:

Code: Select all
   { "keys": ["end", "end"], "command": "move_to", "args": {"to": "hardeol", "extend": false} },
   { "keys": ["home", "home"], "command": "move_to", "args": {"to": "hardbol", "extend": false} },


A problem I encountered is that while hitting "end" or "home" once moves the caret to the soft bol/eol, sublime does not actually refresh the position of the caret on screen. (Just start typing and you'll see what I mean.)

I suspect that Sublime is waiting for the rest of the chained keypresses. The only way I can think of "breaking the chain" is (untested) to create a short macro that appends a couple of commands (like pressing left and right) to do so, but this seems like a bad idea. Can someone more knowledgeable than me please weigh in on this?
quodlibet
 
Posts: 543
Joined: Sat Jun 18, 2011 5:53 pm


Return to Technical Support

Who is online

Users browsing this forum: EvilDragon, Exabot [Bot], Yahoo [Bot] and 30 guests