diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-07-15 10:45:18 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-07-15 10:45:18 -0700 |
commit | ea1bfd715e0765db680f804d2450d44e4028a519 (patch) | |
tree | 3f7702dcc5c65cbd1fff44191668dddfb231d062 /reader.cpp | |
parent | b1281c3fb904c12b1710045c8084bc521e80d7f9 (diff) |
Set of changes to improve Unicode support with respect to combining characters.
Should address https://github.com/fish-shell/fish-shell/issues/155
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -721,9 +721,14 @@ static void remove_backward() if( data->buff_pos <= 0 ) return; - - data->command_line.erase(data->buff_pos-1, 1); - data->buff_pos--; + + /* Fake composed character sequences by continuning to delete until we delete a character of width at least 1. */ + int width; + do { + data->buff_pos -= 1; + width = fish_wcwidth(data->command_line.at(data->buff_pos)); + data->command_line.erase(data->buff_pos, 1); + } while (width == 0 && data->buff_pos > 0); data->command_line_changed(); data->suppress_autosuggestion = true; |