aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-11-11 10:33:02 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2018-12-31 12:44:22 +0100
commitdb14d78e4f90a0dab64beb569efe0a7d314db4a7 (patch)
tree6cf99bb730d2fb811bd3bd6ea02ed463460441e7
parentf6f8f0ee762aed40586429362b83e5c7d0ca0686 (diff)
downloadrneovim-db14d78e4f90a0dab64beb569efe0a7d314db4a7.tar.gz
rneovim-db14d78e4f90a0dab64beb569efe0a7d314db4a7.tar.bz2
rneovim-db14d78e4f90a0dab64beb569efe0a7d314db4a7.zip
multigrid: rename event to win_pos, make grid first
-rw-r--r--src/nvim/api/ui_events.in.h6
-rw-r--r--src/nvim/window.c6
-rw-r--r--test/functional/ui/screen.lua10
3 files changed, 12 insertions, 10 deletions
diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h
index 90f1d1b2a9..28beebb9e4 100644
--- a/src/nvim/api/ui_events.in.h
+++ b/src/nvim/api/ui_events.in.h
@@ -84,10 +84,10 @@ void grid_scroll(Integer grid, Integer top, Integer bot,
void grid_destroy(Integer grid)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
-void win_position(Integer win, Integer grid, Integer startrow,
- Integer startcol, Integer width, Integer height)
+void win_pos(Integer grid, Integer win, Integer startrow,
+ Integer startcol, Integer width, Integer height)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
-void win_hide(Integer win, Integer grid)
+void win_hide(Integer grid)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
void win_scroll_over_start(void)
FUNC_API_SINCE(5) FUNC_API_REMOTE_ONLY;
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 5fa33e618c..39fc1897ae 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6100,10 +6100,10 @@ void win_ui_flush(void)
FOR_ALL_TAB_WINDOWS(tp, wp) {
if (wp->w_pos_changed && wp->w_grid.ScreenLines != NULL) {
if (tp == curtab) {
- ui_call_win_position(wp->handle, wp->w_grid.handle, wp->w_winrow,
- wp->w_wincol, wp->w_width, wp->w_height);
+ ui_call_win_pos(wp->w_grid.handle, wp->handle, wp->w_winrow,
+ wp->w_wincol, wp->w_width, wp->w_height);
} else {
- ui_call_win_hide(wp->handle, wp->w_grid.handle);
+ ui_call_win_hide(wp->w_grid.handle);
}
wp->w_pos_changed = false;
}
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 8c5a44c6d3..f363068dfc 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -157,6 +157,7 @@ function Screen.new(width, height)
cmdline_block = {},
wildmenu_items = nil,
wildmenu_selected = nil,
+ win_position = nil,
_session = nil,
_default_attr_ids = nil,
_default_attr_ignore = nil,
@@ -801,10 +802,7 @@ function Screen:_handle_hl_attr_define(id, rgb_attrs, cterm_attrs, info)
self._new_attrs = true
end
-function Screen:_handle_win_position(win, grid, startrow, startcol, width, height)
- if self.win_position == nil then
- self.win_position = {}
- end
+function Screen:_handle_win_pos(grid, win, startrow, startcol, width, height)
self.win_position[grid] = {
win = win,
startrow = startrow,
@@ -815,6 +813,10 @@ function Screen:_handle_win_position(win, grid, startrow, startcol, width, heigh
-- TODO(utkarshme): Take apt action
end
+function Screen:_handle_win_hide(grid)
+ self.win_position[grid] = nil
+end
+
function Screen:get_hl(val)
if self._options.ext_newgrid then
return self._attr_table[val][1]