Skip to content

Commit 38572ce

Browse files
committed
default exclude_nodetype change to empty
1 parent a2eb2dc commit 38572ce

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Install with any plugin manager or as a NeoVim package.
1414
| char | Character to draw the indentation guides | `<BAR>` |
1515
| enabled | Default state of the plugin | `true` |
1616
| exclude | Disable in these filetypes | `{}` |
17-
| exclude_nodetype | TreeSitter classes where guides are not drawn | `{ 'string', 'comment' }` |
17+
| exclude_nodetype | TreeSitter classes where guides are not drawn | `{}` |
1818
| key | Hotkey to toggle the guides | `''` |
1919
| minlevel | Minimum level where indentation is drawn | `0` |
2020
| only_current | only highlight current indentation level | `false` |

lua/indentmini/init.lua

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local ffi, treesitter = require('ffi'), vim.treesitter
55
local opt = {
66
only_current = false,
77
exclude = { 'dashboard', 'lazy', 'help', 'nofile', 'terminal', 'prompt', 'qf' },
8-
exclude_nodetype = { 'string', 'comment' },
8+
exclude_nodetype = {},
99
config = {
1010
virt_text_pos = 'overlay',
1111
hl_mode = 'combine',
@@ -233,7 +233,8 @@ local function on_line(_, _, bufnr, row)
233233
col = level - 1
234234
end
235235
if context.has_ts then
236-
local node = treesitter.get_node({ bufnr = bufnr, pos = { row, col }, ignore_injections = true })
236+
local node =
237+
treesitter.get_node({ bufnr = bufnr, pos = { row, col }, ignore_injections = true })
237238
while node do
238239
if vim.tbl_contains(opt.exclude_nodetype, node:type()) then
239240
goto continue
@@ -296,7 +297,9 @@ local function on_win(_, winid, bufnr, toprow, botrow)
296297
context.currow = pos[1] - 1
297298
context.curcol = pos[2]
298299
local cur_indent = find_in_snapshot(context.currow + 1).indent
299-
local next_indent = (context.currow + 1 < context.count) and find_in_snapshot(context.currow + 2).indent or 0
300+
local next_indent = (context.currow + 1 < context.count)
301+
and find_in_snapshot(context.currow + 2).indent
302+
or 0
300303
-- We only want to look backwards if we are closing a block
301304
local line_text = api.nvim_get_current_line()
302305
local is_closer = line_text:find('^%s*[})%]]') or line_text:find('^%s*end')
@@ -317,24 +320,24 @@ local M = {}
317320
function M.toggle()
318321
enabled = not enabled
319322
vim.api.nvim__redraw({
320-
buf = vim.api.nvim_get_current_buf(),
321-
valid = false
323+
buf = vim.api.nvim_get_current_buf(),
324+
valid = false,
322325
})
323326
end
324327

325328
function M.enable()
326329
enabled = true
327330
vim.api.nvim__redraw({
328-
buf = vim.api.nvim_get_current_buf(),
329-
valid = false
331+
buf = vim.api.nvim_get_current_buf(),
332+
valid = false,
330333
})
331334
end
332335

333336
function M.disable()
334337
enabled = false
335338
vim.api.nvim__redraw({
336-
buf = vim.api.nvim_get_current_buf(),
337-
valid = false
339+
buf = vim.api.nvim_get_current_buf(),
340+
valid = false,
338341
})
339342
end
340343

0 commit comments

Comments
 (0)