summaryrefslogtreecommitdiffstats
path: root/src/poem/recite.rs
diff options
context:
space:
mode:
authorRory Dudley2024-09-30 23:07:30 -0600
committerRory Dudley2024-09-30 23:08:20 -0600
commit07e75b3f63001ca509df8d5b5a33336ab994814f (patch)
tree3283fea468a166fea194c9bc487ef4bcdbca4bde /src/poem/recite.rs
parent41335c1618d3c7c1c5950a228ea15e2d0c3c2d8d (diff)
downloaddwarvish-main.tar.gz
Fix Tab/Shift+Tab autocomplete behaviorHEADmain
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 'src/poem/recite.rs')
0 files changed, 0 insertions, 0 deletions