Commit Graph

14 Commits

Author SHA1 Message Date
Thomas O'Dowd 5346085511 A Pager to list completion candidates if they don't fit on one page.
Main Features:
- If there are too many candidates returned by the completer,
  completemode and completeselectmode did not work properly.
  Similar to the bash completion pager, list candidates and
  offer "--More--" on the end of each page. User can select
  " ", "y" or "Y" to keep listing or "q", "Q", "n", "N" to
  stop listing. When paging completes, we also exit out of
  completion mode.
- Added aggregate completion when entering completeselectmode
  where the candiddates dwindle down sharing a larger common
  prefix. This makes typing a little faster than having to
  select. More bash-like behaviour.

Other Fixes:
- Fix various crashes where candidates are too wide for the
  width of the screen and causes division by zero.
- Fix crash with wide (Asian characters) in completion.
- Streamline redrawing as CompleteRefresh was called too
  often.
- Fix crashes around ctrl-a and ctrl-b in select mode when
  candidates don't fit on a line
- Fix prev/next candidates in select mode when candidates
  don't fit on a line
- Fix crash when ctrl-k was pressed in select mode. This
  caused us to exitselectmode which cleaned up all the data
  but left us in complete mode such that if CompleteRefresh
  was callled directly, the data was not initialized.
- Fix complete and select mode redraw issues when candidates
  did not fit on one line.
- Fix cursor position issues after CompleteRefresh especially
  if the prompt and buffer also went over 1 line.
- Fix redraw issue where exiting completion mode using
  certain key presses leaves candidates on the screen.

Fixes for Windows:
- Use window size for visible height/width instead of buffer size
- Adjust for Window's EOL behaviour.

Notes:
- Added Height info to different structures as the decision to
  page or not required height information.
- Added OnSizeChange(). Didn't know if I could get rid of the
  OnWidthChange()? Would be nice to remove the Width stuff and
  just have Size (width + height info).
2023-03-04 18:59:22 +09:00
chzyer 27fdf0b285 Fix: a backup plan when can't get size of terminal (#71)
* fix (0,0) size

* fix
2016-08-31 23:51:28 +08:00
chzyer b57eccfd02 add remote mode 2016-03-13 18:32:48 +08:00
Cheney 867002449c refactory 2016-03-05 15:45:42 +08:00
Cheney 8e340f3ee8 #30 fixed search history crash 2016-02-21 10:14:19 +08:00
Cheney 15e7be4ac2 add new interface and fixed crash if stdout isn't a tty 2016-02-18 11:25:41 +08:00
Cheney 07485bbd8f update history interfaces. and support DisableAutoSaveHistory 2016-02-16 16:56:57 +08:00
Cheney 9edb463230 add windows api, ansi writer 2015-09-29 17:49:58 +08:00
Cheney f179b24304 support double-width-char & colorful prompt 2015-09-25 12:45:39 +08:00
Cheney a659448259 update example 2015-09-23 14:52:45 +08:00
Cheney 80af385185 durable mark 2015-09-23 14:34:58 +08:00
Cheney 2a02950868 fix state 2015-09-23 11:28:50 +08:00
Cheney a7f498f047 fix fwd/bck search 2015-09-23 11:10:36 +08:00
Cheney 3b1cf6b8fb add fwd/bck search 2015-09-22 23:01:15 +08:00