mirror of
https://github.com/neovim/neovim.git
synced 2026-08-03 14:19:15 +00:00
fix(text): validate opts.expandtab in vim.text.indent() #40936
This commit is contained in:
@@ -160,9 +160,12 @@ end
|
||||
function M.indent(size, text, opts)
|
||||
vim.validate('size', size, 'number')
|
||||
vim.validate('text', text, 'string')
|
||||
vim.validate('opts', opts, 'table', true)
|
||||
|
||||
-- TODO(justinmk): `opts.prefix`, `predicate` like python https://docs.python.org/3/library/textwrap.html
|
||||
vim.validate('opts', opts, 'table', true)
|
||||
opts = opts or {}
|
||||
vim.validate('opts.expandtab', opts.expandtab, 'number', true)
|
||||
|
||||
local tabspaces = opts.expandtab and (' '):rep(opts.expandtab) or nil
|
||||
|
||||
--- Minimum common indent shared by all lines.
|
||||
|
||||
Reference in New Issue
Block a user