aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/vim.lua
Commit message (Collapse)AuthorAge
* refactor: move vim.lsp.diagnostic to vim.diagnosticGregory Anders2021-09-15
| | | | | | | | | | | This generalizes diagnostic handling outside of just the scope of LSP. LSP clients are now a specific case of a diagnostic producer, but the diagnostic subsystem is decoupled from the LSP subsystem (or will be, eventually). More discussion at [1]. [1]: https://github.com/neovim/neovim/pull/15585
* 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): make core vim module not dependent on $VIMRUNTIME functionsBjörn Linse2021-08-30
| | | | | | | | | | fixes #15524 Note: this is obviously a quickfix. A scalabe solution will involve being able to specify a _list_ of modules to be put into packages.preload, without needing to manually copypasta a blurb of C code. Perhaps even involving bytecode for static builds (to speedup initialization)
* fix(lua): preserve argument lists which are not listsBjörn Linse2021-08-29
|
* docs: make Lua docstrings consistent #15255Gregory Anders2021-08-22
| | | | | | | | | | | | The official developer documentation in in :h dev-lua-doc specifies to use "--@" for special/magic tokens. However, this format is not consistent with EmmyLua notation (used by some Lua language servers) nor with the C version of the magic docstring tokens which use three comment characters. Further, the code base is currently split between usage of "--@", "---@", and "--- @". In an effort to remain consistent, change all Lua magic tokens to use "---@" and update the developer documentation accordingly.
* fix(lua): ensure vim.region truncates to buf rangeMichael Lingelbach2021-06-11
| | | | | | | | If vim.region receives a large range outside of the current buffer bounds, it will not check the range ahead of time and loop until neovim exhausts the system memory. Fixes #14743
* 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
|
* lua: use WarningMsg for vim.notify() warnings (#14508)Shadman2021-05-10
|
* docs: Treesitter (#13260)TJ DeVries2021-05-01
| | | | | | | | | * doc & fixes: Generate treesitter docs * fixup to treesitter-core * docs(treesitter): fix docs for most functions Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* lua: make vim.cmd an alias of vim.api.nvim_exec() (#14401)Shadman2021-04-22
| | | | | Previously vim.cmd was an alias of nvim_command(). From now on it is an alias of nvim_exec().
* Merge pull request #13875 from smolck/vim_fn_error_on_apiBjörn Linse2021-03-09
|\ | | | | vim.fn: throw error when trying to use API function
| * Fix unused varargsmolck2021-02-06
| |
| * remove extra line, remove () in errorsmolck2021-02-04
| |
| * vim.fn: throw error when trying to use API functionsmolck2021-02-03
| |
* | fix(notify): Expected 3 arguments error (#13905)notomo2021-02-09
| |
* | feat: adds vim.notifyMatthieu Coudron2021-01-31
|/ | | | | | | | | | | | | Adds function to notify the user like this: `:lua vim.notify("hello user")` embeds log levels vim.log.levels. you can then reassign vim.notify to for instance ``` function notify_external(msg, log_level, opts) vim.fn.jobstart({"notify-send", msg }) end ```
* lua: complete methods in metatablesBjörn Linse2021-01-26
|
* Don't show entire context when completingTony Chen2021-01-26
|
* feat: add completion to ':lua'TJ DeVries2021-01-26
|
* Missing argument for package.loadlib()matveyt2021-01-22
| | | | | | Allow for foo.bar.baz module name Make luaopen_module() name compatible with Lua 5.1
* runtime: propagate lua parsing errors while using "require"dm1try2020-12-10
|
* lsp: vim.lsp.diagnostic (#12655)TJ DeVries2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaking Changes: - Deprecated all `vim.lsp.util.{*diagnostics*}()` functions. - Instead, all functions must be found in vim.lsp.diagnostic - For now, they issue a warning ONCE per neovim session. In a "little while" we will remove them completely. - `vim.lsp.callbacks` has moved to `vim.lsp.handlers`. - For a "little while" we will just redirect `vim.lsp.callbacks` to `vim.lsp.handlers`. However, we will remove this at some point, so it is recommended that you change all of your references to `callbacks` into `handlers`. - This also means that for functions like |vim.lsp.start_client()| and similar, keyword style arguments have moved from "callbacks" to "handlers". Once again, these are currently being forward, but will cease to be forwarded in a "little while". - Changed the highlight groups for LspDiagnostic highlight as they were inconsistently named. - For more information, see |lsp-highlight-diagnostics| - Changed the sign group names as well, to be consistent with |lsp-highlight-diagnostics| General Enhancements: - Rewrote much of the getting started help document for lsp. It also provides a much nicer configuration strategy, so as to not recommend globally overwriting builtin neovim mappings. LSP Enhancements: - Introduced the concept of |lsp-handlers| which will allow much better customization for users without having to copy & paste entire files / functions / etc. Diagnostic Enhancements: - "goto next diagnostic" |vim.lsp.diagnostic.goto_next()| - "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()| - For each of the gotos, auto open diagnostics is available as a configuration option - Configurable diagnostic handling: - See |vim.lsp.diagnostic.on_publish_diagnostics()| - Delay display until after insert mode - Configure signs - Configure virtual text - Configure underline - Set the location list with the buffers diagnostics. - See |vim.lsp.diagnostic.set_loclist()| - Better performance for getting counts and line diagnostics - They are now cached on save, to enhance lookups. - Particularly useful for checking in statusline, etc. - Actual testing :) - See ./test/functional/plugin/lsp/diagnostic_spec.lua - Added `guisp` for underline highlighting NOTE: "a little while" means enough time to feel like most plugins and plugin authors have had a chance to refactor their code to use the updated calls. Then we will remove them completely. There is no need to keep them, because we don't have any released version of neovim that exposes these APIs. I'm trying to be nice to people following HEAD :) Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
* lua: make vim.inspect available early so it can be used for path debuggingBjörn Linse2020-11-05
|
* startup: handle autoload and lua packages during startupBjörn Linse2020-11-02
| | | | ¡NO HAY BANDA!
* 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>
* lua: Add ability to pass lua functions directly to vimLTJ DeVries2020-07-10
|
* doc: mention that defer_fn applies schedule_wrap (#12601)Christian Clason2020-07-07
|
* lua: add options to highlight.on_yank (#12549)Christian Clason2020-07-05
| | | | | NOTE: Configuration options have changed for highlight.on_yank. Check help for |:help highlight.on_yank()|
* doc: fix scripts and regenerate (#12506)TJ DeVries2020-07-02
| | | | | | | | | | | | | | | | | * Fix some small doc issues * doc: fixup * doc: fixup * Fix lint and rebase * Remove bad advice * Ugh, stupid mpack files... * Don't let people include these for now until they specifically want to * Prevent duplicate tag
* 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 buffer, window and tab accessors (#12268)TJ DeVries2020-05-07
| | | | | * Add buffer, window and tab accessors * Fix deletion and add tests
* paste: support replace mode (#11945)Jesse2020-05-05
| | | | | | * paste: support replace mode * Clean up Co-authored-by: Jesse Bakker <git@jessebakker.com>
* lua: metatable for empty dict valueBjörn Linse2020-01-01
|
* Fix access on vim.wo (#11517)Ashkan Kiani2019-12-07
| | | * Add more tests for vim.wo
* Add vim.cmd as an alias for nvim_command (#11446)Ashkan Kiani2019-12-01
|
* Return nil instead of NIL for vim.env (#11486)Ashkan Kiani2019-12-01
|
* lua: make vim.wo and vim.bo used nested indexing for specified handleBjörn Linse2019-11-26
| | | | | Also missing option should be an error. Options are functionality, not arbitrary variable names (as for vim.g)
* Lua: vim.env, vim.{g,v,w,bo,wo} #11442Ashkan Kiani2019-11-24
| | | | | | | | - Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo} - Redo gen_char_blob to generate multiple blobs instead of just one so that multiple Lua modules can be inlined. - Reorder vim.lua inclusion so that it can use previously defined C functions and utility functions like vim.shared and vim.inspect things. - Inline shared.lua into nvim, but also keep it available in runtime.
* doc: Lua [ci skip] #11378Justin M. Keyes2019-11-17
| | | | - Rework :help lua-commands - Rename if_lua.txt => lua.txt
* lua LSP client: initial implementation (#11336)Ashkan Kiani2019-11-13
| | | | | | Mainly configuration and RPC infrastructure can be considered "done". Specific requests and their callbacks will be improved later (and also served by plugins). There are also some TODO:s for the client itself, like incremental updates. Co-authored by at-tjdevries and at-h-michael, with many review/suggestion contributions.
* Lua: mark some functions as "private"Justin M. Keyes2019-11-11
| | | | | | Problem: scripts/gen_vimdoc.py gets confused and tries to generate docs for `fn_index` and `func`. Solution: Rename them to be private.
* paste: Select-mode, Visual-mode #11360Justin M. Keyes2019-11-09
| | | fix #11344
* doc: vim.fn, vim.call(), vim.api [ci skip]Justin M. Keyes2019-11-06
|
* lua: add vim.fn.{func} for direct access to vimL functionBjörn Linse2019-10-27
| | | | | | | | compared to vim.api.|nvim_call_function|, this fixes some typing issues due to the indirect conversion via the API. float values are preserved as such (fixes #9389) as well as empty dicts/arrays. Ref https://github.com/norcalli/nvim.lua for the call syntax
* tree-sitter: rename tree_sitter => treesitter for consistencyBjörn Linse2019-09-28
|
* tree-sitter: add basic testing on ciBjörn Linse2019-09-28
| | | | build tree-sitter c parser on ci for testing purposes
* paste: fix handling of "<" in cmdline (#11094)Daniel Hahler2019-09-25
| | | Fixes https://github.com/neovim/neovim/issues/11088.
* Merge #10995 'paste: fix paste in terminal mode'Justin M. Keyes2019-09-11
|\
| * paste: fix paste in terminal modeBjörn Linse2019-09-11
|/