PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Haakon Birkeland on October 27, 2011, 09:16:33 AM

Title: Tweaking caret position logic for the editor
Post by: Haakon Birkeland on October 27, 2011, 09:16:33 AM
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.



Title: Re: Tweaking caret position logic for the editor
Post by: Roger Garstang on November 11, 2011, 02:24:16 PM
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.
Title: Re: Tweaking caret position logic for the editor
Post by: David Kenny on November 11, 2011, 03:45:52 PM
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.
Title: Re: Tweaking caret position logic for the editor
Post by: Peter House on November 14, 2011, 11:54:45 PM
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.

Title: Re: Tweaking caret position logic for the editor
Post by: José Roca on November 15, 2011, 12:19:57 AM
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.