aboutsummaryrefslogtreecommitdiffhomepage
path: root/screen.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-05 00:05:42 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-05 00:05:42 -0800
commit21e83a881e59916cd4ad76c232e5857ef111be84 (patch)
treee2010898e25aae6929c90679abe6539033aa8143 /screen.cpp
parent5ba1261285853e3448fc4397f1ca3a1e1733f6ba (diff)
Bring back ellipsis
Diffstat (limited to 'screen.cpp')
-rw-r--r--screen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/screen.cpp b/screen.cpp
index 9c53decb..0bc102d1 100644
--- a/screen.cpp
+++ b/screen.cpp
@@ -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 )
{