neovim/test/unit
VanaIgr 3faedb0509
refactor(indent): refactor computing of a string's indent size (#27252)
The `get_indent_str_vtab()` function currently calls `tabstop_padding()`
every time a tab is encountered (unless tabstops aren't used).
`tabstop_padding()` either does a division by 'tabstop' If 'vartabstop'
is not set, or iterates through the 'vartabstop' list to find current
tab width. 

Since the virtual column only increases, we can keep track of where the
next tabstop would be, and update this information once it was reached.

`get_indent_str_vtab()` also depends on 'listchars' "tab" value from the
current window, even though it may be called for a line from the same
buffer in a different window. In most cases, it is called with tabstops
enabled (last argument was `false`), so I split the function into one
that uses tabstops and the other that doesn't.

I removed `get_indent_str()` since I couldn't find any calls to it.
2024-02-12 04:17:15 +08:00
..
api build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
charset build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
eval test: do not inject vim module into global helpers 2024-01-12 12:04:18 +00:00
fixtures refactor: change event_create() to a macro (#26343) 2023-12-01 15:22:22 +08:00
os test: use vim.mpack and vim.uv directly 2024-01-12 12:04:20 +00:00
viml test: move format_{string,luav} to a separate module 2024-01-17 10:10:17 +00:00
buffer_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
fileio_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
formatc.lua docs: small fixes (#26243) 2023-12-06 08:04:21 +08:00
garray_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
helpers.lua test: refactor Paths 2024-01-17 10:10:17 +00:00
indent_spec.lua refactor(indent): refactor computing of a string's indent size (#27252) 2024-02-12 04:17:15 +08:00
keycodes_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
marktree_spec.lua fix(extmark): fix crash when stepping out from internal node 2024-01-23 11:39:37 +01:00
mbyte_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
memory_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
message_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
msgpack_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
multiqueue_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
optionstr_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
path_spec.lua test: use vim.mpack and vim.uv directly 2024-01-12 12:04:20 +00:00
preload.lua test: replace lfs with luv and vim.fs 2023-04-04 21:59:06 +02:00
preprocess.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
profile_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
rbuffer_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
search_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
set.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
statusline_spec.lua refactor(api): refactor more api functions to use arena return 2024-02-08 14:40:34 +01:00
strings_spec.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
tempfile_spec.lua test: replace lfs with luv and vim.fs 2023-04-04 21:59:06 +02:00
testtest_spec.lua unittests: Collect traces 2017-04-01 12:25:10 +03:00
undo_spec.lua test: remove helpers.sleep() 2024-01-12 12:04:19 +00:00