mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
Remove ellipsis and newlines from long lines
Fix for issue https://github.com/fish-shell/fish-shell/issues/300
This commit is contained in:
39
output.cpp
39
output.cpp
@@ -489,43 +489,6 @@ void writestr( const wchar_t *str )
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
|
||||
void writestr_ellipsis( const wchar_t *str, int max_width )
|
||||
{
|
||||
int written=0;
|
||||
int tot;
|
||||
|
||||
CHECK( str, );
|
||||
|
||||
tot = my_wcswidth(str);
|
||||
|
||||
if( tot <= max_width )
|
||||
{
|
||||
writestr( str );
|
||||
return;
|
||||
}
|
||||
|
||||
while( *str != 0 )
|
||||
{
|
||||
int w = fish_wcwidth( *str );
|
||||
if( written+w+fish_wcwidth( ellipsis_char )>max_width )
|
||||
{
|
||||
break;
|
||||
}
|
||||
written+=w;
|
||||
writech( *(str++) );
|
||||
}
|
||||
|
||||
written += fish_wcwidth( ellipsis_char );
|
||||
writech( ellipsis_char );
|
||||
|
||||
while( written < max_width )
|
||||
{
|
||||
written++;
|
||||
writestr( L" " );
|
||||
}
|
||||
}
|
||||
|
||||
int write_escaped_str( const wchar_t *str, int max_len )
|
||||
{
|
||||
|
||||
@@ -546,8 +509,6 @@ int write_escaped_str( const wchar_t *str, int max_len )
|
||||
writech( out[i] );
|
||||
written += fish_wcwidth( out[i] );
|
||||
}
|
||||
writech( ellipsis_char );
|
||||
written += fish_wcwidth( ellipsis_char );
|
||||
|
||||
for( i=written; i<max_len; i++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user