03f944b0创建于 2025年12月5日历史提交
文件最后提交记录最后更新时间
fix(difftool): fully resolve symlinks when comparing paths #36147 Fixes issue on mac where it was constantly reloading buffers as paths were not being normalized and resolved correctly (in relation to buffer name). Quickfix entry: /var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue Buffer name: /private/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue /var was synlinked to /private/var and this was not being properly handled. Also added lazy redraw to avoid too many redraws when this happens in future and added test for symlink handling. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>7 个月前
fix(ui2): unset Search highlighting (#36633) Problem: Trying to match the search highlight groups to the Normal highlight for the window can fail when the message highlighting contains a fg/bg that the Normal highlight doesn't (like an error message in cmd will have ErrorMsg highlight instead of MsgArea - which is Normal in cmd.) Solution: Link the search highlight groups to an empty group in 'winhighlight' thus disabling them instead of overriding them with Normal/MsgArea/etc.6 个月前
fix(runtime): 'includeexpr' with non-Nvim-style Lua modules #33867 Closes #338621 年前
fix: update lua types for commands 5 个月前
refactor(lua): use tuple syntax everywhere #29111 1 年前
vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635) Problem: filetype: .inc file detection can be improved Solution: Update filetype detection for Pascal and BitBake code (Martin Schwan). Fix the detection of .inc files containing Pascal and BitBake code: - the concatenated string, merged from three lines, only contains one beginning and the pattern "^" would not match as expected. Use a range() loop to iterate each line string individually. This way, the pattern "^" works for beginning of lines. - improve BitBake include file detection by also matching forward-slashes "/" in variable names and assignment operators with a dot ".=" and "=.". Valid examples, which should match, are: PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" MACHINEOVERRIDES =. "qemuall:" BBPATH .= ":${LAYERDIR}" - parse twenty instead of just three lines, to accommodate for potential comments at the beginning of files closes: vim/vim#18202 https://github.com/vim/vim/commit/9fd1a657d2efae5cff278eb5acaa380623a50cf6 Co-authored-by: Martin Schwan <m.schwan@phytec.de>8 个月前
feat(func): allow manual cache invalidation for _memoize This commit also adds some tests for the existing memoization functionality. 1 年前
fix(health): bug-report formatting, version check #36809 Problem: Version check failed because of "equality" comparison, so a version string of "123abc" would not match "123abcdef". Solution: - Adjust verison check. - Improve bug-report formatting.5 个月前
refactor(lsp): fix lint 5 个月前
feat(ssh): SSH configuration parser #35027 9 个月前
fix(pack): rename confirmation buffer to again use nvim-pack:// scheme Problem: nvim:// scheme feels more like a generalized interface that may be requested externally, and it acts like CLI args (roughly). This is how vscode:// works. Anything that behaves like an "app" or a "protocol" deserves its own scheme. For such Nvim-owned things they will be called nvim-xx://. Solution: Use nvim-pack://confirm#<bufnr> template for confirmation buffer name instead of nvim://pack-confirm#<bufnr>. 6 个月前
fix(health): errors in :checkhealth with pyenv-virtualenv #35865 Problem: pyenv-virtualenv sets a different path for VIRTUAL_ENV than the path to the python binary it provides, but these paths both symlink to the same file, so there should be no disparity. The python health-check reports an error, since it only checks if these paths are equal, not where they point to (resolve to). Solution: - Resolve the python symlinks before checking if they are equal. - Deduplicate some code.8 个月前
fix(treesitter): missing nowait for :InspectTree keymaps #36804 5 个月前
feat(tui): add nvim_ui_send (#35406) This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.9 个月前
fix: type fixes Type fixes caught by emmylua 11 个月前
fix(pack): use 'coxpcall.lua' on non-LuaJIT Problem: attempt to yield across metamethod/C-call boundary error when trying to use vim.pack.add(). Solution: use pcall() variant from 'coxpcall' on non-LuaJIT version of Lua. 9 个月前
feat(defaults): dot-repeat [<Space> #31186 Problem: [<Space> and ]<Space> do not support repetition. Solution: use operatorfunc and g@l to make these mappings dot repeatable.1 年前
refactor(lua): consistent use of local aliases 9 个月前
refactor(defaults): deduplicate selection_range() mappings #36686 We don't need to specify the timeout ms here anymore, because the implementation was changed to use it by default.6 个月前
fix(input): discard following keys when discarding <Cmd>/K_LUA (#36498) Technically the current behavior does match documentation. However, the keys following <Cmd>/K_LUA aren't normally received by vim.on_key() callbacks either, so it does makes sense to discard them along with the preceding key. One may also argue that vim.on_key() callbacks should instead receive the following keys together with the <Cmd>/K_LUA, but doing that may cause some performance problems, and even in that case the keys should still be discarded together.6 个月前
fix(ui2): only redraw when necessary #36457 Problem: Until now the UI callback called nvim__redraw() liberally. It should only be needed when Nvim does not update the screen in its own event loop. Solution: Identify which UI events require immediate redrawing.6 个月前
docs: move vim.system to own section 10 个月前
fix(treesitter): show capture-level priorities in :Inspect #35443 9 个月前
feat(lua): vim.pos/vim.range 9 个月前
fix(lua): @private => @nodoc #32587 Problem: vim.log.levels.* and vim.opt_local are marked @private but they should be @nodoc. Solution: Fix the annotation.1 年前
feat(lsp): skip invalid header lines #36402 Problem: Some servers write log to stdout and there's no way to avoid it. See https://github.com/neovim/neovim/pull/35743#pullrequestreview-3379705828 Solution: We can extract content-length field byte by byte and skip invalid lines via a simple state machine (name/colon/value/invalid), with minimal performance impact. I chose byte parsing here instead of pattern. Although it's a bit more complex, it provides more stable performance and allows for more accurate error info when needed. Here is a bench result and script: parse header1 by pattern: 59.52377ms 45 parse header1 by byte: 7.531128ms 45 parse header2 by pattern: 26.06936ms 45 parse header2 by byte: 5.235724ms 45 parse header3 by pattern: 9.348495ms 45 parse header3 by byte: 3.452389ms 45 parse header4 by pattern: 9.73156ms 45 parse header4 by byte: 3.638386ms 45 Script: ```lua local strbuffer = require('string.buffer') --- @param header string local function get_content_length(header) for line in header:gmatch('(.-)\r?\n') do if line == '' then break end local key, value = line:match('^%s*(%S+)%s*:%s*(%d+)%s*$') if key and key:lower() == 'content-length' then return assert(tonumber(value)) end end error('Content-Length not found in header: ' .. header) end --- @param header string local function get_content_length_by_byte(header) local state = 'name' local i, len = 1, #header local j, name = 1, 'content-length' local buf = strbuffer.new() local digit = true while i <= len do local c = header:byte(i) if state == 'name' then if c >= 65 and c <= 90 then -- lower case c = c + 32 end if (c == 32 or c == 9) and j == 1 then -- skip OWS for compatibility only elseif c == name:byte(j) then j = j + 1 elseif c == 58 and j == 15 then state = 'colon' else state = 'invalid' end elseif state == 'colon' then if c ~= 32 and c ~= 9 then -- skip OWS normally state = 'value' i = i - 1 end elseif state == 'value' then if c == 13 and header:byte(i + 1) == 10 then -- must end with \r\n local value = buf:get() return assert(digit and tonumber(value), 'value of Content-Length is not number: ' .. value) else buf:put(string.char(c)) end if c < 48 and c ~= 32 and c ~= 9 or c > 57 then digit = false end elseif state == 'invalid' then if c == 10 then -- reset for next line state, j = 'name', 1 end end i = i + 1 end error('Content-Length not found in header: ' .. header) end --- @param fn fun(header: string): number local function bench(label, header, fn, count) local start = vim.uv.hrtime() local value --- @type number for _ = 1, count do value = fn(header) end local elapsed = (vim.uv.hrtime() - start) / 1e6 print(label .. ':', elapsed .. 'ms', value) end -- header starting with log lines local header1 = 'WARN: no common words file defined for Khmer - this language might not be correctly auto-detected\nWARN: no common words file defined for Japanese - this language might not be correctly auto-detected\nContent-Length: 45 \r\n\r\n' -- header starting with content-type local header2 = 'Content-Type: application/json-rpc; charset=utf-8\r\nContent-Length: 45 \r\n' -- regular header local header3 = ' Content-Length: 45\r\n' -- regular header ending with content-type local header4 = ' Content-Length: 45 \r\nContent-Type: application/json-rpc; charset=utf-8\r\n' local count = 10000 collectgarbage('collect') bench('parse header1 by pattern', header1, get_content_length, count) collectgarbage('collect') bench('parse header1 by byte', header1, get_content_length_by_byte, count) collectgarbage('collect') bench('parse header2 by pattern', header2, get_content_length, count) collectgarbage('collect') bench('parse header2 by byte', header2, get_content_length_by_byte, count) collectgarbage('collect') bench('parse header3 by pattern', header3, get_content_length, count) collectgarbage('collect') bench('parse header3 by byte', header3, get_content_length_by_byte, count) collectgarbage('collect') bench('parse header4 by pattern', header4, get_content_length, count) collectgarbage('collect') bench('parse header4 by byte', header4, get_content_length_by_byte, count) ``` Also, I removed an outdated test https://github.com/neovim/neovim/blob/accd392f4d14a114e378f84dc15cb24bc34a370a/test/functional/plugin/lsp_spec.lua#L1950 and tweaked the boilerplate in two other tests for reusability while keeping the final assertions the same. https://github.com/neovim/neovim/blob/accd392f4d14a114e378f84dc15cb24bc34a370a/test/functional/plugin/lsp_spec.lua#L5704 https://github.com/neovim/neovim/blob/accd392f4d14a114e378f84dc15cb24bc34a370a/test/functional/plugin/lsp_spec.lua#L57216 个月前
docs: small fixes (#36146) Close #35989 Close #36031 Close #36107 Co-authored-by: Kieran Moy <kfatyuip@gmail.com> Co-authored-by: William Sprent <william@sprent.dk> Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>7 个月前
fix(lua): don't leak timer when vim._watch.watch() fails (#35768) This fixes the following warning in tests with ASAN or TSAN: -------- Running tests from test/functional/lua/watch_spec.lua RUN T4253 vim._watch watch() ignores nonexistent paths: 29.00 ms OK nvim took 2006 milliseconds to exit after last test This indicates a likely problem with the test even if it passed!8 个月前
feat(diagnostic): config.status #36693 Problem: diagnostic.status() is configured via config.signs, but users may want diagnostics only in statusline, not in the gutter (signs). Solution: Add config.status.6 个月前
vim-patch:9.1.1936: filetype: Erlang lexical files are not recognized Problem: filetype: Erlang lexical files are not recognized Solution: Detect *.xrl files as leex filetype, include syntax and filetype plugins (Jon Parise). leex is the lexical analyzer generator for Erlang. Its input file format follows a section-based structure and uses the .xrl file extension. This initial work includes file detection, an ftplugin (which inherits the Erlang configuration), and a syntax definition. Reference: - https://www.erlang.org/doc/apps/parsetools/leex.html related: vim/vim#18819 closes: vim/vim#18832 https://github.com/vim/vim/commit/b087c5452b4c12bfc9e7f6cecbee34aab64c92d8 Co-authored-by: Jon Parise <jon@indelible.org> 6 个月前
fix(vim.fs): abspath(".") returns "/…/." #36583 6 个月前
refactor(docs): remove unnecessary @private/@nodoc annotations (#33951) * refactor(docs): remove @private annotations from local functions * refactor(docs): remove unnecessary @nodoc annotations1 年前
fix(glob): handling commas in letter pattern #34170 11 个月前
fix(health): floating window closes when opening TOC (gO) #34794 Problem: Health check floating window gets closed when pressing 'gO' to show TOC because LSP floating preview system auto-closes on BufEnter events triggered by :lopen. Solution: Temporarily disable BufEnter event for the current window during TOC operations and adjust window layout to prevent overlap.10 个月前
refactor(lua): consistent use of local aliases 9 个月前
fix: resolve all remaining LuaLS diagnostics 1 年前
fix(iter): ArrayIter:last returns nil when filtered to empty #34697 Problem: After filtering out all elements, ArrayIter:last still returns a stale element. Solution: Add check for self._head == self._tail and return nil early. Fix #3469610 个月前
docs: getpos, getregion, lsp 6 个月前
refactor(lua): consistent use of local aliases 9 个月前
feat(lsp): graduate ClientConfig exit_timeout #36750 Problem: The flags field calls its sub-fields "experimental". But exit_timeout is now used for multiple purposes. Solution: Graduate exit_timeout to a top-level ClientConfig field.6 个月前
docs: small fixes (#35791) Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>8 个月前
fix(pack): rename confirmation buffer to again use nvim-pack:// scheme Problem: nvim:// scheme feels more like a generalized interface that may be requested externally, and it acts like CLI args (roughly). This is how vscode:// works. Anything that behaves like an "app" or a "protocol" deserves its own scheme. For such Nvim-owned things they will be called nvim-xx://. Solution: Use nvim-pack://confirm#<bufnr> template for confirmation buffer name instead of nvim://pack-confirm#<bufnr>. 6 个月前
Merge #33972 feat(lsp): textDocument/inlineCompletion 9 个月前
refactor: create function for deferred loading The benefit of this is that users only pay for what they use. If e.g. only vim.lsp.buf_get_clients() is called then they don't need to load all modules under vim.lsp which could lead to significant startuptime saving. Also vim.lsp.module is a bit nicer to user compared to require("vim.lsp.module"). This isn't used for some nested modules such as filetype as it breaks tests with error messages such as "attempt to index field 'detect'". It's not entirely certain the reason for this, but it is likely it is due to filetype being precompiled which would imply deferred loading isn't needed for performance reasons. 2 年前
fix(lsp): don't overlay insertion-style inline completions (#36477) * feat(lua): Range:is_empty() to check vim.range emptiness * fix(lsp): don't overlay insertion-style inline completions **Problem:** Some servers commonly respond with an empty inline completion range which acts as a position where text should be inserted. However, the inline completion module assumes that all responses with a range are deletions + insertions that thus require an overlay display style. This causes an incorrect preview, because the virtual text should have the inline display style (to reflect that this is purely an insertion). **Solution:** Only use overlay for non-empty replacement ranges.6 个月前
build: set luals checklevel to Hint #32392 1 年前
fix(trust): :trust command on Windows #36509 :trust command calculated SHA-256 on file content reading it as a text. While it doesn't matter on Unices, on Windows hash was calculated incorectly. SHA-256 for buffer content was calculated fine though. After this fix hashes in %LOCALAPPDATA%/nvim-data/trust are the same as in output of sha256sum -t.6 个月前
docs: types, news, lua-plugin - mention "lua_ls", not "luals". https://github.com/neovim/neovim/discussions/36182 Co-authored-by: Maria Solano <majosolano99@gmail.com> 7 个月前
docs: small fixes (#35791) Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>8 个月前
feat(tui): add nvim_ui_send (#35406) This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.9 个月前
fix(lua): vim.diff is nil in uv.new_work() thread #34909 Problem: The "gitsigns" plugin runs vim.diff in a thread (uv.new_work), but vim.diff is nil in that context: Lua callback: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil) stack traceback: [C]: in function 'decode' …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29> Luv thread: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value) Solution: Revert the stdlib.c change (set vim.diff instead of vim._diff).10 个月前
docs: misc, build, lsp 6 个月前
fix(ui.open): use "start" instead of deprecated "rundll32" #36731 Problem: The rundll32 utility is a leftover from Windows 95, and it has been deprecated since at least Windows Vista. Solution: Use the start command through Command Prompt instead.6 个月前
fix: resolve all remaining LuaLS diagnostics 1 年前
refactor(lua): use vim.system #34707 10 个月前