Open tbabej opened 6 years ago
Migrated metadata:
Created: 2015-01-09T08:07:37Z
Modified: 2015-01-12T09:30:12Z
Scott Kostyshak on 2015-01-09T15:48:00Z says:
Makes sense. I've actually looked at this before but the previous maintainer of VIT had some things hardwired that were hard to work around. I'm not sure if I'm remembering correctly, but I think the problem is that escape causes the prompt to return an empty string, and that's how VIT knows to do something special. Thus, suppose a subsequent 'f' brings up a clear prompt -- since pressing escape returns an empty string and pressing return also returns an empty string, VIT can't provide functionality for the user to say "oops I actually want to keep the filter that is currently there".
All this to say -- I think I agree with you, but it's actually tricky to change.
PeterN on 2015-01-12T09:30:12Z says:
Notice, in mutt the behaviour is even more slightly involved regarding handling of blank keys:
PeterN on 2015-01-09T08:07:37Z says:
I would like to see mutt-like behaviour of vit's command line.
Current behaviour 1.- press "f" and enter a filtering pattern X1 (e.g., "project:work") 2.- do whatever 3.- press "f' again, let's say we want to enter a different pattern X2 ("tags:home") 4.- filtering pattern X appears on the command line 5.- to enter the pattern X2, I need to first delete X1 and then type X2
Desired behaviour & rationale In step 5, simply typing any non-movement key should immediately delete the pattern X1 and start typing a new string. Only upon first typing a movement key and then typing should the old pattern stay. The rationale is that by pressing "f" user usually expresses a desire to enter a new pattern and if the old pattern needs to be modified, the user will edit it by engaging some movement key - this is a robust UI behaviour, since cursor is positioned at the very end of the command line, so apart from a desire to append a character to the end of the line, the user must first engage a movement key. For a reference implementation, check mutt's behaviour on changing folder/mailbox - pressing "c" in a folder.