aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* vim-patch:9.0.0042: missing change for filetype detectionsmjonas2022-07-06
| | | | | | Problem: Missing change for filetype detection. Solution: Include change to detect guile from shebang line. https://github.com/vim/vim/commit/324478037923feef1eb8a771648e38ade9e5e05a
* vim-patch:9.0.0041: a couple of filetype patterns do not have "*" before "/etc"smjonas2022-07-06
| | | | | | Problem: A couple of filetype patterns do not have "*" before "/etc". Solution: Add the star. (Jonas Strittmatter, closes vim/vim#10662) https://github.com/vim/vim/commit/704988f0c3598c1b0cc47f3b46f1f1229312f2bc
* refactor(runtime): port scripts.vim to lua (#18710)Jonas Strittmatter2022-07-03
|
* vim-patch:9.0.0012: signature files not detected properly (#19172)Christian Clason2022-07-01
| | | | | Problem: Signature files not detected properly. Solution: Add a function to better detect signature files. (Doug Kearns) https://github.com/vim/vim/commit/cdbfc6dbab1d63aa56af316d6b13e37939e7f7a8
* fix(filetype): update call sites of vim.filetype.match (#19171)Gregory Anders2022-06-30
| | | These were not updated in #18895.
* fix(lsp): small bugs in snippet-parser #18998L3MON4D32022-06-29
| | | | | | | | | This fixes the following bugs: `${1:else_text}` -> format with if_text: "else_text" `${1:-else_text}` -> format with if_text: "else_text" `${1:}` in `format` (eg. empty else_text) -> error. `${1:}` (eg. empty placeholder) -> error. Thanks hrsh7th :)
* vim-patch:9.0.0006: not all Visual Basic files are recognized (#19153)Christian Clason2022-06-29
| | | | | Problem: Not all Visual Basic files are recognized. Solution: Change detection of *.cls files. (Doug Kearns) https://github.com/vim/vim/commit/8b5901e2f9466eb6f38f5b251e871f609f65e252
* vim-patch:9.0.0005: hare files are not recognized (#19151)Christian Clason2022-06-29
| | | | | Problem: Hare files are not recognized. Solution: Add a filetype pattern. (Hugo Osvaldo Barrera, closes vim/vim#10630) https://github.com/vim/vim/commit/040674129f3382822eeb7b590380efa5228124a8
* fix(vim.ui.input): accept nil or empty "opts" #191090x74696d6d792022-06-28
| | | Fix #18143
* fix(filetype): check for non-nil match in detect.rules (#19129)Christian Clason2022-06-27
|
* refactor(filetype): allow vim.filetype.match to accept buf and filename (#19114)Gregory Anders2022-06-27
| | | | | | | This is necessary in cases where filetype detection acts recursively. For example, when matching files that end with .bak, the "root" of the filename is matched again against the same buffer (e.g. a buffer named "foo.c.bak" will be matched again with the filename "foo.c", using the same underlying buffer).
* refactor(filetype)!: allow vim.filetype.match to use different strategies ↵Gregory Anders2022-06-26
| | | | | | | | | | | | | | | | | | | (#18895) This enables vim.filetype.match to match based on a buffer (most accurate) or simply a filename or file contents, which are less accurate but may still be useful for some scenarios. When matching based on a buffer, the buffer's name and contents are both used to do full filetype matching. When using a filename, if the file exists the file is loaded into a buffer and full filetype detection is performed. If the file does not exist then filetype matching is only performed against the filename itself. Content-based matching does the equivalent of scripts.vim, and matches solely based on file contents without any information from the name of the file itself (e.g. for shebangs). BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead of `vim.filetype.match(name, bufnr)`
* fix(filetype.lua): always return a string in getlines function (#19080)Hazel Weakly2022-06-24
| | | | This re-introduces the fix that the filetype.lua refactor inadvertently reverted. The fix ensures that in the case when end_lnum is omitted, a string is always returned.
* refactor(runtime): refactor filetype.lua (#18813)Jonas Strittmatter2022-06-21
| | | | Move some filetype detection functions to detect.lua, sort patterns by detected filetype.
* refactor: use nvim_{get,set}_option_value for vim.{b,w}oGregory Anders2022-06-20
| | | | | | | | | | | | | | | | | | | `nvim_get_option_value` and `nvim_set_option_value` better handle unsetting local options. For instance, this is currently not possible: vim.bo.tagfunc = nil This does not work because 'tagfunc' is marked as "local to buffer" and does not have a fallback global option. However, using :setlocal *does* work as expected :setlocal tagfunc= `nvim_set_option_value` behaves more like :set and :setlocal (by design), so using these as the underlying API functions beneath vim.bo and vim.wo makes those two tables act more like :setlocal. Note that vim.o *already* uses `nvim_set_option_value` under the hood, so that vim.o behaves like :set.
* fix(treesitter): new iter if foldedkevinhwang912022-06-16
|
* fix(lua): highlight.on_yank can close timer in twice #18976notomo2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Steps to reproduce: 1. setting `vim.highlight.on_yank` ``` vim.api.nvim_create_autocmd({ "TextYankPost" }, { pattern = { "*" }, callback = function() vim.highlight.on_yank({ timeout = 200 }) end, }) ``` 2. repeat typing `yeye` ... 3. causes the following error. ``` Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x01e96970 is already closing stack traceback: [C]: in function 'close' vim/_editor.lua: in function '' vim/_editor.lua: in function <vim/_editor.lua:0> ``` 📝 Test result before fix: [----------] Global test environment setup. [----------] Running tests from test/functional/lua/highlight_spec.lua [ RUN ] vim.highlight.on_yank does not show errors even if buffer is wiped before timeout: 15.07 ms OK [ RUN ] vim.highlight.on_yank does not show errors even if executed between timeout and clearing highlight: 15.07 ms ERR test/helpers.lua:73: Expected objects to be the same. Passed in: (string) 'Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x02025260 is already closing stack traceback: [C]: in function 'close' vim/_editor.lua: in function '' vim/_editor.lua: in function <vim/_editor.lua:0>' Expected: (string) ''
* docs: fix typos (#18866)dundargoc2022-06-15
| | | | | | | docs: fix typos and similarly insignificant changes Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
* feat(lsp): sort codelens if multiple item per line (#18951)rhcher2022-06-13
|
* feat(filetype): remove side effects from vim.filetype.match (#18894)Gregory Anders2022-06-09
| | | | | | | | Many filetypes from filetype.vim set buffer-local variables, meaning vim.filetype.match cannot be used without side effects. Instead of setting these buffer-local variables in the filetype detection functions themselves, have vim.filetype.match return an optional function value that, when called, sets these variables. This allows vim.filetype.match to work without side effects.
* fix(diagnostic): check for negative column value (#18868)mohsen2022-06-08
|
* refactor(runtime): port remaining patterns from filetype.vim to filetype.lua ↵Jonas Strittmatter2022-06-06
| | | | (#18814)
* fix(lsp): fix multi client handling in code action (#18869)Mathias Fußenegger2022-06-05
| | | Fixes https://github.com/neovim/neovim/issues/18860
* perf(tests): don't invoke nvim_get_all_options_info until neededbfredl2022-06-05
| | | | | This call alone is responible of 40 000 000 out of 80 000 000 individual alloc/free calls in the test suite.
* fix(lsp): set buflisted before switching to buffer (#18854)zeertzjq2022-06-04
|
* vim-patch:8.2.5054: no good filetype for conf files similar to dosini (#18851)Christian Clason2022-06-04
| | | | | Problem: No good filetype for conf files similar to dosini. Solution: Add the confini filetype. (closes vim/vim#10510) https://github.com/vim/vim/commit/635f48010dcf6d97f3a65b4785e1726ad386d3eb
* docs: fix typos (#18269)dundargoc2022-06-04
| | | | | | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Dan Sully <dan+github@sully.org> Co-authored-by: saher <msaher.shair@gmail.com> Co-authored-by: Stephan Seitz <stephan.seitz@fau.de> Co-authored-by: Benedikt Müller <d12bb@posteo.de> Co-authored-by: Andrey Mishchenko <mishchea@gmail.com> Co-authored-by: Famiu Haque <famiuhaque@protonmail.com> Co-authored-by: Oliver Marriott <hello@omarriott.com>
* fix(filetype): fix typo in starsetf function (#18856)Gregory Anders2022-06-03
|
* feat(lsp): send didChangeConfiguration after init (#18847)Mathias Fußenegger2022-06-03
| | | | | | | Most LSP servers require the notification to correctly load the settings and for those who don't it doesn't cause any harm. So far this is done in lspconfig, but with the addition of vim.lsp.start it should be part of core.
* feat(lsp): add a start function (#18631)Mathias Fußenegger2022-06-03
| | | | | | | | | | | | A alternative/subset of https://github.com/neovim/neovim/pull/18506 that should be forward compatible with a potential project system. Configuration of LSP clients (without lspconfig) now looks like this: vim.lsp.start({ name = 'my-server-name', cmd = {'name-of-language-server-executable'}, root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]), })
* fix(treesitter): correct region for string parser (#18794)Christian Clason2022-06-02
| | | fixes injections for string parsers after https://github.com/neovim/neovim/commit/eab4d03a3264b2afaf803ed839fa25bc4e7acedd
* fix(lua): stop pending highlight.on_yank timer, if any (#18824)Wsevolod2022-06-02
| | | | | When yanking another range while previous yank is still highlighted, the pending timer could clear the highlight almost immediately (especially when using larger `timeout`, i.e. 2000)
* fix(lsp): adjust offset encoding in lsp.buf.rename() (#18829)Fredrik Ekre2022-06-01
| | | | | | | | Fix a bug in lsp.buf.rename() where the range returned by the server in textDocument/prepareRename was interpreted as a byte range directly, instead of taking the negotiated offset encoding into account. This caused the placeholder value in vim.ui.input to be incorrect in some cases, for example when non-ascii characters are used earlier on the same line.
* fix(checkhealth): skip vim.health #18816Javier Lopez2022-06-01
| | | | | | | | | | | | | | | | | | Problem: https://github.com/neovim/neovim/pull/18720#issuecomment-1142614996 The vim.health module is detected as a healthcheck, which produces spurious errors: vim: require("vim.health").check() ======================================================================== - ERROR: Failed to run healthcheck for "vim" plugin. Exception: function health#check, line 20 Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to call field 'check' (a nil value) stack traceback: [string "luaeval()"]:1: in main chunk Solution: Skip vim.health when discovering healthchecks.
* feat(fs): add vim.fs.normalize()Gregory Anders2022-05-31
|
* feat(fs): add vim.fs.find()Gregory Anders2022-05-31
| | | | | This is a pure Lua implementation of the Vim findfile() and finddir() functions without the special syntax.
* feat(fs): add vim.fs.dir()Gregory Anders2022-05-31
| | | | | This function is modeled after the path.dir() function from Penlight and the luafilesystem module.
* feat(fs): add vim.fs.basename()Gregory Anders2022-05-31
|
* feat(fs): add vim.fs.dirname()Gregory Anders2022-05-31
|
* feat(fs): add vim.fs.parents()Gregory Anders2022-05-31
| | | | | vim.fs.parents() is a Lua iterator that returns the next parent directory of the given file or directory on each iteration.
* refactor(checkhealth)!: rename to vim.health, move logic to Lua #18720Javier Lopez2022-05-31
| | | | | | | | | - Complete function: There was lots of unnecessary C code for the complete function, therefore moving it to Lua and use all the plumbing we have in place to retrieve the results. - Moving the module: It's important we keep nvim lua modules name spaced, avoids conflict with plugins, luarocks, etc.
* Merge pull request #18219 from kessejones/filetype-luaGregory Anders2022-05-31
|\ | | | | feat(filetype): add more filetype patterns to Lua
| * feat(filetype): convert more patterns to filetype.luaChristian Clason2022-05-30
| |
* | fix(lsp): include cancellable in progress message table (#18809)Chris Kipp2022-05-31
|/ | | | | | | | Currently the `title`, `message` and `percentage` is stored for a progress, but there is also an optional `cancellable` that comes in with both the `WorkDoneProgressBegin` and also `WorkDoneProgressReport`. This change also stores that value so that a plugin can access it when they do a lookup in `client.messages`.
* fix(treesitter): offset directive associates range with capture (#18276)Lewis Russell2022-05-28
| | | | | | | | | Previously the `offset!` directive populated the metadata in such a way that the new range could be attributed to a specific capture. #14046 made it so the directive simply stored just the new range in the metadata and information about what capture the range is based from is lost. This change reverts that whilst also correcting the docs.
* feat(lsp): turn rename filter into a predicate (#18745)Mathias Fußenegger2022-05-26
| | | Same as https://github.com/neovim/neovim/pull/18458 but for rename
* vim-patch:8.2.5015: Hoon and Moonscript files are not recognized (#18747)dundargoc2022-05-25
| | | | | Problem: Hoon and Moonscript files are not recognized. Solution: Add filetype patterns. (Goc Dundar, closes vim/vim#10478) https://github.com/vim/vim/commit/bf82df0dd48a26404b92a596498b6892c9572c53
* refactor(lsp): remove redundant client cleanup (#18744)Gregory Anders2022-05-25
| | | | | | The client state is cleaned up both in client.stop() as well as in the client.on_exit() handler. Technically, the client has not actually stopped until the on_exit handler is called, so we should just do this cleanup there and remove it from client.stop().
* feat(lsp)!: turn format filter into predicate (#18458)Mathias Fußenegger2022-05-25
| | | | | This makes the common use case easier. If one really needs access to all clients, they can create a filter function which manually calls `get_active_clients`.
* fix(lsp): respect global syntax setting in open float preview (#15225)Elton Leander Pinto2022-05-25
|