Commit Graph

24168 Commits

Author SHA1 Message Date
zeertzjq
f04087d8ba
vim-patch:8.2.2912: MS-Windows: most users expect using Unicode (#21482)
Problem:    MS-Windows: most users expect using Unicode.
Solution:   Default 'encoding' to utf-8 on MS-Windows. (Ken Takata,
            closes vim/vim#3907)

f883d9027c

Correct the encoding of the file.

Co-authored-by: K.Takata <kentkt@csc.jp>
2022-12-20 17:15:37 +08:00
zeertzjq
de90a8bfe5
test(old): make test_signs.vim closer to upstream (#21479) 2022-12-20 11:03:38 +08:00
Munif Tanjim
03166838ab
test(exrc): add tests for .nvimrc and .nvim.lua (#21478) 2022-12-20 08:38:24 +08:00
zeertzjq
b3c9563e6b
Merge pull request #21477 from zeertzjq/vim-9.0.1078
vim-patch:9.0.{1078,1079}
2022-12-20 07:48:52 +08:00
zeertzjq
ff62d76193 vim-patch:9.0.1079: leaking memory when defining a user command fails
Problem:    Leaking memory when defining a user command fails.
Solution:   Free "compl_arg" when needed. (closes vim/vim#11726)

33e543038b
2022-12-20 05:26:52 +08:00
zeertzjq
b201cbfc61 vim-patch:9.0.1078: with the +vartabs feature indent folding may use wrong 'ts'
Problem:    With the +vartabs feature indent folding may use wrong 'tabstop'.
Solution:   Use the "buf" argument instead of "curbuf".

07146ad1d3
2022-12-20 05:26:49 +08:00
Munif Tanjim
23d8f5b870
feat(exrc): support .nvim.lua (#21436) 2022-12-19 09:33:47 -07:00
tiagovla
f4d8e992bf
fix(lsp): token_edit.data might be null on deletion (#21462) 2022-12-19 09:24:27 +01:00
Tom Churchman
a7332ba9b4
fix(tui): set cursor color param as string when required #21407
Problem:
See #20628. Terminals supporting cursor color changing usually set the
"user-defined" `Cs` terminfo capability. Most terminals expect the parameter to
the capability to be a string (in hex format like `#0099ff` or like
`rgb:00/99/ff`), others may expect a number.

Nvim currently can't handle string parameters, causing terminals to receive
a bogus command.

Unfortunately, as the `Cs` capability is "user-defined", there's no strict
format. The parameter it takes isn't really standardized. It seems most
terminals in use follow xterm; iTerm appears to be an exception.

Solution:
Use the `Cs` capability more reliable by following terminfo and
sending the color in hex format, at the cost of using unibilium string vars.
Alternatively, could revert 34d41baf8a
and hardcode the specific format required by terminals, instead of reading
terminfo.

Fixes #20628
Fixes #19607
2022-12-18 15:10:47 -08:00
tae-soo-kim
bf9ad5db96
fix(diagnostic): sort diagnostics by column (#21457)
Sort diagnostics by column number in quickfix list
2022-12-18 08:17:15 -07:00
zeertzjq
6b3ae24a70
vim-patch:9.0.1072: screenpos() column result in fold may be too small (#21465)
Problem:    screenpos() column result in fold may be too small.
Solution:   Add space of 'number', sign column, etc. (closes vim/vim#11715)

ba2d191932
2022-12-18 21:26:17 +08:00
Mathias Fußenegger
1743359235
fix(diagnostic): clear stale cache on reset (#21454)
The BufWipeout autocmd is not 100% reliable and may leave stale entries
in the cache. This is sort of a hack/workaround to ensure
`vim.diagnostic.reset` calls don't fail if there are stale cache entries
but instead clears them

Fixes errors like

    Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: Invalid buffer id: 22
    stack traceback:
            [C]: in function 'nvim_exec_autocmds'
            /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: in function 'reset'
2022-12-17 19:19:15 -07:00
Christian Clason
1c4794944d
Merge pull request #21393 from folke/highlight_show
feat(lsp): add function to get semantic tokens at cursor
feat: `vim.inspect_pos()`, `vim.show_pos()` and `:Inspect[!]`
2022-12-17 13:43:46 +01:00
dundargoc
d65684f0c7
ci: bump stylua action to v2 (#21455) 2022-12-17 13:32:20 +01:00
Folke Lemaitre
ef91146efc
feat: vim.inspect_pos, vim.show_pos, :Inspect 2022-12-17 13:05:31 +01:00
zeertzjq
2d8bbe468e
Merge pull request #21450 from zeertzjq/vim-8.2.1210
vim-patch:8.2.{1208,1209,1210}: using ht_used when looping through a hashtab is less reliable
2022-12-17 09:28:44 +08:00
zeertzjq
b969844398 vim-patch:8.2.1210: using ht_used when looping through a hashtab is less reliable
Problem:    Using ht_used when looping through a hashtab is less reliable.
Solution:   Use ht_changed in a few more places.

1f22cc5cdb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
zeertzjq
73a6000120 vim-patch:8.2.1209: Vim9: test failure
Problem:    Vim9: test failure.
Solution:   Add missing changes to hashtab.

21c16f868d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
zeertzjq
d302c0e35e vim-patch:8.2.1208: build failure
Problem:    Build failure.
Solution:   Add missing change.

49fe0d6b28

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
zeertzjq
4d860a5370
fix(folds): use long for number of folded lines (#21447)
Also remove some duplicate unsigned long casts.
2022-12-17 08:11:35 +08:00
Justin M. Keyes
37915cc5ab
Merge #21444 rename mch_msg => os_msg 2022-12-16 12:27:49 -05:00
Justin M. Keyes
a5207304dd refactor: rename mch_get_acl => os_get_acl 2022-12-16 17:40:06 +01:00
Justin M. Keyes
614d382621 refactor: rename mch_msg => os_msg 2022-12-16 17:33:52 +01:00
bfredl
b55ccb4324
Merge pull request #21440 from bfredl/scriptparm
refactor(params): open -s and -w script files after parsing commands
2022-12-16 12:53:41 +01:00
Lewis Russell
4ca3519a7a
refactor(option.c): reduce scope of locals (#21433)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-12-16 11:24:44 +00:00
bfredl
b6dda012ea refactor(params): open -s and -w script files after parsing commands
This will be needed for #18375 as only the server should open the.
scriptfile, and redirected stdin fd will need to be used.

Also executing actions in the middle of command_line_scan() is cringe.
2022-12-16 11:43:41 +01:00
zeertzjq
72a19b2ffe
fix(api): "emsg_silent" should imply "silent" in nvim_cmd (#21438) 2022-12-16 08:54:13 +08:00
zeertzjq
a2bf0cef10
vim-patch:9.0.1062: some test function names do not match what they are doing (#21429)
Problem:    Some test function names do not match what they are doing.
Solution:   Leave out user data for the test that is called "NoUserData".
            (closes vim/vim#11703)

4cd45f1408

Nvim's tests already match function names. Add missing indent changes
and a missing comment from patch 8.2.0084.
2022-12-16 06:08:59 +08:00
dundargoc
ef95174694
ci: add team reviewers (#21434)
Using team reviewers when possible reduces the churn on the git history
as we'll be able to add or remove reviewers without needing to change
the workflow files.

This requires using Github fine-grained personal access tokens with Pull
Requests set to "Read and write" and Members to "Read-only".
2022-12-15 20:40:30 +01:00
Lewis Russell
3091fa778a
Merge pull request #21426 from williamboman/fix/tbl_get-nil-return-val
fix(lua): always return nil values in vim.tbl_get when no results
2022-12-15 08:03:31 +00:00
William Boman
26c918d03f fix(lua): always return nil values in vim.tbl_get when no results
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:

```lua
local function nothing() return     end
local function null()    return nil end

select('#', nothing()) -- 0
select('#', null())    -- 1
```

`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
2022-12-15 02:43:43 +01:00
Lewis Russell
0887ad1cbb
fix(ts): check buffer is loaded when restoring options (#21419)
fix(treesitter): check buffer is loaded when restoring options

Also restore spelloptions

Fixes #21416
2022-12-14 22:54:58 +00:00
Christian Clason
4a78ed60a3
vim-patch:9.0.1057: conflict between supercollider and scala filetype detection (#21417)
Problem:    Conflict between supercollider and scala filetype detection.
Solution:   Do not check for "Class : Method", it can appear in both
            filetypes. (Chris Kipp, closes vim/vim#11699)

70ef3f546b

Co-authored-by: Chris Kipp <ckipp@pm.me>
2022-12-14 19:46:17 +01:00
zeertzjq
6631df9107
fix(terminal): fix 'mousescroll' not respected in terminal mode (#21415) 2022-12-14 23:45:31 +08:00
Lewis Russell
d127c684fa
fix(treesitter): properly restore 'syntax' (#21358) 2022-12-14 15:00:48 +00:00
Christian Clason
04da043244
feat(lsp): add function to get semantic tokens at cursor 2022-12-13 18:59:27 +01:00
zeertzjq
090048bec9
vim-patch:9.0.1051: after a failed CTRL-W ] next command splits window (#21400)
Problem:    After a failed CTRL-W ] next command splits window.
Solution:   Reset postponed_split. (Rob Pilling, closes vim/vim#11698)

cb94c91070

Co-authored-by: Rob Pilling <robpilling@gmail.com>
2022-12-13 22:43:54 +08:00
zeertzjq
a6b05cb75d
vim-patch:9.0.0530: using freed memory when autocmd changes mark (#21396)
Problem:    Using freed memory when autocmd changes mark.
Solution:   Copy the mark before editing another buffer.

8ecfa2c56b

Nvim already copies the mark.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-13 10:47:39 +08:00
zeertzjq
0b20762c60
docs: remove "How-to disable mouse" menu item #21394 2022-12-12 17:43:49 -08:00
bfredl
a442c9f556
Merge pull request #21375 from nojnhuh/highlight-test
fix(tests): initialize Screen.colors in API highlight tests
2022-12-12 22:11:39 +01:00
Christian Clason
54d6a32fbd
feat(lsp): highlight semantic token modifiers (#21390)
Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
2022-12-12 20:43:14 +01:00
jdrouhard
3869a2e0cf
perf(lsp): update semantic tokens algorithm for parsing modifiers (#21383)
Instead of testing for every possible modifier type, only test bits up
to the highest set in the token array. Saves many bit ops and
comparisons when there are no modifiers or when the highest set bit is a
lower bit than the highest possible in the legend on average.

Can be further simplified when non-luaJIT gets the full bit module (see #21222)
2022-12-12 18:42:37 +01:00
Lewis Russell
d40d34aaa5
fix(diff): handle long lines without crashing (#21389)
Fixes https://github.com/neovim/neovim/issues/21388
2022-12-12 16:44:11 +00:00
ii14
49c240d3a2
docs: add links to extmarks and namespaces (#21378)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-12-12 15:15:31 +00:00
Phelipe Teles
8b9bf3e3b9
fix: vim.opt_local:append ignoring global option value (#21382)
Closes https://github.com/neovim/neovim/issues/18225
2022-12-12 15:14:50 +00:00
Christian Clason
3217a31f9b
vim-patch:7db29e4b5c3a (#21380)
* vim-patch:7db29e4b5c3a

Update runtime files

7db29e4b5c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-12 06:13:23 +01:00
Justin M. Keyes
1c324cb192
docs #20986
- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
  errors in pi_netrw.txt, so we can remove that workaround from
  ignore_parse_error().
- improved codeblock
2022-12-11 18:41:26 -08:00
dundargoc
b12bb97fee
docs: fix typos (#21328) 2022-12-12 08:53:07 +08:00
zeertzjq
407eef4738
vim-patch:9.0.1047: matchparen is slow (#21379)
Problem:    Matchparen is slow.
Solution:   Actually use the position where the match started, not the
            position where the search started. (closes vim/vim#11644)

79336e19cb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-11 23:02:41 +08:00
zeertzjq
3dadd3aca5
vim-patch:8.2.2870: CmdlineChange event triggered twice for CTRL-R (#21361)
Problem:    CmdlineChange event triggered twice for CTRL-R.
Solution:   Return CMDLINE_NOT_CHANGED from cmdline_insert_reg().
            (closes vim/vim#8219)

796139ae3a

Cherry-pick Test_cmdline_map_cmdlineChanged() from patch 8.2.2851.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-11 08:48:00 +08:00