Sublime Forum

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

#1

As the post Can't go to the begin & end of a wrapped line using keyword? I posted before:

[quote]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++. [/quote]

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”? :smiley:

0 Likes

Can't go to the begin & end of a wrapped line using keyword?
#2

It can sort of be done as follows:

	{ "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?

0 Likes