aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(treesitter): do not calc folds on unloaded buffersLewis Russell2023-05-02
| | | Fixes #23423
* fix(treesitter): foldexpr tweaksLewis Russell2023-05-01
| | | Some small general fixes found working on developing async parsing.
* vim-patch:9.0.1503: Luau files are not recognized (#23412)Christian Clason2023-05-01
| | | | | | | | Problem: Luau files are not recognized. Solution: Add a patter for Luau files. (Amaan Qureshi, closes vim/vim#12317) https://github.com/vim/vim/commit/2dcfe9ae1df61e1249520ed435dd8cf60e157103 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* perf(lsp): process semantic tokens response in a coroutine that yields every ↵jdrouhard2023-05-01
| | | | 5ms (#23375)
* fix(treesitter): redraw added/removed injections properly (#23287)Lewis Russell2023-04-30
| | | | | | When injections are added or removed make sure to: - invoke 'changedtree' callbacks for when new trees are added. - invoke 'changedtree' callbacks for when trees are invalidated - redraw regions when languagetree children are removed
* feat(treesitter): upstream query omnifunc from playground (#23394)Christian Clason2023-04-30
| | | and set by default in `ftplugin/query.lua`
* Merge pull request #23382 from gpanders/iter-benchmarkGregory Anders2023-04-29
|\ | | | | Add vim.iter benchmark to benchmark test suite
| * perf(iter): reduce number of table allocationsGregory Anders2023-04-28
| | | | | | | | | | | | | | | | Packing and unpacking return values impairs performance considerably. In an attempt to avoid creating tables as much as possible we can instead pass return values between functions (which does not require knowing the number of values a function might return). This makes the code more complex, but improves benchmark numbers non-trivially.
* | feat(treesitter): add query_linter from nvim-treesitter/playground (#22784)Stephan Seitz2023-04-29
|/ | | | Co-authored-by: clason <clason@users.noreply.github.com> Co-authored-by: lewis6991 <lewis6991@users.noreply.github.com>
* refactor(build): include lpeg as a librarybfredl2023-04-27
|
* Merge pull request #23303 from gpanders/more-vim-iterGregory Anders2023-04-25
|\ | | | | Create iter_spec and vim.iter module
| * refactor(iter): move helper functions under vim.iterGregory Anders2023-04-25
| | | | | | | | vim.iter is now both a function and a module (similar to vim.version).
* | feat(lua): vim.keycode (#22960)ii142023-04-25
|/ | | | | | Using nvim_replace_termcodes is too verbose, add vim.keycode for translating keycodes. Co-authored-by: ii14 <ii14@users.noreply.github.com>
* vim-patch:9.0.1478: filetypes for *.v files not detected properly (#23282)Christian Clason2023-04-23
| | | | | | | | | | | | * vim-patch:9.0.1478: filetypes for *.v files not detected properly Problem: Filetypes for *.v files not detected properly. Solution: Use the file contents to detect the filetype. (Turiiya, closes vim/vim#12281) https://github.com/vim/vim/commit/80406c26188219f3773b2e9c49160caeeb386ee2 Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com> Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
* vim-patch:9.0.1475: busted configuration files are not recognized (#23266)zeertzjq2023-04-22
| | | | | | | Problem: Busted configuration files are not recognized. Solution: Recognize busted configuration files as Lua. (Craig MacEachern, closes vim/vim#12209) Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
* feat(lsp): enable workspace/didChangeWatchedFiles by default (#23190)Jon Huhn2023-04-22
|
* refactor(iter): use metatable as packed table tag (#23254)Gregory Anders2023-04-21
| | | | | This is a more robust method for tagging a packed table as it completely eliminates the possibility of mistaking an actual table key as the packed table tag.
* refactor(lua): simplify vim.gsplit implJustin M. Keyes2023-04-21
|
* fix(lua): vim.split may trim inner empty itemsJustin M. Keyes2023-04-21
| | | | | | | | | | Problem: `vim.split('a:::', ':', {trimempty=true})` trims inner empty items. Regression from 9c49c1047079427ff0a2356cb37302934845108e Solution: Set `empty_start=false` when first non-empty item is found. close #23212
* fix(treesitter playground): fix the wrong range of a node displayed i… ↵William2023-04-20
| | | | | | | (#23209) fix(treesitter playground): wrong range of a node displayed in playground The call parameters order of the function `get_range_str` is flipped for the last two arguments compared to the declaration.
* Merge pull request #23198 from gpanders/iter-fixGregory Anders2023-04-19
|\ | | | | fix(iter): allow table values in iterator pipelines
| * fix(iter): remove special case totable for map-like tablesGregory Anders2023-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was originally meant as a convenience but prevents possible functionality. For example: -- Get the keys of the table with even values local t = { a = 1, b = 2, c = 3, d = 4 } vim.iter(t):map(function(k, v) if v % 2 == 0 then return k end end):totable() The example above would not work, because the map() function returns only a single value, and cannot be converted back into a table (there are many such examples like this). Instead, to convert an iterator into a map-like table, users can use fold(): vim.iter(t):fold({}, function(t, k, v) t[k] = v return t end)
| * fix(iter): add tag to packed tableGregory Anders2023-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If pack() is called with a single value, it does not create a table; it simply returns the value it is passed. When unpack is called with a table argument, it interprets that table as a list of values that were packed together into a table. This causes a problem when the single value being packed is _itself_ a table. pack() will not place it into another table, but unpack() sees the table argument and tries to unpack it. To fix this, we add a simple "tag" to packed table values so that unpack() only attempts to unpack tables that have this tag. Other tables are left alone. The tag is simply the length of the table.
* | vim-patch:9.0.1467: Jenkinsfiles are not recognized as groovy (#23195)Christian Clason2023-04-19
| | | | | | | | | | | | | | | | Problem: Jenkinsfiles are not recognized as groovy. Solution: Add a pattern for Jenkinsfiles. (closes vim/vim#12236) https://github.com/vim/vim/commit/142ffb024dd5123090c2fd02f55702e76520f1df Co-authored-by: dundargoc <gocdundar@gmail.com>
* | vim-patch:9.0.1464: strace filetype detection is expensive (#23175)Christian Clason2023-04-19
|/ | | | | | | | | Problem: Strace filetype detection is expensive. Solution: Match with a cheap pattern first. (Federico Mengozzi, closes vim/vim#12220) https://github.com/vim/vim/commit/6e5a9f948221b52caaaf106079cb3430c4dd7c77 Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com>
* feat(lua): add vim.iter (#23029)Gregory Anders2023-04-17
| | | | | vim.iter wraps a table or iterator function into an `Iter` object with methods such as `filter`, `map`, and `fold` which can be chained to produce iterator pipelines that do not create new tables at each step.
* fix(watchfiles): skip Created events when poll starts (#23139)Jon Huhn2023-04-17
|
* feat(diagnostic): specify diagnostic virtual text prefix as a functionIsak Samsten2023-04-17
| | | | - vim.diagnostic.config() now accepts a function for the virtual_text.prefix option, which allows for rendering e.g., diagnostic severities differently.
* fix(checkhealth): fix crash due to incorrect argument typedundargoc2023-04-16
|
* fix(lua): inspect_pos respect bufnr when get syntax info (#23098)Raphael2023-04-16
|
* vim-patch:9.0.1455: C++ 20 modules are not recognized (#23124)Christian Clason2023-04-16
| | | | | | | | | Problem: C++ 20 modules are not recognized. Solution: Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson, closes vim/vim#12261) https://github.com/vim/vim/commit/732d69e1918b28ad0fe16eb9bc5a776c7958122b Co-authored-by: Ben Jackson <puremourning@gmail.com>
* refactor: deprecate checkhealth functionsdundargoc2023-04-15
| | | | | | | | | | | | | | | | | | | | | | | The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error()
* feat(lua)!: add stricter vim.tbl_islist() and rename old one to ↵NAKAI Tsuyoshi2023-04-14
| | | | | | | | | | | | vim.tbl_isarray() (#16440) feat(lua)!: add stricter vim.tbl_islist(), rename vim.tbl_isarray() Problem: `vim.tbl_islist` allows gaps in tables with integer keys ("arrays"). Solution: Rename `vim.tbl_islist` to `vim.tbl_isarray`, add new `vim.tbl.islist` that checks for consecutive integer keys that start from 1.
* feat(lua): vim.tbl_contains supports general tables and predicates (#23040)Christian Clason2023-04-14
| | | | | | | | | | | | * feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
* refactor: remove modelines from Lua filesGregory Anders2023-04-13
| | | | Now that we have builtin EditorConfig support and a formatting check in CI, these are not necessary.
* fix(loader): reset hashes when running the loaderLewis Russell2023-04-13
|
* fix(diagnostic): rename buffer → bufnr in type annotation (#23042)Mathias Fußenegger2023-04-12
| | | | See `:h diagnostic-structure`, the property name is `bufnr`, not `buffer`.
* feat(lua): vim.region accepts getpos() arg (#22635)NAKAI Tsuyoshi2023-04-11
|
* fix(treesitter): Use the correct replacement args for #gsub! directive (#23015)Scott Ming2023-04-11
| | | fix(treesitter): use the correct replacement args for #gsub! directive
* feat(lua): allow vim.F.if_nil to take multiple arguments (#22903)Gregory Anders2023-04-07
| | | | | | | | | | | | The first argument which is non-nil is returned. This is useful when using nested default values (e.g. in the EditorConfig plugin). Before: local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) After: local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
* fix(treesitter): do not track ranges of the root tree (#22912)Lewis Russell2023-04-06
| | | Fixes #22911
* refactor: rename local API alias from a to apiLewis Russell2023-04-05
| | | | | | | | Problem: Codebase inconsistently binds vim.api onto a or api. Solution: Use api everywhere. a as an identifier is too short to have at the module level.
* refactor(lsp): do not parse verbose output when overwriting options (#22810)Michal Liszcz2023-04-05
|
* fix(windows): consistent normalization in fs.finddundargoc2023-04-04
| | | | | | | | | | | vim.fs.find(".luacheckrc") ``` c:\\projects\\neovim/.luacheckrc # before c:/projects/neovim/.luacheckrc # after ``` Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
* test: replace lfs with luv and vim.fsdundargoc2023-04-04
| | | | | | test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
* refactor(treesitter): move inspect_tree implLewis Russell2023-04-04
|
* docs: fix typosdundargoc2023-04-04
| | | | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: himanoa <matsunoappy@gmail.com>
* fix(treesitter): disable folding in inspect_tree() (#22885)Lewis Russell2023-04-04
|
* refactor(treesitter): delegate region calculation to treesitter (#22576)Lewis Russell2023-04-04
|
* fix(treesitter): use capture metadata range if exists danilax9992023-04-04
| | | use `treesitter.get_range` instead of inline expression