diff options
author | Rory Dudley | 2024-09-30 23:07:30 -0600 |
---|---|---|
committer | Rory Dudley | 2024-09-30 23:08:20 -0600 |
commit | 07e75b3f63001ca509df8d5b5a33336ab994814f (patch) | |
tree | 3283fea468a166fea194c9bc487ef4bcdbca4bde /git@git.dwarvish.org:dwarvish.git | |
parent | 41335c1618d3c7c1c5950a228ea15e2d0c3c2d8d (diff) | |
download | dwarvish-07e75b3f63001ca509df8d5b5a33336ab994814f.tar.gz |
Previously, switching between Tab and Shift+Tab while cycling through
autocomplete options could temporarily mess up the order of items. This
patch fixes that flaw by adding two new variables to help keep track of
the state:
- 'last', the last key that was recorded by getchar(),
- and 'length', which keeps track of the length of the last buffer
generated by the autocomplete() function.
These variables are then checked first whenever the user uses Tab or
Shift+Tab. The last know buffer 'length' is used to deal with overflow
in the case of Shift+Tab.
Finally, the logic for processing the autocomplete directory was moved
below the code for handling the actual user input (i.e. appending to the
getline() buffer). This is because the last character in the buffer
(i.e. the last character the user typed) is important for properly
updating the autcomplete working directory.
Signed-off-by: Rory Dudley <rory@netc.lu>
Diffstat (limited to 'git@git.dwarvish.org:dwarvish.git')
0 files changed, 0 insertions, 0 deletions