diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-02-27 04:17:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 04:17:12 -0800 |
| commit | 848a2d230083745f691498624c25ae493a8f0b6e (patch) | |
| tree | ca0b8d347e45cb23a9daadcc9a215617a9c4bf1d /scripts | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar.gz nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar.bz2 nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar.lz nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar.xz nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.tar.zst nvim-lspconfig-848a2d230083745f691498624c25ae493a8f0b6e.zip | |
refactor(docgen): use vim.text.indent() #3629
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/docgen.lua | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 538ed2ad..04bbd6cc 100755 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -35,21 +35,7 @@ local function map_sorted(t, func) end local function indent(n, s) - local prefix - if type(n) == 'number' then - if n <= 0 then - return s - end - prefix = string.rep(' ', n) - else - assert(type(n) == 'string', 'n must be number or string') - prefix = n - end - local lines = vim.split(s, '\n') - for i, line in ipairs(lines) do - lines[i] = prefix .. line - end - return table.concat(lines, '\n') + return vim.text.indent(n, s) end local function make_parts(fns) |
