aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* fix(events): trigger VimResume on next UI request (#24426)zeertzjq2023-07-23
|
* fix(api/options): validate buf and winLewis Russell2023-07-22
| | | Fixes #24398
* fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End (#24418)zeertzjq2023-07-22
|
* test(vim.ui.open): mock failure on WindowsJustin M. Keyes2023-07-21
| | | | | | | | | Problem: On Windows, `rundll32` exits zero (success) even when given a non-existent file. Solution: Mock vim.system() on Windows to force a "failure" case.
* docs: also change "vimL" and "viml" to "Vimscript" (#24414)zeertzjq2023-07-21
|
* fix(folds): update folds in Insert mode with fdm=indent (#24402)Brandon Simmons2023-07-21
| | | | | | | | | | | Previously, when using foldmethod=indent, inserting an unindented line would inadvertently open closed folds below it. As a performance improvement, folds were only updated once, across all lines, after Insert mode was exited. Now, the performance improvement is no longer being used when foldmethod=indent, so folds are updated multiple times during Insert mode, but only across the lines that are changing, which preserves the folds (and their open/close states) instead of recreating them.
* feat(lsp): implement textDocument/diagnostic (#24128)Chris AtLee2023-07-20
|
* feat(decoration_provider): log errors as error messagesThomas Vigouroux2023-07-19
|
* test(startup_spec): add a test for #18315 (#24391)zeertzjq2023-07-19
|
* fix(fs.lua): normalize slash truncation (#23753)Mike2023-07-18
| | | Preserve last slash in windows' root drive directories
* feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113)Mathias Fußenegger2023-07-17
|
* fix(terminal): don't send unknown special keys to terminal (#24378)zeertzjq2023-07-17
| | | | Special keys are negative integers, so sending them to terminal leads to strange behavior.
* feat(options)!: remove compatible behaviours for vim 5.0 and earlierLewis Russell2023-07-17
|
* test(fs): vim.loop was renamed to vim.uv (#24376)kylo2522023-07-17
| | | test(fs): vim.loop has been replaced with vim.uv
* fix(inccommand): block errors when parsing command line again (#24374)zeertzjq2023-07-17
| | | Revert the change to ex_getln.c from a741c7fd0465c949a0016fcbee5f4526b65f8c02
* test(fs): get tmpdir robustly #23021kylo2522023-07-16
| | | | | | | | Problem: helpers.tmpname() may create a local file, depending on circumstances. Solution: Only use helpers.tmpname() for its parent directory (the "temp root"). Use fs_mkdtemp() to actually get a unique name.
* fix(lsp): markdown code fence should allow space before info string #24364Mike2023-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Bash language server returns "hover" markdown content that starts with a code fence and info string of `man` preceded by whitespace, which Nvim does not render properly. See https://github.com/bash-lsp/bash-language-server/blob/0ee73c53cebdc18311d4a4ad9367185ea4d98a03/server/src/server.ts#L821C15-L821C15 ```typescript function getMarkdownContent(documentation: string, language?: string): LSP.MarkupContent { return { value: language ? // eslint-disable-next-line prefer-template ['``` ' + language, documentation, '```'].join('\n') : documentation, kind: LSP.MarkupKind.Markdown, } } ``` For example, ``` ``` man NAME git - the stupid content tracker ``` ``` If I remove the white space, then it is properly formatted. ``` ```man instead of ``` man ``` Per CommonMark Spec https://spec.commonmark.org/0.30/#info-string whitespace is allowed before and after the `info string` which identifies the language in a codeblock. > The line with the opening code fence may optionally contain some text > following the code fence; this is trimmed of leading and trailing > spaces or tabs and called the [info > string](https://spec.commonmark.org/0.30/#info-string). If the [info > string](https://spec.commonmark.org/0.30/#info-string) comes after > a backtick fence, it may not contain any backtick characters. (The > reason for this restriction is that otherwise some inline code would > be incorrectly interpreted as the beginning of a fenced code block.) Solution: Adjust stylize_markdown() to allow whitespace before codeblock info.
* feat(api)!: change return type of nvim_win_text_height to Dict (#24365)zeertzjq2023-07-16
|
* feat(tui): support Super and Meta modifiers (#24357)zeertzjq2023-07-15
|
* feat(lsp): map K to hover by default #24331Mathias Fußenegger2023-07-14
| | | Related: https://github.com/neovim/neovim/issues/24252
* fix(runtime): respect 'fileignorecase' when sourcing (#24344)zeertzjq2023-07-14
|
* fix(runtime): respect 'rtp' order for all runtime files (#24335)zeertzjq2023-07-14
|
* perf(rtp): reduce rtp scans (#24191)Lewis Russell2023-07-13
| | | | | | | | | | | * perf(rtp): reduce rtp scans Problem: Scanning the filesystem is expensive and particularly affects startuptime. Solution: Reduce the amount of redundant directory scans by relying less on glob patterns and handle vim and lua sourcing lower down.
* fix(ui): cursor pos with left gravity inline virt_text at eol (#24329)zeertzjq2023-07-13
| | | | | | Problem: Cursor is not after inline virtual text with left gravity when inserting after the end of the line. Solution: Add width of inline virtual text with left gravity to cursor virtcol in Insert mode even if on a NUL.
* test(extmarks): add test for virt_text_win_col with cpo+=n (#24328)zeertzjq2023-07-13
|
* fix(mouse): copy the line before syntax matching (#24320)zeertzjq2023-07-12
|
* fix(drawline): fix missing Visual hl on double-width fold char (#24308)zeertzjq2023-07-11
|
* feat(api): add nvim_win_text_height (#24236)zeertzjq2023-07-11
| | | | It uses the same code as "scroll_delta" of "win_viewport" UI event to calculate text height, but is more flexible.
* vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)Gregory Anders2023-07-10
| | | | | | | | Problem: Cannot produce a status 418 or 503 message. Solution: Add err_teapot(). https://github.com/vim/vim/commit/80adaa8ae8398403ca4e9797219ea9a501fc76a5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(completion): don't add backslashes to runtime pattern (#24296)zeertzjq2023-07-08
| | | | | Problem: Bashslashes added as regexp in runtime completion may be treated as path separator with some 'isfname' value. Solution: Make curly braces work for runtime completion and use it.
* test(tui): add test for overriding argv[0] (#24293)zeertzjq2023-07-08
|
* fix(extmarks): fix wrong highlight after "combine" virt_text (#24281)Ibby2023-07-08
|
* feat(lua): allow vim.wo to be double indexed (#20288)Lewis Russell2023-07-07
| | | | | | | | * feat(lua): allow vim.wo to be double indexed Problem: `vim.wo` does not implement `setlocal` Solution: Allow `vim.wo` to be double indexed Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* fix(treesitter): update folds in all relevant windows (#24230)Jaehwang Jung2023-07-07
| | | | | | | | | Problem: When using treesitter foldexpr, * :diffput/get open diff folds, and * folds are not updated in other windows that contain the updated buffer. Solution: Update folds in all windows that contain the updated buffer and use expr foldmethod.
* fix(folds): fix missing virt_lines above when fold is hidden (#24274)zeertzjq2023-07-07
|
* fix(drawline): inline virt_text hl_mode inside syntax/extmark hl (#24273)zeertzjq2023-07-07
|
* fix(vim.system): close check handle (#24270)zeertzjq2023-07-06
| | | Fix hang after running vim.system() with sanitizers.
* fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n (#24268)zeertzjq2023-07-06
|
* fix(ui): delay win_viewport until screen update #24182fredizzimo2023-07-05
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Sometimes, when nvim sends the `win_viewport` event, for example when scrolling with visible folds on the screen, it reports the `scroll_delta` value one batch into "future". So when the client application is trying to show the new viewport it's not yet updated, resulting in temporary corruption / screen flickering. For more details see #23609, and starting from [this comment]( https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in https://github.com/neovide/neovide/pull/1790,, where the issue was first detected. Note that some of the conclusions in those are not fully accurate, but the general observations are. Solution: When there are pending updates to a Window, delay the `win_viewport` UI event until the updates are sent. This ensures that there's no flush between sending the viewport and updating of the lines corresponding to the new viewport. Document the existing viewport behaviour (for cases where there are no extra flushes), give a hint about how applications can deal with the slightly surprising behaviour of the viewport event being sent after the updates. Fixes https://github.com/neovim/neovim/issues/23609
* Merge pull request #23228 from seandewar/cmdwin-jailzeertzjq2023-07-05
|\ | | | | fix(api): use `text_locked()` to check for textlock
| * fix(api): disallow some more functions during textlockSean Dewar2023-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nvim_buf_set_text(), nvim_open_term() and termopen() all change buffer text, which is forbidden during textlock. Additionally, nvim_open_term() and termopen() may be used to convert the cmdwin buffer into a terminal buffer, which is weird. Solution: Allow nvim_buf_set_text() and nvim_open_term() in the cmdwin, but disallow nvim_open_term() from converting the cmdwin buffer into a terminal buffer. termopen() is not allowed in the cmdwin (as it always operates on curbuf), so just check text_locked(). Also happens to improve the error in #21055: nvim_buf_set_text() was callable during textlock, but happened to check textlock indirectly via u_save(); however, this caused the error to be overwritten by an unhelpful "Failed to save undo information" message when msg_list == NULL (e.g: an `<expr>` mapping invoked outside of do_cmdline()).
| * fix(api): use text_locked() to check textlockSean Dewar2023-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: some API functions that check textlock (usually those that can change curwin or curbuf) can break the cmdwin. Solution: make FUNC_API_CHECK_TEXTLOCK call text_locked() instead, which already checks for textlock, cmdwin and `<expr>` status. Add FUNC_API_TEXTLOCK_ALLOW_CMDWIN to allow such functions to be usable in the cmdwin if they can work properly there; the opt-in nature of this attribute should hopefully help mitigate future bugs. Also fix a regression in #22634 that made functions checking textlock usable in `<expr>` mappings, and rename FUNC_API_CHECK_TEXTLOCK to FUNC_API_TEXTLOCK.
* | fix(plines): don't return very large height on very long line (#24260)zeertzjq2023-07-05
| |
* | Merge #23401 vim.ui.open: "gx" without netrwJustin M. Keyes2023-07-05
|\ \ | |/ |/|
| * fix(vim.ui.open): return (don't show) error messageJustin M. Keyes2023-07-05
| | | | | | | | | | | | | | | | | | | | Problem: Showing an error via vim.notify() makes it awkward for callers such as lsp/handlers.lua to avoid showing redundant errors. Solution: Return the message instead of showing it. Let the caller decide whether and when to show the message.
| * fix(gx): visual selection, expand env varsJustin M. Keyes2023-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- Rejected experiment: move vim.ui.open() to vim.env.open() Problem: `vim.ui` is where user-interface "providers" live, which can be overridden. It would also be useful to have a "providers" namespace for platform-specific features such as "open", clipboard, python, and the other providers listed in `:help providers`. We could overload `vim.ui` to serve that purpose as the single "providers" namespace, but `vim.ui.nodejs()` for example seems awkward. Solution: `vim.env` currently has too narrow of a purpose. Overload it to also be a namespace for `vim.env.open`. diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua index 913f1fe20348..17d05ff37595 100644 --- a/runtime/lua/vim/_meta.lua +++ b/runtime/lua/vim/_meta.lua @@ -37,8 +37,28 @@ local options_info = setmetatable({}, { end, }) -vim.env = setmetatable({}, { - __index = function(_, k) +vim.env = setmetatable({ + open = setmetatable({}, { + __call = function(_, uri) + print('xxxxx'..uri) + return true + end, + __tostring = function() + local v = vim.fn.getenv('open') + if v == vim.NIL then + return nil + end + return v + end, + }) + }, + { + __index = function(t, k, ...) + if k == 'open' then + error() + -- vim.print({...}) + -- return rawget(t, k) + end local v = vim.fn.getenv(k) if v == vim.NIL then return nil
* | fix(edit): fix K_EVENT interfering with 'digraph' (#24258)zeertzjq2023-07-05
|/
* fix(api): allow negative column arguments for nvim_buf_set_text (#23501)notomo2023-07-04
|
* perf(ui-ext): approximate scroll_delta when scrolling too much (#24234)zeertzjq2023-07-04
|
* fix(ui-ext): "scroll_delta" handle topfill and skipcol (#24249)zeertzjq2023-07-04
|