Commit Graph

3653 Commits

Author SHA1 Message Date
zeertzjq
75f4741db9 fix(input): remove reinterpreted ALT/META chords from recorded macro 2022-01-29 06:05:14 +08:00
bfredl
ca3e382a4f
Merge pull request #17183 from notomo/expose-extmark-right-gravity
feat(api): expose extmark right_gravity and end_right_gravity
2022-01-28 12:38:56 +01:00
zeertzjq
69f37197c0
fix(completion): update submode message when selecting from API (#17022) 2022-01-28 07:55:10 +08:00
bfredl
a47fdf8421
Merge pull request #17175 from zeertzjq/vim-8.2.3095
vim-patch:8.2.3095: with 'virtualedit' set to "block" block selection is wrong
2022-01-27 13:44:30 +01:00
zeertzjq
f2d84df4a8 vim-patch:8.2.3095: with 'virtualedit' set to "block" block selection is wrong
Problem:    With 'virtualedit' set to "block" block selection is wrong after
            using "$".  (Marco Trosi)
Solution:   Compute the longest selected line. (closes vim/vim#8495)
b17ab86e7b
2022-01-27 18:55:21 +08:00
Lewis Russell
f9080b24c4
fix(ts): escape lang when loading parsers (#16668)
When trying to load a language parser, escape the value of
the language.

With language injection, the language might be picked up from the
buffer. If this value is erroneous it can cause `nvim_get_runtime_file`
to hard error.

E.g., the markdown expression `~~~{` will extract '{' as a language and
then try to get the parser using `parser/{*` as the pattern.
2022-01-27 10:42:59 +01:00
bfredl
3d0149f984
Merge pull request #17191 from zeertzjq/vim-8.2.4203
vim-patch:8.2.4203: entering a character with CTRL-V may include modifiers
2022-01-27 09:00:01 +01:00
bfredl
55ad48d939
Merge pull request #17155 from zeertzjq/vim-8.2.3121
vim-patch:8.2.{3121,3410}: two 'listchars' fixes
2022-01-27 08:32:52 +01:00
bfredl
f1b91fcdbd
Merge pull request #17102 from zeertzjq/vim-8.2.1762
vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
2022-01-27 08:31:17 +01:00
zeertzjq
95873aa3eb test: add more tests for Insert mode Ctrl-V 2022-01-25 08:29:04 +08:00
bfredl
1b6ae2dbb0
Merge pull request #15910 from glacambre/silent_stdioopen
feat(--headless): do not print anything when stdioopen() has been used
2022-01-24 22:33:55 +01:00
glacambre
a4069a3eed feat(--headless): add on_print callback to stdioopen
This commit adds an on_print callback to stdioopen's dictionary
argument which lets the caller specify a function called each time
neovim will try to output something to stdout (e.g. on "echo" or
"echoerr" in --headless mode).
2022-01-24 13:59:16 +01:00
notomo
3d9ae9d2da feat(api): expose extmark right_gravity and end_right_gravity 2022-01-24 09:52:13 +09:00
bfredl
7e2ce35e3b
Merge pull request #17156 from zeertzjq/vim-8.2.3584
vim-patch:8.2.{3584,3586,3587}: :command "-keepscript" argument
2022-01-23 19:42:30 +01:00
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
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
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
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
ff7c3d1275 fix(input): never escape CSI bytes 2022-01-21 18:08:56 +08:00
notomo
5971b86338 feat(api): expose extmark more details 2022-01-20 13:25:46 +09: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
Michael Lingelbach
b455e0179b
feat: use nvim_buf_set_extmark for vim.highlight (#16963)
Closes https://github.com/neovim/neovim/issues/13647

This allows customizing the priority of the highlights.

* Add default priority of 50
* Use priority of 200 for highlight on yank
* use priority of 40 for highlight references (LSP)
2022-01-15 14:19:20 -08:00
bfredl
f3193c7b54
Merge pull request #17001 from mjlbach/feat/non-strict-extmarks
feat(extmarks): add strict option
2022-01-15 21:06:04 +01:00
Michael Lingelbach
d8eec8e344 Hopefully last attempt 2022-01-15 09:00:01 -08:00
Michael Lingelbach
facd07bcf7 Address review r3 2022-01-15 08:37:44 -08:00
zeertzjq
8e945c2524 vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
Problem:    When a timer uses :stopinsert Insert mode completion isn't
            stopped. (Stanley Chan)
Solution:   Call ins_compl_prep(ESC).
d0e1b7103c
2022-01-15 22:33:16 +08:00
Gregory Anders
59ea8fa322
fix(filetype): expand tildes in filetype patterns (#17091)
This allows patterns like

  ["~/.config/foo"] = "fooscript"

to work.
2022-01-14 14:20:17 -07:00
bfredl
bac4bb1900
Merge pull request #16998 from zeertzjq/lua-vim-var-funcref
feat(api, lua): more conversions between LuaRef and Vim Funcref
2022-01-14 18:00:20 +01:00
bfredl
4570df0b43
Merge pull request #17034 from zeertzjq/compl-lua-select
feat(completion): support selecting item via API from Lua mapping
2022-01-13 12:26:34 +01:00
Michael Lingelbach
bc722c8a74
fix(lsp): strictly enforce passing offset encoding (#17049)
This removes the "fallback" to utf-16 in many of our helper functions. We
should always explicitly pass these around when possible except in two
locations:

* generating params with help utilities called by buf.lua functions
* the buf.lua functions themselves

Anything that is called by the handler should be passed the offset encoding.
2022-01-13 02:34:04 -08:00
Mathias Fußenegger
e7cd811567
fix(lsp): handle negative activeSignature in signatureHelp (#17064)
omnisharp-roslyn can send negative values:

    {
      activeParameter = 0,
      activeSignature = -1,
      signatures = { {
          documentation = "",
          label = "TestEntity.TestEntity()",
          parameters = {}
        } }
    }

In 3.16 of the specification `activeSignature` is defined as `uinteger`
and therefore negative values shouldn't be allowed, but within 3.15 it
was defined as `number` which makes me think we can be a bit lenient in
this case and handle them.

The expected behavior is quite clear:

    The active signature. If omitted or the value lies outside the
    range of `signatures` the value defaults to zero or is ignored if
    the `SignatureHelp` has no signatures.

Fixes an error:

    util.lua:1685: attempt to get length of local 'lines' (a nil value)
    util.lua:1685: in function 'trim_empty_lines'
    handlers.lua:334: in function 'textDocument/signatureHelp'
2022-01-13 01:47:36 -08:00
hrsh7th
43ef7df22d
fix(lsp): fix applying multiple out-of-range TextEdits (#17037) 2022-01-13 10:28:13 +01:00
Thomas Vigouroux
f9b3b2dcfc
Merge pull request #16945 from theHamsta/cached-queries
perf(treesitter): cache query parsing
2022-01-13 08:50:01 +00:00
zeertzjq
c8656e44d8 feat(api, lua): more conversions between LuaRef and Vim Funcref 2022-01-13 15:07:40 +08:00
Daniel Steinberg
3ee1ba35a7
fix(keywordprg): retain terminal buffer after K (#17046) 2022-01-12 22:04:30 -07:00
Mathias Fußenegger
074b033e7e
refactor(lsp): debounce timer per buf and unify with non-debounce (#17016)
Part of the `pending_change` closure in the `changetracking.prepare` was
a bit confusing because it has access to `bufnr` and `uri` but it could
actually contain pending changes batched for multiple buffers.

(We accounted for that by grouping `pending_changes` by a `uri`, but
it's not obvious what's going on)

This commit changes the approach to do everything per buffer to avoid
any ambiguity.

It also brings the debounce/no-debounce a bit closer together: The
only difference is now whether a timer is used or if it is triggered
immediately
2022-01-11 18:10:29 +01:00
zeertzjq
c7aa64631d feat(completion): support selecting item via API from Lua mapping 2022-01-11 13:59:39 +08:00
zeertzjq
42e5fd32b0 fix(completion): prevent K_LUA from closing pum 2022-01-10 21:30:32 +08:00
Gregory Anders
6ecaba510f
test: use old style test for testing filetype.lua (#17003)
This is a much better solution than #16942 as it doesn't require copying
every new change from test_filetype.vim into filetype_spec.lua (which is
much more maintainable).
2022-01-09 09:11:09 -07:00
James McCoy
c7ffe406bc
Merge pull request #16983 from dundargoc/test/add-vimruntime-variable
test: add VIMRUNTIME variable to the clear function
2022-01-08 19:31:37 -05:00
zeertzjq
e70ea6ea20
test: remove redundant feed_command('terminal') (#16993)
It just types :terminal<CR> into the terminal, which is redundant.
2022-01-08 08:29:32 -07:00
Dundar Göc
14ec38bcf9 test: add VIMRUNTIME variable to the clear function
Some of the tests will fail if this isn't explicitly set.
2022-01-08 14:40:29 +01:00
brian m. carlson
600e7e3b32
fix: make mode() return correct value in ex mode
When the user is in ex mode, a call to mode(1) is documented to return
"cv".  However, it does not currently do so, because the check which
checks for ex mode is nested inside a conditional which is never reached
in ex mode.  Vim uses an explicit check for exmode_active, so let's do
the same thing here.  Add some tests for this case both with a TTY and
in silent mode.
2022-01-08 03:11:50 +00:00
Christian Clason
bba679c431
vim-patch:8.2.4014: git and gitcommit file types not properly recognized (#16953)
Problem:    Git and gitcommit file types not properly recognized.
Solution:   Adjust filetype detection. (Tim Pope, closes vim/vim#9477)
c689f8c3d9
2022-01-07 10:27:34 +01:00
Shadman
287d3566de
fix(lua): print multiple return values with =expr (#16933) 2022-01-06 11:42:31 -07:00
Gregory Anders
d78e46679d
feat(lua): add notify_once() (#16956)
Like vim.notify(), but only displays the notification once.
2022-01-06 11:10:56 -07:00
Björn Linse
2f779e3361
Merge pull request #16591 from shadmansaleh/feat/lua_keymaps2
feat(lua): add support for lua keymaps
2022-01-06 18:35:31 +01:00