diff options
author | Christian Rishøj <christian@rishoj.net> | 2013-05-29 11:48:04 +0200 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-06-02 00:59:22 -0700 |
commit | 03e36bda720874f2383d692035eaa6f67bd5517e (patch) | |
tree | cbbf9e583e0163889ae88c4768e783b4651f3792 /reader.cpp | |
parent | a259c37415db5c37cbbd08c5946b981395d9ba1f (diff) |
make cursor placement consistent with `transpose-words` from readline
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3555,7 +3555,6 @@ const wchar_t *reader_readline(void) case R_TRANSPOSE_WORDS: { - size_t orig_pos = data->buff_pos; size_t len = data->command_length(); const wchar_t *buff = data->command_line.c_str(); const wchar_t *tok_begin, *tok_end, *prev_begin, *prev_end; @@ -3588,7 +3587,8 @@ const wchar_t *reader_readline(void) new_buff.append(sep); new_buff.append(prev); new_buff.append(trail); - set_command_line_and_position(new_buff, orig_pos); + /* Put cursor right after the second token */ + set_command_line_and_position(new_buff, tok_end - buff); } break; } |