@@ -4,7 +4,7 @@ local M = {}
4
4
5
5
local function window_context (win_handle , cursor_pos )
6
6
-- get a bunch of information about the window and the cursor
7
- vim .api .nvim_set_current_win (win_handle ) -- 1010
7
+ vim .api .nvim_set_current_win (win_handle )
8
8
local win_info = vim .fn .getwininfo (win_handle )[1 ]
9
9
local win_view = vim .fn .winsaveview ()
10
10
local top_line = win_info .topline - 1
@@ -25,7 +25,7 @@ local function window_context(win_handle, cursor_pos)
25
25
end
26
26
27
27
return {
28
- hwin = win_handle , -- 1010
28
+ hwin = win_handle ,
29
29
cursor_pos = cursor_pos ,
30
30
top_line = top_line ,
31
31
bot_line = bot_line ,
@@ -51,8 +51,8 @@ function M.get_window_context(multi_windows)
51
51
local all_ctxs = {}
52
52
53
53
-- Generate contexts of windows
54
- local cur_hwin = vim .api .nvim_get_current_win () -- 1010
55
- local cur_hbuf = vim .api .nvim_win_get_buf (cur_hwin ) -- 14
54
+ local cur_hwin = vim .api .nvim_get_current_win ()
55
+ local cur_hbuf = vim .api .nvim_win_get_buf (cur_hwin )
56
56
57
57
all_ctxs [# all_ctxs + 1 ] = {
58
58
hbuf = cur_hbuf , -- 14
@@ -63,11 +63,10 @@ function M.get_window_context(multi_windows)
63
63
return all_ctxs
64
64
end
65
65
66
- -- w == 1010, 1012, 1014, 1080, 1081
67
66
for _ , w in ipairs (vim .api .nvim_tabpage_list_wins (0 )) do
68
67
if vim .api .nvim_win_is_valid (w ) then
69
- if vim .api .nvim_win_get_config (w ).relative ~= ' win ' then -- 1080 or 1081
70
- local b = vim .api .nvim_win_get_buf (w ) -- 14
68
+ if vim .api .nvim_win_get_config (w ).relative == ' ' then
69
+ local b = vim .api .nvim_win_get_buf (w )
71
70
if w ~= cur_hwin then
72
71
73
72
-- check duplicated buffers; the way this is done is by accessing all the already known contexts and checking that
0 commit comments