Skip to content

Commit

Permalink
docs: Add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferrier committed Aug 17, 2022
1 parent 9601502 commit bc43d6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/debugprint/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ local debugprint_addline = function(opts)
line_to_insert_content = fixes.left .. debuginfo() .. fixes.right
end

-- Inserting the leading space from the current line effectively acts as a
-- 'default' indent for languages like Python, where the NeoVim or Treesitter
-- indenter doesn't know how to indent them.
local current_line = vim.api.nvim_get_current_line()
local leading_space = current_line:match('(%s+)') or ''

Expand Down

0 comments on commit bc43d6f

Please sign in to comment.