Option to remember the caret position in the command line

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Option to remember the caret position in the command line

Post 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
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

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

Post by *hi5 »

+1
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

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

Post 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
Last edited by JOUBE on 2024-01-27, 13:50 UTC, edited 2 times in total.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post 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.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

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

Post 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.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

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

Post 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.
Overquoting is evil! 👎
Post Reply