Skip to content

Commit 84b813c

Browse files
author
cht
committed
add showoverflow session
1 parent 7718846 commit 84b813c

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ should not setup or
77
require("csvtools").setup({
88
before = 10,
99
after = 10,
10-
clearafter = true
10+
clearafter = true,
1111
-- this will clear the highlight of buf after move
12+
showoverflow = true,
13+
-- this will provide a overflow show
14+
1215
})
1316
```
1417

lua/csvtools.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local M = {
99
before = 20,
1010
after = 20,
1111
clearafter = true,
12+
showoverflow = true,
1213
overflowtext = {
1314
markid = nil,
1415
ns_id = nil,
@@ -81,7 +82,9 @@ function M.Highlight()
8182
local start, final = getrange(line, length)
8283
--print(start)
8384
--print(final)
84-
M.overflowtext = overflow.OverFlow(line, M.header)
85+
if M.showoverflow then
86+
M.overflowtext = overflow.OverFlow(line, M.header)
87+
end
8588
for i = start, line, 1 do
8689
highlight.highlight(M.mainwindowbuf, i)
8790
end
@@ -91,7 +94,9 @@ function M.Highlight()
9194
end
9295
end
9396
function M.deleteMark()
94-
vim.api.nvim_buf_del_extmark(M.overflowtext.markid, M.overflowtext.ns_id, M.overflowtext.id)
97+
if M.showoverflow then
98+
vim.api.nvim_buf_del_extmark(M.overflowtext.markid, M.overflowtext.ns_id, M.overflowtext.id)
99+
end
95100
end
96101
function M.add_mappings()
97102
M.mainwindowbuf = vim.api.nvim_get_current_buf()

0 commit comments

Comments
 (0)