aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
Commit message (Collapse)AuthorAge
...
* feat(lua): enable stack traces in error output (#16228)Gregory Anders2021-11-06
|
* feat: add vim.str_utf_{start,end} (#16129)Michael Lingelbach2021-10-30
| | | | | vim.str_utf_{start,end} return the offset from the current position to the start and end of the current utf-character (nearest codepoint) respectively.
* feat: add vim.str_utf_pos functionMichael Lingelbach2021-10-24
| | | | | vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently) in a string
* Merge pull request #14794 from BK1603/gdbserver_fixMatthieu Coudron2021-10-20
|\ | | | | functionaltest: fix running tests under gdbserver
| * test: close timers in vim_spec.lua functional testShreyansh Chouhan2021-09-20
| | | | | | | | | | | | | | Close the timer started during tests before closing the session. This fixes the uv_loop_close hangs happening in the functional tests. Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
* | feat(lua): allow passing handles to vim.b/w/tLewis Russell2021-10-19
| | | | | | | | | | | | vim.bo can target a specific buffer by indexing with a number, e.g: `vim.bo[2].filetype` can get/set the filetype for buffer 2. This change replicates that behaviour for the variable namespace.
* | fix(runtime): don't use regexes inside lua require'mod'Björn Linse2021-10-17
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently this only caches whether an rtp entry has a "lua/" subdir but we could consider cache other subdirs potentially or even "lua/mybigplugin/" possibly. Note: the async_leftpad test doesn't actually fail on master, at least not deterministically (even when disabling the fast_breakcheck throttling). It's still useful as a regression test for further changes and included as such.
* | refactor: use kwargs parameter in vim.splitGregory Anders2021-09-25
| |
* | feat: add trimempty optional parameter to vim.splitGregory Anders2021-09-25
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `split()` VimL function trims empty items from the returned list by default, so that, e.g. split("\nhello\nworld\n\n", "\n") returns ["hello", "world"] The Lua implementation of vim.split does not do this. For example, vim.split("\nhello\nworld\n\n", "\n") returns {'', 'hello', 'world', '', ''} Add an optional parameter to the vim.split function that, when true, trims these empty elements from the front and back of the returned table. This is only possible for vim.split and not vim.gsplit; because vim.gsplit is an iterator, there is no way for it to know if the current item is the last non-empty item. Note that in order to preserve backward compatibility, the parameter for the Lua vim.split function is `trimempty`, while the VimL function uses `keepempty` (i.e. they are opposites). This means there is a disconnect between these two functions that may surprise users.
* vim-patch:8.1.0793: incorrect error messages for functions that take a BlobSean Dewar2021-09-15
| | | | | | | Problem: Incorrect error messages for functions that now take a Blob argument. Solution: Adjust the error messages. (Dominique Pelle, closes vim/vim#3846) https://github.com/vim/vim/commit/0d17f0d1c09fa6db306336695ba646c21ea24909
* feat(lua)!: register_keystroke_callback => on_keyJustin M. Keyes2021-09-09
| | | | | | | | | Analogous to nodejs's `on('data', …)` interface, here on_key is the "add listener" interface. ref 3ccdbc570d85 #12536 BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
* fix(lua): preserve argument lists which are not listsBjörn Linse2021-08-29
|
* fix(shared): do not treat empty tables as list in deep extend (#15094)Folke Lemaitre2021-07-19
| | | | | | | | | | An empty table was previously always treated as a list, which means that while merging tables, whenever an empty table was encountered it would always truncate any table on the left. `vim.tbl_deep_extend("force", { b = { a = 1 } }, { b = {} })` Before: `{ b = {} }` After: `{ b = { a = 1 } }`
* fix(vim.opt): vimL map string values not trimmed (#14982)jadedpasta2021-07-04
| | | | | | | | | Options formatted as a list of comma-separated key-value pairs may have values that contain leading and trailing whitespace characters. For example, the `listchars` option has a default value of `"tab:> ,trail:-,nbsp:+"`. When converting this value to a lua table, leading and trailing whitespace should not be trimmed. Co-authored-by: Robert Hrusecky <robert.hrusecky@utexas.edu>
* fix(vim.opt): Fix #14828 with empty values being incorrectly insertedTJ DeVries2021-06-29
|
* fix(vim.opt): Fix #14668 Now correctly handles unescaped commas in isfname styleTJ DeVries2021-06-29
|
* fix(vim.opt): Fix #14669 whichwrap now acts as expectedTJ DeVries2021-06-29
|
* fix(vim.opt): Add basic error handlingDavid Zhang2021-06-29
|
* fix(vim.opt): Get window options before setting.ckipp012021-06-29
| | | | | | | This closes #14677, but I also am a little unsure if there are times where this may not be correct. However, this just changes the behavior that even if `was_set` was false, we still get for `nvim_win_get_option`.
* fix(vim.opt): #14708 Now lets you put duplicate values in wildmodeTJ DeVries2021-06-29
|
* api: add nvim_win_callnotomo2021-06-10
|
* lua: Add vim.opt and fix scopes of vim.o (#13479)TJ DeVries2021-05-28
| | | | | | | | | | | | | * lua: Add vim.opt * fixup: cleaning * fixup: comments * ty clason * fixup: comments * this is the last commit. period.
* lua: use proper conversion of vim.g valuesBjörn Linse2021-05-19
|
* use pcall_errsmolck2021-03-09
|
* vim.fn: add test for errorsmolck2021-02-04
|
* runtime: propagate lua parsing errors while using "require"dm1try2020-12-10
|
* lua: make vim.inspect available early so it can be used for path debuggingBjörn Linse2020-11-05
|
* Merge pull request #12053 from tjdevries/tjdevries/nicer_validateTJ DeVries2020-10-17
|\ | | | | vim.validate(): include stacktrace in message
| * test/vim.validate(): assert normalized stacktraceJustin M. Keyes2020-10-05
| | | | | | | | | | | | | | - The previous commit lost information in the tests. Instead, add some more "normalization" substitutions in pcall_err(), so that the general shape of the stacktrace is included in the asserted text. - Eliminate contains(), it is redundant with matches()
| * vim.validate(): include stacktrace in messageTJ DeVries2020-10-05
| |
* | lua: vim.wait allows control of fast events (#13053)TJ DeVries2020-10-06
|/ | | | | | | | | * lua: vim.wait allows control of fast events * fixup: remove requirement of function for easier waiting * fixup: lint * fixup: bfredl comments
* api: add nvim_buf_call to call function with curbuf changed to bufferBjörn Linse2020-09-13
|
* lua: add vim.register_keystroke_callback (#12536)TJ DeVries2020-08-14
| | | | | | | | | | | | | | | * feat: Add vim.register_keystroke_callback * fixup: Forgot to remove mention of old option * fixup: Answer jamessan comments * fixup: Answer norcalli comments * fixup: portability * Update runtime/doc/lua.txt Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
* test: remove flaky unhelpful testTJ DeVries2020-06-06
| | | | vim.wait( sthg)
* lua: fix behavior when split empty string (#12429)notomo2020-06-04
| | | | | * lua: fix behavior when split empty string * test: lsp.util.apply_text_edits with an empty edit
* lua: fix infinite loop for vim.split on empty string (#12420)notomo2020-06-02
|
* lua: vim.wait implementationTJ DeVries2020-05-30
|
* test: fix flaky vim.defer_fn testHirokazu Hata2020-05-19
|
* lua: Add highlight.on_yank (#12279)Christian Clason2020-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add lua function to highlight yanked region * extract namespace, better naming, default values * add default for event argument * free timer * factor out mark to position calculation * d'oh * make sure timer stops before callback (cf. luv example) * factor out timer, more documentation * fixup * validate function argument for schedule * fix block selection past eol * correct handling of multibyte characters * move arguments around, some cleanup * move utility functions to vim.lua * use anonymous namespaces, avoid local api * rename function * add test for schedule_fn * fix indent * turn hl-yank into proper (hightlight) module * factor out position-to-region function mark extraction now part of highlight.on_yank * rename schedule_fn to defer_fn * add test for vim.region * todo: handle double-width characters * remove debug printout * do not shadow arguments * defer also callable table * whitespace change * move highlight to vim/highlight.lua * add documentation * add @return documentation * test: add check before vim.defer fires * doc: fixup
* lua: add tbl_deep_extend (#11969)Hirokazu Hata2020-05-17
|
* lua: Add buffer, window and tab accessors (#12268)TJ DeVries2020-05-07
| | | | | * Add buffer, window and tab accessors * Fix deletion and add tests
* lua: allow deepcopy of functions (#12136)Tristan Konolige2020-04-19
|
* lua: add vim.tbl_len() #11889Hirokazu Hata2020-03-01
|
* lua: add regex support, and `@match` support in treesitter queriesBjörn Linse2020-02-26
|
* lua: move test helper function, map and filter, to vim.shared moduleHirokazu Hata2020-02-18
|
* Merge pull request #11864 from h-michael/deepcopyBjörn Linse2020-02-15
|\ | | | | lua: vim.deepcopy() and vim.tbl_extend() should preserve vim.empty_dict()
| * lua: add vim.tbl_extend and vim.deepcopy testHirokazu Hata2020-02-14
| |
| * lua: vim.deepcopy uses empty_dict() instead of {} for empty_dict()Hirokazu Hata2020-02-13
| | | | | | | | fix: https://github.com/neovim/nvim-lsp/issues/94
* | test: add json_encode test for vim.empty_dict()Hirokazu Hata2020-02-12
|/
* lua: metatable for empty dict valueBjörn Linse2020-01-01
|