Sublime Forum

Move cursor anywhere

#1

[size=150]The problem.[/size]
Most of us have done it: splitting a comment over multiple lines. Needless to say, padding by holding the space bar wasn’t very convenient in the following example:


[size=150]The solution.[/size]

  1. Right now, clicking behind the last character of a line makes the cursor jump to its end. This could be changed by an option: when clicking in the empty space, the editor automatically pads the line with spaces, so that the cursor is precisely where I have clicked.

  2. A command could do something similar: pressing Ctrl+Enter for example could insert a new line below the current one, and move the cursor downwads so that it stays in the same column in the process. This could again be accomplished by automatically inserting the right amount of spaces.

I’ve used the comment problem as an example, but there are other places you could use these features, for example hacking a “DEBUG” comment somewhere on the right side of a line.

[size=150]Something even cooler.[/size]
We can already select boxes in Sublime to copy and overwrite them. Make a feature to similarly opening a text box similar to Photoshop: Whatever you’re writing is constrained to that text box; when you press ESC or click outside the box, it simply disappears.


Similarly, one could expand the current “make box selection” to incorporate the “pad with spaces” behaviour mentioned before: Selecting a box in the nirvana to the right of the screen places a couple of cursors in adjacent lines and the same column. The behaviour right now is putting the cursor to the end of every line one’s touching, and I dare to say that’s not been useful too many times.

0 Likes

#2

The box thing could totally be done with a plugin (as long as you’re willing to use the keyboard to make the box).
That’s actually a really cool idea.

0 Likes