@@ -86,6 +86,18 @@ local function getrangeoverflow(line, length)
8686 end
8787 return start , final
8888end
89+ function M .CloseOverFlow ()
90+ if M .showoverflow then
91+ for count = 1 , # Status .overflowtext do
92+ -- print(Status.overflowtext[count].bnr,Status.overflowtext[count].ns_id,Status.overflowtext[count].id)
93+ vim .api .nvim_buf_del_extmark (
94+ Status .overflowtext [count ].bnr ,
95+ Status .overflowtext [count ].ns_id ,
96+ Status .overflowtext [count ].id
97+ )
98+ end
99+ end
100+ end
89101function M .Highlight ()
90102 if vim .o .filetype == " csv" then
91103 Status .header = getheader .Header ()
139151function M .deleteMark ()
140152 if M .showoverflow then
141153 vim .api .nvim_buf_del_extmark (
142- Status .overflowtext [1 ].markid ,
154+ Status .overflowtext [1 ].bnr ,
143155 Status .overflowtext [1 ].ns_id ,
144156 Status .overflowtext [1 ].id
145157 )
@@ -153,6 +165,7 @@ function M.add_mappings()
153165 vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>tf" , " :lua require'csvtools'.NewWindow()<cr>" , opts )
154166 vim .api .nvim_buf_set_keymap (M .buf , " n" , " <leader>td" , " :lua require'csvtools'.CloseWindow()<cr>" , opts )
155167 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 )
156169 vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <leader>tg" , " :lua require'csvtools'.Ifclear()<cr>" , opts )
157170 vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " <up>" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
158171 vim .api .nvim_buf_set_keymap (M .mainwindowbuf , " n" , " k" , " :-1<cr>:lua require'csvtools'.Highlight()<cr>" , opts )
0 commit comments