aboutsummaryrefslogtreecommitdiffhomepage
path: root/screen.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-07-24 04:35:37 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-07-24 04:35:37 +0530
commit32d2d0f0d028e3f64edc1694d23a8283861a7e6d (patch)
tree5717e31256653dee0d80c467428f29ffc21d44e6 /screen.cpp
parent81e0342bf6b29fb0cebc726c6741deb82c3f1c23 (diff)
Minor refactoring and fixed a bug in history function
Diffstat (limited to 'screen.cpp')
-rw-r--r--screen.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/screen.cpp b/screen.cpp
index 4b9f3f59..03bdd5b4 100644
--- a/screen.cpp
+++ b/screen.cpp
@@ -875,6 +875,10 @@ void s_write( screen_t *s,
truncated_autosuggestion_line.push_back(ellipsis_char);
commandline = truncated_autosuggestion_line.c_str();
}
+ for( i=0; i<prompt_width; i++ )
+ {
+ s_desired_append_char( s, L' ', 0, 0, prompt_width );
+ }
/*
If overflowing, give the prompt its own line to improve the
@@ -882,23 +886,9 @@ void s_write( screen_t *s,
*/
if( max_line_width + prompt_width >= screen_width )
{
- for( i=0; i<prompt_width; i++ )
- {
- s_desired_append_char( s, L' ', 0, 0, prompt_width );
- }
-
s_desired_append_char( s, L'\n', 0, 0, 0 );
prompt_width=0;
}
- else
- {
- for( i=0; i<prompt_width; i++ )
- {
- s_desired_append_char( s, L' ', 0, 0, prompt_width );
- }
- }
-
-
for( i=0; commandline[i]; i++ )
{