Page 1 of 1

Option to remember the caret position in the command line

Posted: 2024-01-27, 10:30 UTC
by petermad
Currently, if there is already text in the command line, that text is selected and the caret is placed at the end of the text when the command line gets focus with for example Shift+RigthtArrow or cm_FocusCmdLine or by clicking it with the mouse.

Often one have the need to insert, rather than append, text or filenames in the command line, and for that the current behavior is not always expedient. (If I want the file name appended by for example Ctrl+Enter placed in another position, I have to copy-paste is to the desidered place)

If TC could remember the last caret position when loosing focus, then that position could be used as the point of insertion when pressing Ctrl+Enter, Ctrl+Shift+Enter or Ctrl+P - or when the command line recieves focus.

Currently Shift+LeftArrow and Shift+RightArrow has the same function I imagine Shift+RightArrow could keep it's current behavior with selecting all text an placing the caret at the end of the text, but Shift+LeftArrow could put the caret at the saved position with no text selection.

The behavior could either be chosen via a setting like CommandlineInsertion=1 in wincmd.ini (preferable), or the commands cm_FocusCmdLine, cm_AddPathToCmdline, cm_AddFileNameToCmdline, and cm_AddPathAndFileNameToCmdline could all be provided with a parameter 1 which would use the remembered caret position.

This request is in line with this other request: https://ghisler.ch/board/viewtopic.php?p=437089#p437089

Re: Option to remember the caret position in the command line

Posted: 2024-01-27, 11:48 UTC
by hi5
+1

Re: Option to remember the caret position in the command line

Posted: 2024-01-27, 12:24 UTC
by JOUBE
All of this assumes that the cursor is blinking visible. Otherwise it is pointless and 'dangerous'. At present, this blinking visibility cannot be guaranteed with certainty within der Tc command line in all cases. Therefore the suggestion is uncertain and impractical.

Joube

Edit: - 1 removed

Re: Option to remember the caret position in the command line

Posted: 2024-01-27, 13:19 UTC
by petermad
JOUBE wrote: 2024-01-27, 12:24 UTC All of this assumes that the cursor is blinking visible. Otherwise it is pointless and 'dangerous'. At present, this blinking visibility cannot be guaranteed with certainty within der Tc command line in all cases. Therefore the suggestion is uncertain and impractical.
I don't see the problem - the cursor/caret is never visible anyway when the command line does not have focus, but the user should know, where he put it when the command line last had focus - also - I suggest to make it configurable.

Re: Option to remember the caret position in the command line

Posted: 2024-01-27, 13:49 UTC
by JOUBE
petermad wrote: 2024-01-27, 13:19 UTC
JOUBE wrote: 2024-01-27, 12:24 UTC All of this assumes that the cursor is blinking visible. Otherwise it is pointless and 'dangerous'. At present, this blinking visibility cannot be guaranteed with certainty within der Tc command line in all cases. Therefore the suggestion is uncertain and impractical.
I don't see the problem - the cursor/caret is never visible anyway when the command line does not have focus, but the user should know, where he put it when the command line last had focus - also - I suggest to make it configurable.
I will remove - 1. ;-) Because I don't care if it is possible to turn it off or not turn it on/use it.

Re: Option to remember the caret position in the command line

Posted: 2024-01-27, 14:08 UTC
by Fla$her
100% support! It will be very useful. :)

JOUBE wrote: 2024-01-27, 12:24 UTC All of this assumes that the cursor is blinking visible. Otherwise it is pointless and 'dangerous'. At present, this blinking visibility cannot be guaranteed with certainty within der Tc command line in all cases. Therefore the suggestion is uncertain and impractical.
This is a completely meaningful, practical and expected behavior. And the most important thing is that it saves time.
The danger level is even lower than the current one, because it is more difficult to make a mistake when typing after restoring focus. In any case, the user sees the text before confirmation, so the danger here is conditional. This doesn't apply to the flashing of the text cursor, the presence of which depends on the version/settings of the system or the selected animation.