diff options
author | Rory Dudley | 2024-09-01 04:18:43 -0600 |
---|---|---|
committer | Rory Dudley | 2024-09-01 04:18:43 -0600 |
commit | 0596517643d9daffa1c4b7b3b0f913ac6d1ab9cd (patch) | |
tree | d40a2364e89ece18aa9c26e4cf8ee321d94805f9 /src/recite/path.rs | |
parent | 398631015cac0174aeec5fd351fcfcaf51eb6ef0 (diff) | |
download | dwarvish-0596517643d9daffa1c4b7b3b0f913ac6d1ab9cd.tar.gz |
Slight refactor of getchar() and more handling for getline()
The getchar() function was changed so that it is able to detect some
ANSI escape sequences. To better handle this, getchar() now returns a
value from the Key enum, indicating whether or not an escape sequence
was found. Currently, the only escape sequences the function deals with
are arrow keys.
Handling of the left and right arrow keys were added to the getline()
function, in order to allow a user to go back and edit their command
inplace. Up and down arrow keys are also handled, but they are just
ignored for now (i.e. they do not move the cursor around anymore). The
local 'pos' variable became an Arc<Mutex<usize>>, since it needs to be
reset to 0 if ctrl-c is pressed (the handler for which is outside the
scope of getline()).
Diffstat (limited to 'src/recite/path.rs')
0 files changed, 0 insertions, 0 deletions