diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-22 12:00:02 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-22 12:00:02 -0800 |
commit | 376e199ebb562672f415e548c9d127b24117f905 (patch) | |
tree | 9f433eaec84d8b0987aa0c455c4f7585fb26273b /reader.cpp | |
parent | a837a27b347e5c6b1669bbf83f7f0c0ce1c523df (diff) |
Removed a lot of string_buffer_t
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -937,7 +937,6 @@ static void completion_insert( const wchar_t *val, int flags ) int tok_start, tok_len, move_cursor; const wchar_t *begin, *end; - string_buffer_t sb; wchar_t *escaped; const wchar_t *buff = data->command_line.c_str(); @@ -947,33 +946,31 @@ static void completion_insert( const wchar_t *val, int flags ) tok_start = begin - buff; tok_len = end-begin; - sb_init( &sb ); - sb_append_substring( &sb, buff, begin - buff ); + wcstring sb(buff, begin - buff); if( do_escape ) { escaped = escape( val, ESCAPE_ALL | ESCAPE_NO_QUOTED ); - sb_append( &sb, escaped ); + sb.append( escaped ); move_cursor = wcslen(escaped); free( escaped ); } else { - sb_append( &sb, val ); + sb.append( val ); move_cursor = wcslen(val); } if( add_space ) { - sb_append( &sb, L" " ); + sb.append( L" " ); move_cursor += 1; } - sb_append( &sb, end ); + sb.append( end ); - reader_set_buffer( (wchar_t *)sb.buff, (begin-buff)+move_cursor ); - sb_destroy( &sb ); + reader_set_buffer( sb, (begin-buff)+move_cursor ); reader_super_highlight_me_plenty( data->buff_pos ); reader_repaint(); |