scripts icon indicating copy to clipboard operation
scripts copied to clipboard

[go.py] Initial cursor position

Open mkoskar opened this issue 8 years ago • 0 comments

Current behavior:

  • cursor is located on currently active buffer
  • [PROS] user can easily see where is his/her active buffer located in relation to other choices (but see below), and with Tab or Shift-Tab shift by an offset
  • [CONS] in practice above doesn't work because buffer list is long and it's quite possible user doesn't see his current buffer as selected (also there is "hotlist" as sort option which effectively puts current buffer towards the very end of the list)

Proposed behavior:

  • script starts with no selection
  • if input buffer is still empty Tab (and Shift-Tab) will select first entry – that is consistent with non-empty input buffer scenario
  • if empty input buffer is "committed" (^J / ^M) just do nothing (consistent with current behavior)
  • [PROS] it's more intuitive, taking into account that currently (likely) user doesn't see startup selection (as described above)
  • [PROS] works nicely with "hotlist" – e.g., setting sort to "hotlist,number,beginning" one might nicely select first, second, etc. entry just with few Tab presses
  • [CONS] navigation by Tabing from currently active buffer is lost but I would argue that it's rarely used, since there are already existing (even default) key bindings e.g., /buffer +1, /buffer -1 etc.

Also there is an option to introduce configuration option and let user decide what behavior suits him/her (e.g., default_selection {on/off}). Ultimately one could imagine even some runtime key binding which would select active buffer, in that case though, scrolling of list would be necessary so the current selection is always visible (implementing that would be nice anyway because just pressing Tab couple time and having overflowing list will bring cursor out of sight).

mkoskar avatar Nov 18 '15 23:11 mkoskar