Commit Graph

20260 Commits

Author SHA1 Message Date
zeertzjq
0efe1ec6b3 test(input): add more tests for K_SPECIAL escaping in ins_char_typebuf() 2022-01-23 05:58:32 +08:00
zeertzjq
818456470c fix(input): put modifiers back into typeahead buffer when needed 2022-01-23 05:58:32 +08:00
Thomas Vigouroux
7717f38d3f
Merge pull request #17169 from clason/bump-treesitter
build(deps): bump tree-sitter to v0.20.3
2022-01-22 18:39:14 +01:00
Christian Clason
db9cfb18e1 build(deps): bump tree-sitter to v0.20.3
this version contains massive performance improvements as well as a new
`--abi` flag that allows generating backward compatible parsers
2022-01-22 09:02:06 +01:00
Shougo Matsushita
d7ab4e819a vim-patch:8.2.4160: cannot change the register used for Select mode delete
Problem:    Cannot change the register used for Select mode delete.
Solution:   Make CTRL-R set the register to be used when deleting text for
            Select mode. (Shougo Matsushita, closes vim/vim#9531)
4ede01f188
2022-01-22 11:57:06 +09:00
bfredl
e07a4b97f6
Merge pull request #16936 from zeertzjq/no-escape-csi
input: never escape CSI bytes and clean up related names and comments
2022-01-21 18:04:40 +01:00
bfredl
be22cc1264
Merge pull request #17076 from notomo/expose-extmark-more-details
feat(api): expose extmark more details
2022-01-21 18:02:47 +01:00
Christian Clason
9d02fc4c00
vim-patch:8.2.4172: filetype detection for BASIC is not optimal (#17161)
Problem:    Filetype detection for BASIC is not optimal.
Solution:   Improve BASIC filetype detection. (Doug Kearns)
6517f14165
2022-01-21 16:45:32 +01:00
zeertzjq
f2dbeca863 vim-patch:8.2.3587: compiler test fails with backslash file separator
Problem:    Compiler test fails with backslash file separator.
Solution:   Accept slash and backslash.
0a15c7676b
2022-01-21 18:18:18 +08:00
zeertzjq
792381e1a0 vim-patch:8.2.3586: command completion test fails
Problem:    Command completion test fails.
Solution:   Add new argument to expected output
326e7da609
2022-01-21 18:18:18 +08:00
zeertzjq
8e84d1b930 vim-patch:8.2.3584: "verbose set efm" reports location of the :compiler command
Problem:    "verbose set efm" reports the location of the :compiler command.
            (Gary Johnson)
Solution:   Add the "-keepscript" argument to :command and use it when
            defining CompilerSet.
58ef8a31d7
2022-01-21 18:18:18 +08:00
zeertzjq
cb39c825c4 vim-patch:8.2.3410: crash with linebreak, listchars and large tabstop
Problem:    Crash with linebreak, listchars and large tabstop.
Solution:   Account for different size listchars for a tab. (closes vim/vim#8841)
89a54b413a
2022-01-21 18:16:16 +08:00
zeertzjq
296b8fbe3b vim-patch:8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Problem:    'listchars' "exceeds" character appears in foldcolumn. Window
            separator is missing. (Leonid V.  Fedorenchik)
Solution:   Only draw the "exceeds" character in the text area.  Break the
            loop when not drawing the text. (closes vim/vim#8524)
41fb723ee9
2022-01-21 18:16:16 +08:00
zeertzjq
6e69a3c3e7 refactor: remove CSI unescaping and clean up related names and comments 2022-01-21 18:08:56 +08:00
zeertzjq
8300d337c8 refactor: remove the <xCSI> key
CSI typed directly is now just <CSI>. The <xCSI> key is obsolete.
2022-01-21 18:08:56 +08:00
zeertzjq
ff7c3d1275 fix(input): never escape CSI bytes 2022-01-21 18:08:56 +08:00
xnmet
c977d8b43c
docs(lsp): fix on_publish_diagnostics example (#17146) 2022-01-21 08:40:48 +01:00
Michael Lingelbach
8e702c14ac
feat(lsp): add handler for workspace/workspaceFolders (#17149) 2022-01-21 07:51:34 +01:00
zeertzjq
2fa1b4cbff vim-patch:8.2.4166: undo synced when switching buffer in another window
Problem:    Undo synced when switching buffer in another window.
Solution:   Do not sync undo when not needed. (closes vim/vim#9575)
e615db0604
2022-01-21 05:14:40 +08:00
zeertzjq
aa4eadd2be vim-patch:8.2.0128: cannot list options one per line
Problem:    Cannot list options one per line.
Solution:   Use ":set!" to list one option per line.
6b915c0c0e
2022-01-20 14:34:24 +08:00
notomo
5971b86338 feat(api): expose extmark more details 2022-01-20 13:25:46 +09:00
James McCoy
d224957d30
fix(coverity/188749): nullify pointer to fix use-after-free 2022-01-19 22:47:09 -05:00
James McCoy
e850a92986
fix(coverity/340720): error if nvim_eval_statusline given invalid winid 2022-01-19 21:54:06 -05:00
James McCoy
8f241e535f
refactor(coverity/345583): assert fp is non-NULL
Since we already have a typval, we know the lookup will succeed.
2022-01-19 21:43:09 -05:00
James McCoy
0c541ab1f6
refactor(coverity/345582): assert fp is non-NULL
Since we already have a typval, we know the lookup will succeed.
2022-01-19 21:42:23 -05:00
zeertzjq
431915fe6a
test(put_spec): correctly order parameters to eq() (#17134)
The first parameter to eq() should be the expected value, and the second
parameter should be the actual value.
2022-01-19 13:53:39 -07:00
Thomas Vigouroux
96aa7dd097
Merge pull request #17130 from clason/bump-treesitter
build(deps): bump tree-sitter
2022-01-19 09:24:20 +01:00
Gregory Anders
de6f9233ee
refactor: source ftplugin.vim separately from filetype.vim (#17129)
This is a follow-on to #17040. The real benefit of #17040 was ensuring
that the ftplugin FileType autocommand was defined first and thus always
fired first. A side effect of the implementation in #17040 was that
setting variables that modified the state of filetype detection (such as
g:did_load_filetypes or g:do_filetype_lua) could no longer be set in the
user's init file. Filetype detection can also no longer be prevented
from loading by using `:filetype off`.

This PR addresses both of those side effects by unconditionally sourcing
ftplugin.vim and indent.vim before the user's init file (which ensures
that these autocommands run first) and sourcing filetype.vim *after* the
user's init file (thus allowing it to be blocked or modified).
2022-01-18 12:46:41 -07:00
Sean Dewar
1ae73e2d1c
vim-patch:8.2.0175: crash when removing list element in map()
Problem:    Crash when removing list element in map().
Solution:   Lock the list. (closes vim/vim#2652)
db661fb95d
2022-01-18 12:49:30 +00:00
f380cedric
5e81687d9a vim-patch:8.2.3402: invalid memory access when using :retab with large value
Problem:    Invalid memory access when using :retab with large value.
Solution:   Check the number is positive.
b7081e135a
2022-01-18 10:04:32 +01:00
Christian Clason
45f7fc9b06 build(deps): bump tree-sitter
update tree-sitter to
2346570901
which includes a massive performance improvement to query construction
(bumping ABI compatibility to 14; parsers need to be generated with a
flag to take advantage of this)
2022-01-18 09:07:12 +01:00
zeertzjq
dda1c8edda vim-patch:8.2.3613: :find test fails
Problem:    :find test fails.
Solution:   Put length check inside if block.
e015d99abb
2022-01-18 10:05:31 +08:00
zeertzjq
ec39e1e421 vim-patch:8.2.3611: crash when using CTRL-W f without finding a file name
Problem:    Crash when using CTRL-W f without finding a file name.
Solution:   Bail out when the file name length is zero.
615ddd5342
2022-01-18 10:05:31 +08:00
zeertzjq
0a65d821fc vim-patch:8.2.3494: illegal memory access in utf_head_off
Problem:    Illegal memory access in utf_head_off.
Solution:   Check cursor position when reselecting the Visual area.
            (closes vim/vim#8963)
b07626d4af

Including the XTest_beval -> XTest_block from patch 8.2.3096.
2022-01-18 10:05:31 +08:00
zeertzjq
176df92bd7 vim-patch:8.2.3580: gj does not move properly with a wide character
Problem:    gj does not move properly with a wide character.
Solution:   Move one to the right. (Christian Brabandt, closes vim/vim#8702)
aaec1d4fb1
2022-01-18 07:46:46 +08:00
Gregory Anders
fcf5dd34fd
refactor: enable filetype detection before user startup scripts (#17040) 2022-01-17 14:11:59 -07:00
zeertzjq
ad2dbd4b5f
fix(man.vim): support calling :Man without a section again (#17119)
When `man -w` is called with an empty string as section name, it may
fail with an error code, which causes :Man to no longer work without a
section. Just remove that argument when no section is specified.
2022-01-17 11:45:46 -07:00
James McCoy
70db972e5f
Merge pull request #16813 from neovim/marvim/api-doc-update/master
docs: regenerate
2022-01-17 13:37:28 -05:00
James McCoy
64b906a3fa
Merge pull request #17125 from jamessan/auto-prs-as-draft
ci: create automated PRs as draft PRs
2022-01-17 13:37:19 -05:00
James McCoy
66076e5e1b
ci: create automated PRs as draft PRs
GH workflows aren't allowed to trigger other GH workflows.  Since
commitlint is a required check now, we need something manual to happen
for it to run on vim-patch/api-doc PRs.

Creating these PRs as drafts and then marking them as "ready to review"
when we want to merge them will provide the manual trigger to run
commitlint.

[skip ci]
2022-01-17 13:36:01 -05:00
marvim
2c94b75eac docs: regenerate [skip ci] 2022-01-17 18:28:23 +00:00
James McCoy
8f54b88a5e
Merge pull request #17122 from dundargoc/ci/remove-non-working-job
ci: remove non-working add-reviewer job
2022-01-17 13:11:46 -05:00
James McCoy
50eabe1c47
Merge pull request #17106 from jamessan/always-run-commitlint
Always run commitlint check
2022-01-17 13:08:27 -05:00
Dundar Göc
6c1d6f3dd6 ci: remove non-working add-reviewer job 2022-01-17 18:48:08 +01:00
James McCoy
69b2dd175c
ci(api-docs): avoid running ci for doc commits 2022-01-17 12:21:16 -05:00
James McCoy
d7e2229b41
ci(commitlint): use pull_request_target to avoid "skip ci" 2022-01-17 12:21:09 -05:00
Michael Lingelbach
9055ec5792
perf(lsp): request only changed portions of the buffer in changetracking (#17118)
This commits introduces two performance improvements in incremental sync:

* avoiding expensive lua string reallocations on each on_lines call by requesting
only the changed chunk of the buffer as reported by firstline and new_lastline
parameters of on_lines
* re-using already allocated tables for storing the resulting lines to reduce the load on
the garbage collector

The majority of the performance improvement is from requesting only changed chunks
of the buffer.

Benchmark:

The following code measures the time required to perform a buffer edit to
that operates individually on each line, common to plugins such as vim-commentary.

    set rtp+=~/.config/nvim/plugged/nvim-lspconfig
    set rtp+=~/.config/nvim/plugged/vim-commentary
    lua require('lspconfig')['ccls'].setup({})
    function! Benchmark(tries) abort
        let results_comment = []
        let results_undo = []
        for i in range(a:tries)
            echo printf('run %d', i+1)
            let begin = reltime()
            normal gggcG
            call add(results_comment, reltimefloat(reltime(begin)))
            let begin = reltime()
            silent! undo
            call add(results_undo, reltimefloat(reltime(begin)))
            redraw
        endfor
        let avg_comment = 0.0
        let avg_undo = 0.0
        for i in range(a:tries)
            echomsg printf('run %3d: comment=%fs undo=%fs', i+1, results_comment[i], results_undo[i])
            let avg_comment += results_comment[i]
            let avg_undo += results_undo[i]
        endfor
        echomsg printf('average: comment=%fs undo=%fs', avg_comment / a:tries, avg_undo / a:tries)
    endfunction
    command! -bar Benchmark call Benchmark(10)

All text changes will be recorded within a single undo operation. Both the
comment operation itself and the undo operation will generate an on_lines event
for each changed line. Formatter plugins using setline() have also been found
to exhibit the same problem (neoformat, :RustFmt in rust.vim), as this function
too generates an on_lines event for every line it changes.

Using the neovim codebase as an example (commit 2ecf0a4)
with neovim itself built at 2ecf0a4 with
CMAKE_BUILD_TYPE=Release shows the following performance improvement:

src/nvim/lua/executor.c, 1432 lines:
  - baseline, no optimizations:             comment=0.540587s undo=0.440249s
  - without double-buffering optimization:  comment=0.183314s undo=0.060663s
  - all optimizations in this commit:       comment=0.174850s undo=0.052789s

src/nvim/search.c, 5467 lines:
  - baseline, no optimizations:             comment=7.420446s undo=7.656624s
  - without double-buffering optimization:  comment=0.889048s undo=0.486026s
  - all optimizations in this commit:       comment=0.662899s undo=0.243628s

src/nvim/eval.c, 11355 lines:
  - baseline, no optimizations:             comment=41.775695s undo=44.583374s
  - without double-buffering optimization:  comment=3.643933s undo=2.817158s
  - all optimizations in this commit:       comment=1.510886s undo=0.707928s

Co-authored-by: Dmytro Meleshko <dmytro.meleshko@gmail.com>
2022-01-17 08:19:33 -08:00
Christian Clason
3906b2d4fc
vim-patch:fd31be29b822 (#17114)
Update runtime files
fd31be29b8
2022-01-17 11:58:36 +01:00
bfredl
0c0469c4f5
Merge pull request #15242 from dundargoc/docs/vim-patch/move-outsite-of-getting-started
docs: deprioritize vim-patch as a good beginner task
2022-01-16 23:39:38 +01:00
Dundar Göc
4388793799 docs: deprioritize vim-patch as a good beginner task
Also add a disclaimer where familiarity with vim is strongly suggested.
2022-01-16 22:10:22 +01:00