Tweaking caret position logic for the editor

Started by Haakon Birkeland, October 27, 2011, 09:16:33 AM

Previous topic - Next topic

Haakon Birkeland

I frequently find myself doing similar changes at a similar positions in similar lines of code. Sometimes these lines are separated by an empty line or a not so similar/long line of code.

The thing that I'd love to see tweaked here is having the caret (try to) maintain the same position on lines that are equally long or longer than the previous long line, even if the caret jumps leftwise on empty lines in between.

Shortly put, I'd like to see the caret maintain the character position set by the last mouse click or left right arrow key when the up or down arrow keys are used to navigate code.

Images shows what we got now when using the up arrow, and how I'd like it to be tweaked for added efficiency.



Haakon 8o)

Roger Garstang

I've used some editors that did that and liked it too.  I'm guessing a variable storing the current X Pos in the line would be needed that only changes when right/left arrow keys or mouse presses are used.  Then on up/down it will keep that pos if possible or put cursor at EOL.  Usually in editors a big thing for me is the capability to easily do common tasks.  Things like this to keep me from having to move a lot are always a plus.  Another cool thing along these lines is column selections like some editors and word processors do when you hold Alt while selecting.

David Kenny

Roger,

Paul has column selection capabilities in JFPro using the ctrl key.  I don't remember reading if he plans on including it in FF.

Peter House

This type of caret positioning would be a really nice feature.

Notepad++ has nice column capabilities.  Alt-mouse or Alt-shift-arrows to select. Although I believe this would be a feature which would not get used very much for programming.


José Roca

Quote
Notepad++ has nice column capabilities.  Alt-mouse or Alt-shift-arrows to select.

That is a feature implemented by the Scintilla control, used by Notepad++. My CSED editor uses Scintilla too and, therefore, has also it.