aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2018-11-05 19:19:39 +0900
committerJustin M. Keyes <justinkz@gmail.com>2018-12-27 22:45:47 +0100
commit4f030ec24e0e148bbb83aedaef7dd629e5fef130 (patch)
treefb8aab32db649987a8fa368e4fd16a6a2bbef06c
parentfad7a26bc52dd4b96dfb063707dbe9ae91fdbf1e (diff)
downloadrneovim-4f030ec24e0e148bbb83aedaef7dd629e5fef130.tar.gz
rneovim-4f030ec24e0e148bbb83aedaef7dd629e5fef130.tar.bz2
rneovim-4f030ec24e0e148bbb83aedaef7dd629e5fef130.zip
win/TUI: Fix scroll on Windows legacy console
-rw-r--r--src/nvim/tui/tui.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 6818d9a706..f444d1ec84 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -98,6 +98,7 @@ typedef struct {
bool can_change_scroll_region;
bool can_set_lr_margin;
bool can_set_left_right_margin;
+ bool can_scroll;
bool immediate_wrap_after_last_column;
bool bce;
bool mouse_enabled;
@@ -295,6 +296,11 @@ static void terminfo_start(UI *ui)
data->can_set_left_right_margin =
!!unibi_get_str(data->ut, unibi_set_left_margin_parm)
&& !!unibi_get_str(data->ut, unibi_set_right_margin_parm);
+ data->can_scroll =
+ !!unibi_get_str(data->ut, unibi_delete_line)
+ && !!unibi_get_str(data->ut, unibi_parm_delete_line)
+ && !!unibi_get_str(data->ut, unibi_insert_line)
+ && !!unibi_get_str(data->ut, unibi_parm_insert_line);
data->immediate_wrap_after_last_column =
conemu_ansi
|| terminfo_is_term_family(term, "cygwin")
@@ -1087,11 +1093,12 @@ static void tui_grid_scroll(UI *ui, Integer g, Integer startrow, Integer endrow,
ugrid_scroll(grid, top, bot, left, right, (int)rows,
&clear_top, &clear_bot);
- bool can_scroll = data->scroll_region_is_full_screen
- || (data->can_change_scroll_region
- && ((left == 0 && right == ui->width - 1)
- || data->can_set_lr_margin
- || data->can_set_left_right_margin));
+ bool can_scroll = data->can_scroll
+ && (data->scroll_region_is_full_screen
+ || (data->can_change_scroll_region
+ && ((left == 0 && right == ui->width - 1)
+ || data->can_set_lr_margin
+ || data->can_set_left_right_margin)));
if (can_scroll) {
// Change terminal scroll region and move cursor to the top