aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-07-02 15:53:43 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-09-01 15:55:10 +0200
commitb51ba122c1edfb769e72c25c4f14f469f59f1b8e (patch)
tree84052cf27b2e1aa904b898cd01d9d35df9afaf92 /src/nvim/ex_getln.c
parent9cec097ffacfd0de100912781df2efed1a4c8ba9 (diff)
downloadrneovim-b51ba122c1edfb769e72c25c4f14f469f59f1b8e.tar.gz
rneovim-b51ba122c1edfb769e72c25c4f14f469f59f1b8e.tar.bz2
rneovim-b51ba122c1edfb769e72c25c4f14f469f59f1b8e.zip
screen: use dedicated message grid
add proper msg_set_pos event, delet win_scroll_over_* make compositor click through unfocusable grids add MsgArea attribute for the message/cmdline area, and add docs and tests
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 4e43e95c2e..4f35555098 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -310,6 +310,8 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
cmdmsg_rl = false;
}
+ msg_grid_validate();
+
redir_off = true; // don't redirect the typed command
if (!cmd_silent) {
gotocmdline(true);
@@ -908,7 +910,7 @@ static int command_line_execute(VimState *state, int key)
if (!cmd_silent) {
if (!ui_has(kUICmdline)) {
- ui_cursor_goto(msg_row, 0);
+ cmd_cursor_goto(msg_row, 0);
}
ui_flush();
}
@@ -2323,7 +2325,7 @@ redraw:
}
}
msg_clr_eos();
- ui_cursor_goto(msg_row, msg_col);
+ cmd_cursor_goto(msg_row, msg_col);
continue;
}
@@ -2391,7 +2393,7 @@ redraw:
line_ga.ga_len += len;
escaped = FALSE;
- ui_cursor_goto(msg_row, msg_col);
+ cmd_cursor_goto(msg_row, msg_col);
pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
/* We are done when a NL is entered, but not when it comes after an
@@ -3436,7 +3438,7 @@ void redrawcmd(void)
/* when 'incsearch' is set there may be no command line while redrawing */
if (ccline.cmdbuff == NULL) {
- ui_cursor_goto(cmdline_row, 0);
+ cmd_cursor_goto(cmdline_row, 0);
msg_clr_eos();
return;
}
@@ -3510,7 +3512,14 @@ static void cursorcmd(void)
}
}
- ui_cursor_goto(msg_row, msg_col);
+ cmd_cursor_goto(msg_row, msg_col);
+}
+
+static void cmd_cursor_goto(int row, int col)
+{
+ ScreenGrid *grid = &msg_grid_adj;
+ screen_adjust_grid(&grid, &row, &col);
+ ui_grid_cursor_goto(grid->handle, row, col);
}
void gotocmdline(int clr)
@@ -3519,13 +3528,15 @@ void gotocmdline(int clr)
return;
}
msg_start();
- if (cmdmsg_rl)
+ if (cmdmsg_rl) {
msg_col = Columns - 1;
- else
- msg_col = 0; /* always start in column 0 */
- if (clr) /* clear the bottom line(s) */
- msg_clr_eos(); /* will reset clear_cmdline */
- ui_cursor_goto(cmdline_row, 0);
+ } else {
+ msg_col = 0; // always start in column 0
+ }
+ if (clr) { // clear the bottom line(s)
+ msg_clr_eos(); // will reset clear_cmdline
+ }
+ cmd_cursor_goto(cmdline_row, 0);
}
/*