Skip to content

Commit 0086efa

Browse files
author
Andrew Ferrier
committed
fix: Correct leading space calculation
1 parent bc43d6f commit 0086efa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/debugprint/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ local debugprint_addline = function(opts)
101101
-- 'default' indent for languages like Python, where the NeoVim or Treesitter
102102
-- indenter doesn't know how to indent them.
103103
local current_line = vim.api.nvim_get_current_line()
104-
local leading_space = current_line:match('(%s+)') or ''
104+
local leading_space = current_line:match('^(%s+)') or ''
105105

106106
if opts.above then
107107
line_to_insert_linenr = current_line_nr - 1

0 commit comments

Comments
 (0)