implement break_wide

for more pleasant east asian mixed display
This commit is contained in:
ailin-nemui 2017-01-20 10:32:23 +01:00
commit 876c1dd93e
3 changed files with 21 additions and 4 deletions

View file

@ -307,7 +307,7 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
continue;
}
if (!view->utf8 && char_width > 1) {
if (view->break_wide && char_width > 1) {
last_space = xpos;
last_space_ptr = next_ptr;
last_color = color; last_fg24 = fg24; last_bg24 = bg24;
@ -665,6 +665,16 @@ void textbuffer_view_set_default_indent(TEXT_BUFFER_VIEW_REC *view,
view->default_indent_func = indent_func;
}
/* Enable breaking of wide chars */
void textbuffer_view_set_break_wide(TEXT_BUFFER_VIEW_REC *view,
gboolean break_wide)
{
if (view->break_wide != break_wide) {
view->break_wide = break_wide;
view_reset_cache(view);
}
}
static void view_unregister_indent_func(TEXT_BUFFER_VIEW_REC *view,
INDENT_FUNC indent_func)
{