diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-04-09 12:58:17 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-07-21 13:20:38 +0200 |
commit | 2134396074d86c344aaf43c3b839fd38c499fb69 (patch) | |
tree | 1a249204fb929bd1b781bc510d3f4f062ac41a60 /src | |
parent | 989b585e105b4f343f639abf5daf820de19d4a26 (diff) | |
download | rneovim-2134396074d86c344aaf43c3b839fd38c499fb69.tar.gz rneovim-2134396074d86c344aaf43c3b839fd38c499fb69.tar.bz2 rneovim-2134396074d86c344aaf43c3b839fd38c499fb69.zip |
ui: add TODO for non-working terminal linewrap
Note: this has not been working since the TUI reimplementation
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 20 | ||||
-rw-r--r-- | src/nvim/ui.c | 26 |
2 files changed, 27 insertions, 19 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index f9a474e44b..41a430bb8b 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4226,25 +4226,7 @@ win_line ( LineOffset[screen_row] + screen_Columns) == 2)) ) { - /* First make sure we are at the end of the screen line, - * then output the same character again to let the - * terminal know about the wrap. If the terminal doesn't - * auto-wrap, we overwrite the character. */ - if (ui_current_col() != wp->w_width) - screen_char(LineOffset[screen_row - 1] - + (unsigned)Columns - 1, - screen_row - 1, (int)(Columns - 1)); - - /* When there is a multi-byte character, just output a - * space to keep it simple. */ - if (ScreenLines[LineOffset[screen_row - 1] - + (Columns - 1)][1] != 0) { - ui_putc(' '); - } else { - ui_puts(ScreenLines[LineOffset[screen_row - 1] + (Columns - 1)]); - } - /* force a redraw of the first char on the next line */ - ScreenAttrs[LineOffset[screen_row]] = (sattr_T)-1; + ui_add_linewrap(screen_row-1); } } diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 301d3be00e..8419951079 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -403,6 +403,32 @@ void ui_cursor_goto(int new_row, int new_col) pending_cursor_update = true; } +void ui_add_linewrap(int row) +{ + // TODO(bfredl): check that this actually still works + // and move to TUI module in that case. +#if 0 + // First make sure we are at the end of the screen line, + // then output the same character again to let the + // terminal know about the wrap. If the terminal doesn't + // auto-wrap, we overwrite the character. + if (ui_current_col() != Columns) { + screen_char(LineOffset[row] + (unsigned)Columns - 1, row, + (int)(Columns - 1)); + } + + // When there is a multi-byte character, just output a + // space to keep it simple. */ + if (ScreenLines[LineOffset[row] + (Columns - 1)][1] != 0) { + ui_putc(' '); + } else { + ui_puts(ScreenLines[LineOffset[row] + (Columns - 1)]); + } + // force a redraw of the first char on the next line + ScreenAttrs[LineOffset[row+1]] = (sattr_T)-1; +#endif +} + void ui_mode_info_set(void) { Array style = mode_style_array(); |