@@ -32,7 +32,7 @@ function M.NewWindow()
3232 Status .mainwindowbuf = vim .api .nvim_get_current_buf ()
3333 -- local file = vim.api.nvim_buf_get_name(0)
3434 -- local f = io.open(file, "r")
35- local messages = unpack (vim .api .nvim_buf_get_lines (M .mainwindowbuf , 0 , 1 , true ))
35+ local messages = unpack (vim .api .nvim_buf_get_lines (Status .mainwindowbuf , 0 , 1 , true ))
3636 if messages == nil then
3737 return
3838 end
@@ -114,20 +114,20 @@ function M.Highlight()
114114 M .mainwindowbuf = vim .api .nvim_get_current_buf ()
115115 local line , _ = unpack (vim .api .nvim_win_get_cursor (0 ))
116116 -- print(line)
117- local length = vim .api .nvim_buf_line_count (M .mainwindowbuf )
117+ local length = vim .api .nvim_buf_line_count (Status .mainwindowbuf )
118118 if M .clearafter then
119- vim .api .nvim_buf_clear_highlight (M .mainwindowbuf , - 1 , 0 , length )
119+ vim .api .nvim_buf_clear_highlight (Status .mainwindowbuf , - 1 , 0 , length )
120120 end
121121 local start , final = getrange (line , length )
122122 local start2 , final2 = getrangeoverflow (line , length )
123123 -- print(start)
124124 -- print(final)
125- highlight .highlight (M .mainwindowbuf , line )
125+ highlight .highlight (Status .mainwindowbuf , line )
126126 for i = start , line - 1 , 1 do
127- highlight .highlight (M .mainwindowbuf , i )
127+ highlight .highlight (Status .mainwindowbuf , i )
128128 end
129129 for i = line + 1 , final , 1 do
130- highlight .highlight (M .mainwindowbuf , i )
130+ highlight .highlight (Status .mainwindowbuf , i )
131131 end
132132 if M .showoverflow then
133133 table.insert (Status .overflowtext , overflow .OverFlow (line , Status .header , 1 ))
@@ -162,15 +162,15 @@ function M.add_mappings()
162162 -- print(M.mainwindowbuf)
163163 local opts = { nowait = true , noremap = true , silent = true }
164164 -- vim.api.nvim_buf_set_keymap(M.mainwindowbuf, "n", "<leader>td", ":lua require'csvtools'.CloseWindow<cr>", opts)
165- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>tf" , " :lua require'csvtools'.NewWindow()<cr>" , opts )
166- vim .api .nvim_buf_set_keymap (M .buf , " n" , " <leader>td" , " :lua require'csvtools'.CloseWindow()<cr>" , opts )
167- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>td" , " :lua require'csvtools'.CloseWindow()<cr>" , opts )
168- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>tr" , " :lua require'csvtools'.CloseOverFlow()<cr>" , opts )
169- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>tg" , " :lua require'csvtools'.Ifclear()<cr>" , opts )
170- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <up>" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
171- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " k" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
172- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <down>" , " :+1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
173- vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " j" , " :+1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
165+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <leader>tf" , " :lua require'csvtools'.NewWindow()<cr>" , opts )
166+ vim .api .nvim_buf_set_keymap (Status .buf , " n" , " <leader>td" , " :lua require'csvtools'.CloseWindow()<cr>" , opts )
167+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <leader>td" , " :lua require'csvtools'.CloseWindow()<cr>" , opts )
168+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <leader>tr" , " :lua require'csvtools'.CloseOverFlow()<cr>" , opts )
169+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <leader>tg" , " :lua require'csvtools'.Ifclear()<cr>" , opts )
170+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <up>" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
171+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " k" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
172+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " <down>" , " :+1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
173+ vim .api .nvim_buf_set_keymap (Status .mainwindowbuf , " n" , " j" , " :+1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
174174end
175175function M .setup (opts )
176176 M = vim .tbl_deep_extend (" force" , M , opts )
0 commit comments