Commit Graph

2697 Commits

Author SHA1 Message Date
Christian Clason
e651ae5864
vim-patch:d592deb33652 (#19002)
Update runtime files
d592deb336
2022-06-17 20:38:21 +02:00
zeertzjq
1fe94cb008
docs: improve 'insertmode' emulation #18962
The current emulation script enters Insert mode much too frequently.
Using only BufWinEnter seems to be a closer simulation.

Also add a few more mappings.
2022-06-16 17:16:33 -07:00
Justin M. Keyes
1f2c2a35ad feat(server): instance "name", store pipes in stdpath(state)
Problem:
- Unix sockets are created in random /tmp dirs.
  - /tmp is messy, unclear when OSes actually clear it.
  - The generated paths are very ugly. This adds friction to reasoning
    about which paths belong to which Nvim instances.
- No way to provide a human-friendly way to identify Nvim instances in
  logs or server addresses.

Solution:
- Store unix sockets in stdpath('state')
- Allow --listen "name" and serverstart("name") to given a name (which
  is appended to a generated path).

TODO:
- is stdpath(state) the right place?
2022-06-15 19:29:51 -07:00
dundargoc
6de7f32d52
docs: fix typos (#18866)
docs: fix typos and similarly insignificant changes

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
2022-06-15 08:49:54 +08:00
Christian Clason
2f2022773f
vim-patch:6ba83ba9ee29 (#18948)
Update runtime files.
6ba83ba9ee
2022-06-14 08:52:04 +02:00
Shougo
663cbe2620
feat: cmdheight=0 #16251
Fix https://github.com/neovim/neovim/issues/1004

Limitation: All outputs need hit-enter prompt.

Related:
https://github.com/neovim/neovim/pull/6732
https://github.com/neovim/neovim/pull/4382
2022-06-13 02:40:51 -07:00
bfredl
612944c586 refactor(api): update vimdoc 2022-06-12 19:45:39 +02:00
Christian Clason
6eaf10502c
vim-patch:partial:63f32603789d (#18916)
Update runtime files
63f3260378

skip translations
skip user manual rewrite
2022-06-10 08:40:32 +02:00
Gregory Anders
58323b1fe2
feat(filetype): remove side effects from vim.filetype.match (#18894)
Many filetypes from filetype.vim set buffer-local variables, meaning
vim.filetype.match cannot be used without side effects. Instead of
setting these buffer-local variables in the filetype detection functions
themselves, have vim.filetype.match return an optional function value
that, when called, sets these variables. This allows vim.filetype.match
to work without side effects.
2022-06-09 13:12:36 -06:00
zeertzjq
d6247a575c vim-patch:8.2.5066: lcs-leadmultispace
aca12fd89b
2022-06-09 21:26:23 +08:00
kylo252
3da3cfc864
feat(autocmds): retrieve lua callback (#18642)
add a new `callback` field to `nvim_get_autocmds`
2022-06-09 07:18:56 -06:00
Sean Dewar
3cd22a3485
fix(eval/f_getmatches): return empty list for invalid win argument (#18893)
Slight inaccuracy in v8.1.1084's port.
Like Vim, it should return [], not 0.
Ref #18890
2022-06-07 16:55:32 +01:00
Christian Clason
1324e7f79e
vim-patch:partial:016188fd8a30 (#18890)
Update runtime files.
016188fd8a

omit changes from doc/builtin.txt (needs 8.2.1536, 8.2.4981)
skip user manual rewrite for Vim9script
2022-06-07 14:41:53 +02:00
Javier Lopez
cf2738109a
docs: documenting struct members inline #18783
Without the proper comments, doxygen doesn't understand the comment
belongs to the struct member:

https://www.doxygen.nl/manual/docblocks.html#memberdoc

[skip ci]
2022-06-06 05:30:48 -07:00
Christian Clason
df4ffce543
vim-patch:partial:cfa8f9a3f285 (#18858)
Update runtime files
cfa8f9a3f2

skip syntax/vim.vim (needs 8.2.4770)
skip doc/syntax.vim (needs several colorscheme patches)
skip further rewrite of manual
2022-06-04 10:53:42 +02:00
dundargoc
ff20d40321
docs: fix typos (#18269)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dan Sully <dan+github@sully.org>
Co-authored-by: saher <msaher.shair@gmail.com>
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
Co-authored-by: Benedikt Müller <d12bb@posteo.de>
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
2022-06-04 11:56:36 +08:00
Mathias Fußenegger
69774e3179
feat(lsp): add a start function (#18631)
A alternative/subset of https://github.com/neovim/neovim/pull/18506  that should be forward compatible with a potential project system.

Configuration of LSP clients (without lspconfig) now looks like this:

    vim.lsp.start({
       name = 'my-server-name',
       cmd = {'name-of-language-server-executable'},
       root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
    })
2022-06-03 14:59:19 +02:00
bfredl
9745941ef6
Merge pull request #18730 from bfredl/apiconvert
convert API types using mpack instead of msgpack
2022-06-02 23:01:21 +02:00
Christian Clason
26966688aa
fix(treesitter): correct region for string parser (#18794)
fixes injections for string parsers after eab4d03a32
2022-06-02 17:35:16 +02:00
bfredl
d5f047bee0 refactor(api): use a unpacker based on libmpack instead of msgpack-c
Currently this is more or less a straight off reimplementation,
but this allow further optimizations down the line, especially
for avoiding memory allocations of rpc objects.

Current score for "make functionaltest; make oldtest" on a -DEXITFREE build:

is 117 055 352 xfree(ptr != NULL) calls (that's NUMBERWANG!).
2022-06-02 16:05:24 +02:00
zeertzjq
96c494dec3
refactor: correct comments and assertions about mapping rhs <Nop> (#18821)
Also avoid referring to mappings as "keymaps" in commands and docs.

						*map_empty_rhs* *map-empty-rhs*
You can create an empty {rhs} by typing nothing after a single CTRL-V (you
have to type CTRL-V two times).  Unfortunately, you cannot do this in a vimrc
file.
2022-06-01 21:37:01 +08:00
Gregory Anders
046b4ed461 feat(fs): add vim.fs.normalize() 2022-05-31 13:30:10 -06:00
Gregory Anders
f271d70661 feat(fs): add vim.fs.find()
This is a pure Lua implementation of the Vim findfile() and finddir()
functions without the special syntax.
2022-05-31 13:04:41 -06:00
Gregory Anders
2a62bec37c feat(fs): add vim.fs.dir()
This function is modeled after the path.dir() function from Penlight and
the luafilesystem module.
2022-05-31 13:04:41 -06:00
Gregory Anders
b740709431 feat(fs): add vim.fs.basename() 2022-05-31 13:04:41 -06:00
Gregory Anders
c5526a27c3 feat(fs): add vim.fs.dirname() 2022-05-31 13:04:41 -06:00
Gregory Anders
67cbaf58c4 feat(fs): add vim.fs.parents()
vim.fs.parents() is a Lua iterator that returns the next parent
directory of the given file or directory on each iteration.
2022-05-31 13:04:40 -06:00
Javier Lopez
e6652821bd
refactor(checkhealth)!: rename to vim.health, move logic to Lua #18720
- Complete function:
  There was lots of unnecessary C code for the complete function, therefore
  moving it to Lua and use all the plumbing we have in place to retrieve the
  results.
- Moving the module:
  It's important we keep nvim lua modules name spaced, avoids conflict with
  plugins, luarocks, etc.
2022-05-31 11:10:18 -07:00
bfredl
7380ebfc17
Merge pull request #18194 from famiu/feat/usercmd_preview
feat: user command "preview" (like inccommand)
2022-05-31 17:44:13 +02:00
Famiu Haque
46536f53e8 feat: add preview functionality to user commands
Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
2022-05-31 20:55:05 +06:00
dundargoc
b7d70de345
docs(dev-style): remove rules covered by uncrustify #18767
Uncrustify is the source of truth where possible.
See also https://github.com/neovim/neovim/pull/18563
2022-05-30 17:48:25 -07:00
zeertzjq
d404d68c92
docs: clarify that nvim_strwidth counts control characters as one cell (#18802) 2022-05-31 07:06:34 +08:00
Justin M. Keyes
f6e19e7334
fix(logging): skip recursion, fix crash #18764
Problem:
1. The main log routine does not protect itself against recursion.
   log_lock() doesn't guard against recursion, it would deadlock...
2. 22b52dd462 (#11501) regressed 6f27f5ef91 (#10172), because
   set_init_1..process_spawn tries to log (see backtrace below), but the
   mutex isn't initialized yet. Even if the mutex were valid, we don't
   want early logging to fallback to stderr because that can break
   embedders when stdio is used for RPC.

    frame 1: 0x00000001001d54f4 nvim`open_log_file at log.c:205:7
    frame 2: 0x00000001001d5390 nvim`logmsg(log_level=1, context="UI: ", func_name=0x0000000000000000, line_num=-1, eol=true, fmt="win_viewport") at log.c:150:20
    frame : 0x000000010039aea2 nvim`ui_call_win_viewport(grid=2, win=1000, topline=0, botline=1, curline=0, curcol=0, line_count=1) at ui_events_call.generated.h:321:3
    frame 4: 0x00000001003dfefc nvim`ui_ext_win_viewport(wp=0x0000000101816400) at window.c:939:5
    frame 5: 0x00000001003ec5b4 nvim`win_ui_flush at window.c:7303:7
    frame 6: 0x00000001003a04c0 nvim`ui_flush at ui.c:508:3
    frame 7: 0x00000001002966ba nvim`do_os_system(argv=0x0000600000c0c000, input=0x0000000000000000, len=0, output=0x0000000000000000, nread=0x00007ff7bfefe830, silent=false, forward_output=false) at shell.c:894:3
    frame 8: 0x0000000100295f68 nvim`os_call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_args=0x0000000000000000) at shell.c:663:18
    frame 9: 0x0000000100295845 nvim`call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_shell_arg=0x0000000000000000) at shell.c:712:14
    frame 10: 0x0000000100294c6f nvim`os_expand_wildcards(num_pat=1, pat=0x00007ff7bfefeb20, num_file=0x00007ff7bfefee58, file=0x00007ff7bfefee60, flags=43) at shell.c:328:7
    ...
    frame 23: 0x000000010028ccef nvim`expand_env_esc(srcp=",~foo", dst="~foo", dstlen=4094, esc=false, one=false, prefix=0x0000000000000000) at env.c:673:17
    frame 24: 0x000000010026fdd5 nvim`option_expand(opt_idx=29, val=",~foo") at option.c:1950:3
    frame 25: 0x000000010026f129 nvim`set_init_1(clean_arg=false) at option.c:558:19
    frame 26: 0x00000001001ea25e nvim`early_init(paramp=0x00007ff7bfeff5f0) at main.c:198:3
    frame 27: 0x00000001001ea6bf nvim`main(argc=1, argv=0x00007ff7bfeff848) at main.c:255:3

Solution:
1. Check for recursion, show "internal error" message.
    - FUTURE: when "remote TUI" is merged, can we remove log_lock()?
2. Skip logging if log_init wasn't called yet.
2022-05-30 13:07:33 -07:00
bfredl
ebad151a2a
Merge pull request #18792 from famiu/feat/nvim_create_user_command/smods
feat(api): pass structured modifiers to commands
2022-05-29 15:23:51 +02:00
Famiu Haque
9988d2f214 feat(nvim_create_user_command): pass structured modifiers to commands
Adds an `smods` key to `nvim_create_user_command` Lua command callbacks,
which has command modifiers but in a structured format. This removes the
need to manually parse command modifiers. It also reduces friction in
using `nvim_cmd` inside a Lua command callback.
2022-05-29 10:52:30 +06:00
Lewis Russell
eab4d03a32
fix(treesitter): offset directive associates range with capture (#18276)
Previously the `offset!` directive populated the metadata in such a way
that the new range could be attributed to a specific capture. #14046
made it so the directive simply stored just the new range in the
metadata and information about what capture the range is based from is
lost.

This change reverts that whilst also correcting the docs.
2022-05-28 19:22:18 +02:00
dundargoc
1b235fe6ca
docs(options): move all removed options to vim_diff.txt (#18770)
It's more consistent to gather all removed options in one spot rather
than spreading it out.
2022-05-28 16:42:56 +08:00
Famiu Haque
826462a8f0
fix(ui): require window-local value to show winbar on floating windows (#18773)
Previously, there was a bug where setting the local value of 'winbar' to
itself would cause winbar to appear on a floating window, which is
undesirable. This fix makes it so that it's explicitly required for the
window-local value of 'winbar' for a floating window to be set in order
for winbar to be shown on that window.
2022-05-28 06:57:20 +08:00
bfredl
30915cc8b0
Merge pull request #18306 from lewis6991/fnfast
feat(lua): allow some viml functions to run in fast
2022-05-26 15:03:07 +02:00
Mathias Fußenegger
e8ada41b63
feat(lsp): turn rename filter into a predicate (#18745)
Same as https://github.com/neovim/neovim/pull/18458 but for rename
2022-05-26 12:28:50 +02:00
zeertzjq
ec48c6f236 vim-patch:8.2.5010: the terminal debugger uses various global variables
Problem:    The terminal debugger uses various global variables.
Solution:   Add a dictionary to hold the terminal debugger preferences.
c9a431c763

Omit popup menu.
2022-05-26 07:47:00 +08:00
zeertzjq
eb623a1c45 docs: add missing termdebug docs from Vim runtime updates
388a5d4f20
4466ad6baa
6aa57295cf

Rename terminal.txt to nvim_terminal_emulator.txt in vim-patch.sh.
2022-05-26 07:47:00 +08:00
Mathias Fußenegger
fa3492c5f7
feat(lsp)!: turn format filter into predicate (#18458)
This makes the common use case easier.
If one really needs access to all clients, they can create a filter
function which manually calls `get_active_clients`.
2022-05-25 19:38:01 +02:00
bfredl
24352cba01
Merge pull request #18528 from lewis6991/setwinopt
feat(api): add `win` and `buf` to `nvim_set_option_value`
2022-05-25 17:05:28 +02:00
Daniel Steinberg
e5490b38b7
docs(api): floating wins omitted under :mksession (#18721) 2022-05-24 11:32:01 -06:00
dundargoc
a20892c4bc
vim-patch:partial 2d8ed0203aed (#18675)
* vim-patch:partial 2d8ed0203aed

Update runtime files.
2d8ed0203a

Skip:

runtime/doc/map.txt
runtime/doc/syntax.txt
runtime/doc/usr_51.txt
runtime/doc/usr_52.txt
runtime/syntax/help.vim
runtime/syntax/vim.vim

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-05-23 23:49:38 +02:00
Famiu Haque
4c6626f03d
feat: click support for 'statusline', 'winbar' #18650
The mouseclick item "%@" is now supported by 'statusline' and 'winbar'.
Previously it was only supported by 'tabline'.
2022-05-23 06:11:24 -07:00
Gregory Anders
9e1ee9fb1d
refactor!: delete insertmode (#18547)
Neovim already removed `evim` (or any similar flags). The 'insertmode'
option is a weird remnant, so get rid of it.

The 'insertmode' option is replaced with a script that closely emulates
the option. This script is documented at :help 'insertmode'
2022-05-22 21:20:18 -06:00
dundargoc
8c2fd65bb1
build(clint): remove redundant checks #18698
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-22 10:59:56 -07:00
bfredl
7f6d2984a8
Merge pull request #18608 from ckipp01/extmarkDocs
docs(extmark): remove message about passing in id=0
2022-05-22 19:07:51 +02:00