diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-05 00:05:42 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-05 00:05:42 -0800 |
commit | 21e83a881e59916cd4ad76c232e5857ef111be84 (patch) | |
tree | e2010898e25aae6929c90679abe6539033aa8143 /screen.cpp | |
parent | 5ba1261285853e3448fc4397f1ca3a1e1733f6ba (diff) |
Bring back ellipsis
Diffstat (limited to 'screen.cpp')
-rw-r--r-- | screen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -968,6 +968,7 @@ void s_write( screen_t *s, assert(screen_width - prompt_width >= 1); max_line_width = screen_width - prompt_width - 1; truncated_autosuggestion_line = wcstring(commandline, 0, last_char_that_fits); + truncated_autosuggestion_line.push_back(ellipsis_char); commandline = truncated_autosuggestion_line.c_str(); } for( size_t i=0; i<prompt_width; i++ ) @@ -1002,6 +1003,17 @@ void s_write( screen_t *s, s_desired_append_char( s, commandline[i], col, indent[i], prompt_width ); + if( i== cursor_pos && s->desired.cursor.y != cursor_arr.y && commandline[i] != L'\n' ) + { + /* + Ugh. We are placed exactly at the wrapping point of a + wrapped line, move cursor to the line below so the + cursor won't be on the ellipsis which looks + unintuitive. + */ + cursor_arr.x = s->desired.cursor.x - fish_wcwidth(commandline[i]); + cursor_arr.y = s->desired.cursor.y; + } } if( i == cursor_pos ) { |