diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-07-15 10:45:18 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-07-15 10:45:18 -0700 |
commit | ea1bfd715e0765db680f804d2450d44e4028a519 (patch) | |
tree | 3f7702dcc5c65cbd1fff44191668dddfb231d062 /output.cpp | |
parent | b1281c3fb904c12b1710045c8084bc521e80d7f9 (diff) |
Set of changes to improve Unicode support with respect to combining characters.
Should address https://github.com/fish-shell/fish-shell/issues/155
Diffstat (limited to 'output.cpp')
-rw-r--r-- | output.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -507,8 +507,8 @@ void writestr_ellipsis( const wchar_t *str, int max_width ) while( *str != 0 ) { - int w = wcwidth( *str ); - if( written+w+wcwidth( ellipsis_char )>max_width ) + int w = fish_wcwidth( *str ); + if( written+w+fish_wcwidth( ellipsis_char )>max_width ) { break; } @@ -516,7 +516,7 @@ void writestr_ellipsis( const wchar_t *str, int max_width ) writech( *(str++) ); } - written += wcwidth( ellipsis_char ); + written += fish_wcwidth( ellipsis_char ); writech( ellipsis_char ); while( written < max_width ) @@ -541,13 +541,13 @@ int write_escaped_str( const wchar_t *str, int max_len ) if( max_len && (max_len < len)) { - for( i=0; (written+wcwidth(out[i]))<=(max_len-1); i++ ) + for( i=0; (written+fish_wcwidth(out[i]))<=(max_len-1); i++ ) { writech( out[i] ); - written += wcwidth( out[i] ); + written += fish_wcwidth( out[i] ); } writech( ellipsis_char ); - written += wcwidth( ellipsis_char ); + written += fish_wcwidth( ellipsis_char ); for( i=written; i<max_len; i++ ) { |