Commit Graph

26542 Commits

Author SHA1 Message Date
Yuma Ueda
fd9ac5aa8e
build(makefile): remove a phony target uninstall (#24349)
`uninstall` target was removed from makefile
2023-07-14 15:51:15 +02:00
Techatrix
2ecba65b4b
fix(lsp): remove unknown LSP protocol property (#24345)
'hierarchicalWorkspaceSymbolSupport' is not part of the LSP Specification
2023-07-14 07:36:10 +02:00
zeertzjq
9176b5e10a
fix(runtime): respect 'fileignorecase' when sourcing (#24344) 2023-07-14 07:57:13 +08:00
zeertzjq
dbb840da01
fix(runtime): respect 'rtp' order for all runtime files (#24335) 2023-07-14 06:46:16 +08:00
Mathias Fußenegger
a3f4598226
docs(lua): adds links to related keymap functions to keymap.set (#24337)
Might help with discovery, given that there is no `keymap.get()`
2023-07-13 14:43:36 +02:00
Lewis Russell
516b173780
perf(rtp): reduce rtp scans (#24191)
* perf(rtp): reduce rtp scans

Problem:
  Scanning the filesystem is expensive and particularly affects
  startuptime.

Solution:
  Reduce the amount of redundant directory scans by relying less on glob
  patterns and handle vim and lua sourcing lower down.
2023-07-13 10:17:19 +01:00
Christian Clason
998bebc15e
build(deps): bump luajit to HEAD - 8635cbabf (#24301) 2023-07-13 09:35:36 +02:00
zeertzjq
0ce3910868
fix(ui): cursor pos with left gravity inline virt_text at eol (#24329)
Problem:    Cursor is not after inline virtual text with left gravity
            when inserting after the end of the line.
Solution:   Add width of inline virtual text with left gravity to cursor
            virtcol in Insert mode even if on a NUL.
2023-07-13 08:32:17 +08:00
zeertzjq
9359701eae
test(extmarks): add test for virt_text_win_col with cpo+=n (#24328) 2023-07-13 07:02:06 +08:00
Mathias Fußenegger
317c80f460
feat(lsp): add method filter to get_active_clients (#24319) 2023-07-12 14:48:21 +02:00
zeertzjq
ef94fb69c6
perf(extmarks): don't handle inline virt_text if there is none (#24322)
Extreme testcase:
```lua
vim.fn.setline(1, 'foobar')
local ns = vim.api.nvim_create_namespace('')
for _ = 1, 100000 do
  vim.api.nvim_buf_set_extmark(0, ns, 0, 3, {})
end
local start_time = vim.loop.hrtime()
vim.fn.virtcol('$')
local stop_time = vim.loop.hrtime()
print(stop_time - start_time)
```
Before #20130: 31696
On master branch: 26191344
After this PR: 37692
2023-07-12 10:38:53 +08:00
zeertzjq
bf52fb7193
fix(mouse): copy the line before syntax matching (#24320) 2023-07-12 08:50:34 +08:00
Sean Dewar
bf5703042b
fix(tutor): don't use concealed text in expected lines #24316 2023-07-11 10:09:44 -07:00
zeertzjq
06694203e5
fix(drawline): fix missing Visual hl on double-width fold char (#24308) 2023-07-11 13:16:31 +08:00
zeertzjq
19fb573ad9
perf(extmarks): avoid unnecessary marktree traversal with folds (#24306)
Extreme testcase:
```lua
vim.cmd([[
  call setline(1, ['', '', ''])
  2,3fold
]])
local ns = vim.api.nvim_create_namespace('')
for _ = 1, 100000 do
  vim.api.nvim_buf_set_extmark(0, ns, 1, 0, { virt_lines = {{{ '' }}} })
end
local start_time = vim.uv.hrtime()
vim.api.nvim_win_text_height(0, {})
local stop_time = vim.uv.hrtime()
print(stop_time - start_time)
```
Before this PR: 21542011
After this PR: 43874
2023-07-11 08:57:55 +08:00
zeertzjq
db8fe63a93
feat(api): add nvim_win_text_height (#24236)
It uses the same code as "scroll_delta" of "win_viewport" UI event to
calculate text height, but is more flexible.
2023-07-11 07:15:46 +08:00
Gregory Anders
3750e5ed9c
vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)
Problem:    Cannot produce a status 418 or 503 message.
Solution:   Add err_teapot().

80adaa8ae8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-10 11:55:12 -05:00
Raphael
766f4978d6
fix(lint): lint warnings #24226 2023-07-10 04:38:15 -07:00
zeertzjq
fbeef0d4ef
fix(completion): don't add backslashes to runtime pattern (#24296)
Problem:    Bashslashes added as regexp in runtime completion may be
            treated as path separator with some 'isfname' value.
Solution:   Make curly braces work for runtime completion and use it.
2023-07-08 23:29:24 +08:00
Justin M. Keyes
b9a0e762f1 fix(defaults): visual star (*) on text with "?"
regression from 6318edadc3
2023-07-08 16:55:27 +02:00
Justin M. Keyes
0a90e4b05a fix(docs): match DocSearch style with site theme
ref 2b4f9e4780
2023-07-08 16:06:46 +02:00
Justin M. Keyes
6318edadc3 fix(defaults): visual hash (#) on text with "?"
Problem:
The default "#" mapping fails on the following example after v$h# with
cursor at start of the first line:

    aa?/\bb
    aa
    aa?/\bb

Solution:
Also escape "?".
2023-07-08 15:33:28 +02:00
Justin M. Keyes
7c077a3c2b
Merge #24295 from justinmk/doc2
docs: "Return (multiple)", condense @notes
2023-07-08 06:29:48 -07:00
Justin M. Keyes
d2e44da516 docs: gather @notes items into one section
related: 21eacbfef3
2023-07-08 15:06:36 +02:00
Justin M. Keyes
3a721820c3 docs: "Return (multiple)" heading
Problem:
Lua functions that return multiple results are declared by using
multiple `@return` docstring directives. But the generated docs don't
make it obvious what this represents.

Solution:
- Generate a "Return (multiple)" heading for multiple-value functions.
- Fix `@note` directives randomly placed after `@return`.
2023-07-08 15:06:36 +02:00
Justin M. Keyes
00d2f4b96e docs: MAINTAIN.md, nvim_get_mark 2023-07-08 15:06:36 +02:00
zeertzjq
8c9e37cc09
test(tui): add test for overriding argv[0] (#24293) 2023-07-08 18:27:53 +08:00
Chinmay Dalal
21fa19f3e8
fix(lsp): don't use hl_mode = combine for inlay hints #24276
Problem: `hl_mode` for inlay hints is `combine`, causing bugs like
inlay hints using highlights from the previous character
(#24152, #24068)

Solution: Don't use hl_mode=combine for inlay hints.
2023-07-08 00:14:52 -07:00
Ibby
c4df2f08b6
fix(extmarks): fix wrong highlight after "combine" virt_text (#24281) 2023-07-08 09:53:30 +08:00
zeertzjq
559c4cfd52
fix(startup): run embedded Nvim with real path (#24282)
fix(startup): run embedded process with real path
2023-07-08 08:27:39 +08:00
Lewis Russell
c379d72c49
feat(lua): allow vim.wo to be double indexed (#20288)
* feat(lua): allow vim.wo to be double indexed

Problem: `vim.wo` does not implement `setlocal`
Solution: Allow `vim.wo` to be double indexed

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-07-07 16:37:36 +01:00
Lewis Russell
804108af6c
docs: CONTRIBUTING.md updates (#24280) 2023-07-07 13:52:30 +01:00
Jaehwang Jung
c44d819ae1
fix(treesitter): update folds in all relevant windows (#24230)
Problem: When using treesitter foldexpr,
* :diffput/get open diff folds, and
* folds are not updated in other windows that contain the updated
  buffer.

Solution: Update folds in all windows that contain the updated buffer
and use expr foldmethod.
2023-07-07 11:12:46 +01:00
zeertzjq
811140e276
fix(folds): fix missing virt_lines above when fold is hidden (#24274) 2023-07-07 09:49:58 +08:00
zeertzjq
36941942d6
fix(drawline): inline virt_text hl_mode inside syntax/extmark hl (#24273) 2023-07-07 07:21:12 +08:00
Justin M. Keyes
06c4edf46b
Merge #21677 fix(defaults): visual star (*,#) is fragile 2023-07-06 04:05:13 -07:00
Justin M. Keyes
f39ca5df23 refactor(defaults): use vim.region for visual star (*,#)
Problem:
The parent commit added a new vim.get_visual_selection() function to
improve visual star. But that is redundant with vim.region(). Any
current limitations of vim.region() should be fixed instead of adding
a new function.

Solution:
Delete vim.get_visual_selection().
Use vim.region() to get the visual selection.
TODO: fails with visual "block" selections.
2023-07-06 12:18:55 +02:00
Steven Ward
abd380e28d fix(defaults): visual mode star (*,#) is fragile
Problem:
Visual mode "*", "#" mappings don't work on text with "/", "\", "?", and
newlines.

Solution:
Get the visual selection and escape it as a search pattern.
Add functions vim.get_visual_selection and _search_for_visual_selection.

Fix #21676
2023-07-06 10:29:50 +02:00
zeertzjq
4e34ca8ae7
docs(luaref): remove parentheses from tags for typedefs (#24271)
And fix alignment.
2023-07-06 14:57:46 +08:00
zeertzjq
2afb04758c
fix(vim.system): close check handle (#24270)
Fix hang after running vim.system() with sanitizers.
2023-07-06 12:56:19 +08:00
zeertzjq
25e62697c3
fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n (#24268) 2023-07-06 11:07:23 +08:00
zeertzjq
a0c9c04f00
refactor(plines.c): update outdated comments (#24264) 2023-07-06 04:36:22 +08:00
fredizzimo
1de82e16c1
fix(ui): delay win_viewport until screen update #24182
Problem:
Sometimes, when nvim sends the `win_viewport` event, for example when scrolling
with visible folds on the screen, it reports the `scroll_delta` value one batch
into "future". So when the client application is trying to show the new viewport
it's not yet updated, resulting in temporary corruption / screen flickering.

For more details see #23609, and starting from [this comment](
https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in
https://github.com/neovide/neovide/pull/1790,, where the issue was first
detected. Note that some of the conclusions in those are not fully accurate, but
the general observations are.

Solution:
When there are pending updates to a Window, delay the `win_viewport` UI event
until the updates are sent. This ensures that there's no flush between sending
the viewport and updating of the lines corresponding to the new viewport.

Document the existing viewport behaviour (for cases where there are no
extra flushes), give a hint about how applications can deal with the slightly
surprising behaviour of the viewport event being sent after the updates.

Fixes https://github.com/neovim/neovim/issues/23609
2023-07-05 06:31:34 -07:00
zeertzjq
8a788e2daa
Merge pull request #23228 from seandewar/cmdwin-jail
fix(api): use `text_locked()` to check for textlock
2023-07-05 17:04:17 +08:00
zeertzjq
df297e3c2b
fix(runtime): don't set gx mapping if already mapped (#24262)
This matches netrw's use of maparg().
2023-07-05 16:31:45 +08:00
zeertzjq
317038e7cb
fix(plines): don't return very large height on very long line (#24260) 2023-07-05 16:30:23 +08:00
Sean Dewar
aa4e47f704
fix(api): disallow some more functions during textlock
Problem: nvim_buf_set_text(), nvim_open_term() and termopen() all change buffer
text, which is forbidden during textlock. Additionally, nvim_open_term() and
termopen() may be used to convert the cmdwin buffer into a terminal buffer,
which is weird.

Solution: Allow nvim_buf_set_text() and nvim_open_term() in the cmdwin, but
disallow nvim_open_term() from converting the cmdwin buffer into a terminal
buffer. termopen() is not allowed in the cmdwin (as it always operates on
curbuf), so just check text_locked().

Also happens to improve the error in #21055: nvim_buf_set_text() was callable
during textlock, but happened to check textlock indirectly via u_save();
however, this caused the error to be overwritten by an unhelpful "Failed to
save undo information" message when msg_list == NULL (e.g: an `<expr>` mapping
invoked outside of do_cmdline()).
2023-07-05 08:33:32 +01:00
Sean Dewar
77118d0da8
fix(api): use text_locked() to check textlock
Problem: some API functions that check textlock (usually those that can change
curwin or curbuf) can break the cmdwin.

Solution: make FUNC_API_CHECK_TEXTLOCK call text_locked() instead, which already
checks for textlock, cmdwin and `<expr>` status.

Add FUNC_API_TEXTLOCK_ALLOW_CMDWIN to allow such functions to be usable in the
cmdwin if they can work properly there; the opt-in nature of this attribute
should hopefully help mitigate future bugs.

Also fix a regression in #22634 that made functions checking textlock usable in
`<expr>` mappings, and rename FUNC_API_CHECK_TEXTLOCK to FUNC_API_TEXTLOCK.
2023-07-05 08:31:52 +01:00
Justin M. Keyes
5936a88f18
Merge #23401 vim.ui.open: "gx" without netrw 2023-07-05 00:30:05 -07:00
zeertzjq
b2e8c0df20
fix(edit): fix K_EVENT interfering with 'digraph' (#24258) 2023-07-05 12:06:14 +08:00