Commit Graph

26464 Commits

Author SHA1 Message Date
Mike
e4da418ba8
fix(fs.lua): normalize slash truncation (#23753)
Preserve last slash in windows' root drive directories
2023-07-18 14:36:04 +08:00
Lewis Russell
80cf0f3d29
Merge pull request #24363 from lewis6991/docs/luatypes
docs(lua): move some function docs to lua files
2023-07-17 17:40:14 +01:00
Mathias Fußenegger
1b9ccd38a1
feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113) 2023-07-17 18:27:16 +02:00
Lewis Russell
6e9b204afb fix: doc errors 2023-07-17 17:09:16 +01:00
Lewis Russell
69d49727d7 fix: luacheck 2023-07-17 16:32:56 +01:00
Lewis Russell
e6e0bc225b refactor(gen_vimdoc): put defgroup handling in a function 2023-07-17 16:25:29 +01:00
Lewis Russell
c2d7c2826c docs(lua): change *lua-foo* -> *vim.foo* 2023-07-17 16:25:29 +01:00
Lewis Russell
0ac3c4d631 docs(lua): move function docs to lua files 2023-07-17 16:25:28 +01:00
zeertzjq
d0d132fbd0
fix(terminal): don't send unknown special keys to terminal (#24378)
Special keys are negative integers, so sending them to terminal leads to
strange behavior.
2023-07-17 21:42:55 +08:00
Lewis Russell
881d17a113
feat(options)!: remove compatible behaviours for vim 5.0 and earlier 2023-07-17 14:27:21 +01:00
Lewis Russell
3fd504dbec docs: handle whitespace in emmycomments 2023-07-17 12:59:10 +01:00
Lewis Russell
a54f88ea64 docs(lua): do not render self args 2023-07-17 12:59:06 +01:00
Lewis Russell
d0b612f360 refactor: rename _meta.lua to _options.lua 2023-07-17 12:59:04 +01:00
kylo252
98b22867c3
test(fs): vim.loop was renamed to vim.uv (#24376)
test(fs): vim.loop has been replaced with vim.uv
2023-07-17 19:27:55 +08:00
zeertzjq
b60a2ab4cb
fix(inccommand): block errors when parsing command line again (#24374)
Revert the change to ex_getln.c from a741c7fd04
2023-07-17 10:15:45 +08:00
kylo252
f660b79480
test(fs): get tmpdir robustly #23021
Problem:
helpers.tmpname() may create a local file, depending on circumstances.

Solution:
Only use helpers.tmpname() for its parent directory (the "temp root").
Use fs_mkdtemp() to actually get a unique name.
2023-07-16 05:50:10 -07:00
Kai Ting
c3de6524a5
fix(clipboard): ignore exit caused by signal #23378
Problem:
If clipboard job exits by signal, the exit code is >=128:
939d9053bd
xclip 0.13 often exits with code 143, which spams unhelpful messages:

    clipboard: error invoking xclip: Waiting for selection requests,
    Control-C to quit   Waiting for selection request number 1

Solution:
Don't show a warning if the clipboard tool exit code is >=128.
Fixes: #7054
2023-07-16 04:15:30 -07:00
zeertzjq
047c22a28c
docs(term.txt): reorder paragraphs about TUI input (#24367)
Make |tui-modifyOtherKeys| and |tui-csiu| tags appear at a better place.
Also adapt the |<Tab>| help update from dad4473f02
2023-07-16 18:39:45 +08:00
Mike
251ca45ac9
fix(lsp): markdown code fence should allow space before info string #24364
Problem:
Bash language server returns "hover" markdown content that starts with
a code fence and info string of `man` preceded by whitespace, which Nvim
does not render properly.

See 0ee73c53ce/server/src/server.ts (L821C15-L821C15)
```typescript
function getMarkdownContent(documentation: string, language?: string): LSP.MarkupContent {
  return {
    value: language
      ? // eslint-disable-next-line prefer-template
        ['``` ' + language, documentation, '```'].join('\n')
      : documentation,
    kind: LSP.MarkupKind.Markdown,
  }
}
```

For example,
```
    ``` man
    NAME
       git - the stupid content tracker
    ```
```

If I remove the white space, then it is properly formatted. 
```    
    ```man instead of ``` man
```

Per CommonMark Spec https://spec.commonmark.org/0.30/#info-string
whitespace is allowed before and after the `info string` which
identifies the language in a codeblock.
> The line with the opening code fence may optionally contain some text
> following the code fence; this is trimmed of leading and trailing
> spaces or tabs and called the [info
> string](https://spec.commonmark.org/0.30/#info-string). If the [info
> string](https://spec.commonmark.org/0.30/#info-string) comes after
> a backtick fence, it may not contain any backtick characters. (The
> reason for this restriction is that otherwise some inline code would
> be incorrectly interpreted as the beginning of a fenced code block.)

 Solution:
 Adjust stylize_markdown() to allow whitespace before codeblock info.
2023-07-16 03:11:45 -07:00
zeertzjq
abe39f2b24
feat(api)!: change return type of nvim_win_text_height to Dict (#24365) 2023-07-16 18:02:53 +08:00
zeertzjq
622ae2f53e
feat(tui): support Super and Meta modifiers (#24357) 2023-07-15 15:03:01 +08:00
Mathias Fußenegger
33e1a8cd70
feat(lsp): map K to hover by default #24331
Related: https://github.com/neovim/neovim/issues/24252
2023-07-14 09:47:18 -07:00
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