Commit Graph

4572 Commits

Author SHA1 Message Date
zeertzjq
1de62b9ea1
fix(charclass): make behavior with empty str match latest Vim (#19749)
Later Vim patches changed to return 0 for empty string and null string.
Also update setcellwidth() docs to match latest Vim.
2022-08-13 12:25:01 +08:00
zeertzjq
754892e59d
vim-patch:8.2.{1536,1540}: charclass() (#19748)
vim-patch:8.2.1536: cannot get the class of a character; emoji widths are wrong

Problem:    Cannot get the class of a character; emoji widths are wrong in
            some environments.
Solution:   Add charclass(). Update some emoji widths.  Add script to check
            emoji widths.
4e4473c927

Use latest charclass() docs from Vim.
Rewrite DoIt() in emoji_list.vim in Lua.
Omit emoji table updates:
- emoji_width update looks wrong as these added ranges are only double-width when followed by 0xFE0F.
- Other updates are too old.

vim-patch:8.2.1540: the user cannot try out emoji character widths

Problem:    The user cannot try out emoji character widths.
Solution:   Move the emoji script to the runtime/tools directory.
98945560c1
2022-08-13 11:29:38 +08:00
Jonas Strittmatter
1cf3a4b409
docs: clarify that cursorline will be disabled before command preview (#19710) 2022-08-12 10:21:50 +02:00
Mathias Fußenegger
02289ab898
fix(lsp): fix nil value error in get_group (#19735)
`server_capabilities` can be nil until the server is initialized.
Reproduced with:

    vim.lsp.stop_client(vim.lsp.start_client {
      cmd = { vim.v.progpath, '-es', '-u', 'NONE', '--headless' };
    })
2022-08-12 10:10:03 +02:00
Mathias Fußenegger
33b77eb728
fix(lsp): handle nil client in onexit callback (#19722)
Follow up to https://github.com/neovim/neovim/pull/19658
2022-08-11 19:21:57 +02:00
Lewis Russell
a27756cc24
fix(signs): priority of extmark signs (#19718) 2022-08-11 17:26:17 +01:00
Mathias Fußenegger
996fc2256b
fix(lsp): avoid pipe leaks if lsp cmd isn't executable (#19717)
The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
2022-08-11 17:04:55 +02:00
Mathias Fußenegger
8b67f37798
fix(lsp): fix some type annotations in lsp.rpc (#19714) 2022-08-11 15:17:05 +02:00
Christian Clason
d1fb0dd8b9
Merge pull request #19685 from ii14/gen_vimdoc_indentation
docs: change gen_vimdoc indentation level
2022-08-11 14:34:00 +02:00
ii14
ea333badd2 docs: regenerate 2022-08-11 14:25:48 +02:00
Jonas Strittmatter
ff1266aaaa
vim-patch:9.0.0182: quarto files are not recognized (#19702)
Problem:    Quarto files are not recognized.
Solution:   Recognize quarto files by the extension. (Jonas Strittmatter,
            closes vim/vim#10880)
3a9687fb27
2022-08-10 13:44:57 +02:00
zeertzjq
512e0441f1
docs: fix some mistakes and missing docs (#19699) 2022-08-10 12:47:38 +08:00
Mathias Fußenegger
bebfbfab3b
fix(lsp): handle multiple clients with incremental sync (#19658)
The change tracking used a single lines/lines_tmp table to track
changes to a buffer.

If multiple clients using incremental sync are connected to a buffer,
they both made changes to the same lines table. That resulted in an
inconsistent state.

This commit changes the didChange handling to group clients by
synchronization scheme and offset encoding.
This avoids computing the diff multiple times for clients using the
same scheme and resolves the lines/lines_tmp conflicts.

Fixes https://github.com/neovim/neovim/issues/19325
2022-08-09 22:20:40 +02:00
Christian Clason
33ddca6fa0
docs(lua): add luv (vim.loop) reference manual (#19679)
Upstreamed from https://github.com/nanotee/luv-vimdocs with kind
permission from @nanotee.
2022-08-09 13:21:50 +02:00
Christian Clason
a5e846b996
vim-patch:partial: 48c3f4e0bff7 (#19684)
vim-patch:partial:48c3f4e0bff7

Update runtime files
48c3f4e0bf

partially skip `options.txt` (needs 9.0.0138)
2022-08-09 10:43:28 +02:00
dundargoc
e6680ea7c3
docs(lua): add Lua 5.1 reference manual (#19663)
based on http://www.vim.org/scripts/script.php?script_id=1291
reformatted to match Nvim documentation style; removed irrelevant sections

Co-authored-by: dundargoc <gocundar@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2022-08-08 18:58:32 +02:00
Mathias Fußenegger
68c674af0f
feat(lsp): set formatexpr by default (#19677)
Follow up to https://github.com/neovim/neovim/pull/19003
2022-08-08 18:30:17 +02:00
zeertzjq
9fedb6fd78 vim-patch:8.2.3545: setcellwidths() may make 'listchars' or 'fillchars' invalid
Problem:    setcellwidths() may make 'listchars' or 'fillchars' invalid.
Solution:   Check the value and give an error. (closes vim/vim#9024)
94358a1e6e

Cherry-pick f_setcellwidths() change from patch 9.0.0036.
Cherry-pick 'ambiwidth' docs update from runtime update 079ba76ae7a7.
2022-08-08 20:03:40 +08:00
zeertzjq
53c9500c1d vim-patch:8.2.1535: it is not possible to specify cell widths of characters
Problem:    It is not possible to specify cell widths of characters.
Solution:   Add setcellwidths().
08aac3c619

Co-Authored-By: delphinus <me@delphinus.dev>
2022-08-08 20:03:40 +08:00
Mathias Fußenegger
a46e6afb8b
fix(lsp): set end_col in formatexpr (#19676)
The last line was excluded from formatting via formatexpr because the
character in the params was set to 0 instead of the end of line.
2022-08-08 13:02:15 +02:00
Mathias Fußenegger
2d5fce2cdb
feat(lsp): disable exit_timeout by default (#19672)
The lsp client used to wait up to 500ms for a language server to
shutdown before sending a TERM signal.

The intention behind the 500ms grace period was to ensure the language
server exits to prevent stale processes, but it has the side-effect that
it can interrupt language-servers which are too slow to shutdown within
500ms. Language servers tend to write out index files or project files
on shutdown, and being interrupted during this process can cause
corruption of those files.

This changes the default to not wait at all, at the risk of leaving
stale processes around if the language server isn't well behaved.

An alternative would be to wait indefinitely, but that can cause neovim
to take several seconds to exit.
2022-08-08 12:34:37 +02:00
zeertzjq
5f0fbe7c2f
vim-patch:8.1.0942: options window still checks for the multi_byte feature (#19652)
Problem:    Options window still checks for the multi_byte feature.
Solution:   Remove the unnecessary check. (Dominique Pelle, closes vim/vim#3990)
76cbe811da
2022-08-06 08:29:57 +08:00
Cai.MY
85ad0e6b43
fix(lsp): avoid ^M character in hover window on Windows (#19640) 2022-08-05 15:23:01 +02:00
Christian Clason
21f5aee777
vim-patch:9.0.0141: "delmenu" does not remove autocmmands (#19646)
Problem:    "delmenu" does not remove autocmmands. Running menu test function
            alone fails.
Solution:   Delete autocommands Make sure there is at least one menu.
            (closes vim/vim#10848)
206fce307b
2022-08-05 12:23:41 +02:00
Jonas Strittmatter
7ebcb9b333
docs: improve example in incremental preview section (#19613)
- Separate preview and callback functions to make the example easier to understand
- Use false instead of 0 for boolean arguments in API function calls
- Remove explicit nil checks for consistency
- Format with stylua
2022-08-05 10:16:26 +08:00
zeertzjq
57fbcc6929 vim-patch:8.2.0478: new buffers are not added to the Buffers menu
Problem:    New buffers are not added to the Buffers menu.
Solution:   Turn number into string. (Yee Cheng Chin, closes vim/vim#5864)
5908fdf72f
2022-08-05 07:56:56 +08:00
zeertzjq
d985323c55 vim-patch:8.2.0413: buffer menu does not handle special buffers properly
Problem:    Buffer menu does not handle special buffers properly.
Solution:   Keep a dictionary with buffer names to reliably keep track of
            entries.
            Also trigger BufFilePre and BufFilePost for command-line and
            terminal buffers when the name changes.
5e94a29ebb
2022-08-05 07:53:54 +08:00
zeertzjq
5170a4a369 vim-patch:8.2.3459: Vim9: need more tests for empty string arguments
Problem:    Vim9: need more tests for empty string arguments.
Solution:   Add more tests.  Also use empty argument with menu_info() to get
            the top-level menu names. (Yegappan Lakshmanan, closes vim/vim#8925)
51491adfa8
2022-08-05 06:47:24 +08:00
zeertzjq
77926b6493 vim-patch:8.2.0385: menu functionality insufficiently tested
Problem:    Menu functionality insufficiently tested.
Solution:   Add tests.  Add menu_info(). (Yegappan Lakshmanan, closes vim/vim#5760)
0eabd4dc8f

Omit feedkeys() change: even if "L" flag is implemented it will likely
use input_enqueue(), which already checks for interrupts.

Omit Test_mouse_popup_menu(): already tested in Lua.
2022-08-05 06:47:24 +08:00
zeertzjq
27ce21ac85
vim-patch:partial:8.2.0897: list of functions in patched version is outdated (#19637)
Problem:    List of functions in patched version is outdated.
Solution:   Update the function lists only.
ebacddbc16
2022-08-04 11:05:49 +08:00
rhcher
7c997dbc5d
fix(lsp): prevent unexpected position jumps (#19370) 2022-08-03 21:44:33 +02:00
Justin M. Keyes
43cd91a4f4
Merge #19626 build: cleanup old cmake files 2022-08-03 07:54:53 -07:00
Dundar Goc
6e2c6114f9 build: replace deprecated cmake features with their modern alternatives
- Use DIRECTORY instead of PATH in get_filename_component
- Use COMPILE_OPTIONS instead of COMPILE_FLAGS. COMPILE_FLAGS is treated
  as a single string while COMPILE_OPTIONS is a list, meaning that cmake
  will take care of any escaping and quoting automatically.
2022-08-03 09:52:05 +02:00
dundargoc
b8dcbcc732
docs: fix typos (#19588)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
2022-08-03 09:47:16 +08:00
bfredl
9092540315 feat(terminal): implement <c-\><c-o> for terminal mode
this works similar to <c-o> or <c-\><c-o> in insert mode
2022-08-02 13:54:41 +02:00
zeertzjq
0a049c322f
test: improve mapping tests and docs (#19619) 2022-08-02 11:13:22 +08:00
Mathias Fußenegger
e99de3f12f
fix(lsp): send didOpen if name changes on write (#19583)
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.

Closes https://github.com/neovim/neovim/issues/18688
2022-08-01 22:32:53 +02:00
Christian Clason
711ef4eac9
vim-patch:05a8061eecd9 (#19610)
Update runtime files
05a8061eec
2022-08-01 17:13:53 +02:00
Percy Ma
c6181a672a
feat(node): add pnpm support #19461 2022-08-01 07:21:54 -07:00
zeertzjq
6963c2bdcd vim-patch:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

vim-patch:9.0.0127: unused variable

Problem:    Unused variable.
Solution:   Remove the variable. (closes vim/vim#10829)
e95f22f63a
2022-08-01 21:54:18 +08:00
zeertzjq
083865071b vim-patch:8.2.0807: cannot easily restore a mapping
Problem:    Cannot easily restore a mapping.
Solution:   Add mapset().
4c9243f9fb

Use MapArgument to reduce number of arguments of map_add().

N/A patches for version.c:

vim-patch:8.2.0809: build failure with small features

Problem:    Build failure with small features. (Tony Mechelynck)
Solution:   Move "expr" inside #ifdef.
5a80f8ad5d
2022-08-01 21:54:18 +08:00
ii14
db6e93c48d
feat(api): add replace_keycodes to nvim_set_keymap (#19598) 2022-08-01 21:35:08 +08:00
LaurenceWarne
9f5d5aa3da
Use Strings instead of Tables in vim.filetype.matchregex Doc (#19604)
docs: use strings instead of tables in vim.filetype.matchregex doc
2022-08-01 06:45:43 -06:00
Gustavo Sampaio
ece0850b73
fix(session): respect sessionoptions=terminal #19497
fixes #13078

Co-authored-by: Yuta Katayama <8683947+yutkat@users.noreply.github.com>
2022-08-01 05:13:46 -07:00
Shougo Matsushita
81a1d26c3e vim-patch:9.0.0114: the command line takes up space even when not used
Problem:    The command line takes up space even when not used.
Solution:   Allow for 'cmdheight' to be set to zero. (Shougo Matsushita,
            closes vim/vim#10675, closes vim/vim#940)
f39cfb7262

Omit win_redr_ruler() change: winbar may still need redraw.
Omit win_update() changes: Nvim doesn't use `Rows` there.
Omit redraw_asap(): removed.
2022-07-31 17:15:36 +08:00
dundargoc
abc087f4c6
docs: fix typos (#19024)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
2022-07-31 16:46:38 +08:00
Christian Clason
29d5ca7d66 vim-patch:9.0.0111: "nocombine" is missing from synIDattr()
Problem:    "nocombine" is missing from synIDattr().
Solution:   Add "nocombine". (Munif Tanjim, closes vim/vim#10816)
de78632c41
2022-07-31 06:25:57 +08:00
Christian Clason
6237ac8402
vim-patch:2ecbe53f452e (#19577)
Update runtime files
2ecbe53f45
2022-07-30 15:48:32 +02:00
Mathias Fußenegger
b25abbf4b8
docs(lsp): use direct link to formattingOptions in format docs (#19558)
Also changes `@see` to `See` to avoid the break to a dedicated "See
also" block in the generated vimdoc
2022-07-28 19:41:30 +02:00
Mathias Fußenegger
98915f88b2
feat(lsp): add range option to code_action; deprecate range_code_action (#19551)
`code_action` gained extra functions (`filter` and `apply`) which
`range_code_action` didn't have.

To close this gap, this adds a `range` option to `code_action` and
deprecates `range_code_action`.

The option defaults to the current selection if in visual mode.
This allows users to setup a mapping like `vim.keymap.set({'v', 'n'},
'<a-CR>', vim.lsp.buf.code_action)`

`range_code_action` used to use the `<` and `>` markers to get the
_last_ selection which required using a `<Esc><Cmd>lua
vim.lsp.buf.range_code_action()<CR>` (note the `<ESC>`) mapping.
2022-07-28 19:19:07 +02:00