Commit Graph

19437 Commits

Author SHA1 Message Date
Björn Linse
9e41e82481 feat(nvim_open_term): support input callback in lua 2021-10-20 13:07:43 +02:00
Jakub Łuczyński
035d82e0d3
build: update cmake min version to 3.10 #16065
* build(cmake): update cmake min version to 3.10
* ci: test cmake minimum required version
* build(cmake): remove some legacy includes
  * Since version 3.5 cmake_parse_arguments is implemented natively.
2021-10-19 19:19:33 -07:00
Gregory Anders
427bac6877
fix(diagnostic): allow floats to be focusable (#16093)
Setting focus_id allows the float to be focused by calling the function
a second time (a feature of open_floating_preview).
2021-10-19 16:29:52 -06:00
Gregory Anders
a2994c82e3
fix(diagnostic): handle diagnostics placed past the end of line (#16095) 2021-10-19 16:27:49 -06:00
Björn Linse
208d259e83
Merge pull request #15767 from lewis6991/lua_var_index
feat(lua): allow passing handles to `vim.b/w/t`
2021-10-19 22:21:31 +02:00
Gregory Anders
dfef90a518
fix(gen_vimdoc.py): spacing around inline elements #16092
The spacing fix drew attention to a couple of places that were using
incorrect formatting such as the key listing for `nvim_open_win`, so
those were fixed too.
2021-10-19 12:55:22 -07:00
Lewis Russell
6c5e7bde9a feat(lua): allow passing handles to vim.b/w/t
vim.bo can target a specific buffer by indexing with a number, e.g:
`vim.bo[2].filetype` can get/set the filetype for buffer 2. This change
replicates that behaviour for the variable namespace.
2021-10-19 19:47:33 +01:00
Gregory Anders
064411ea7f
refactor(diagnostic)!: replace 'show_*' functions with 'open_float' (#16057)
'show_line_diagnostics()' and 'show_position_diagnostics()' are
almost identical; they differ only in the fact that the latter also
accepts a column to form a full position, rather than just a line. This
is not enough to justify two separate interfaces for this common
functionality.

Renaming this to simply 'show_diagnostics()' is one step forward, but
that is also not a good name as the '_diagnostics()' suffix is
redundant. However, we cannot name it simply 'show()' since that
function already exists with entirely different semantics.

Instead, combine these two into a single 'open_float()' function that
handles all of the cases of showing diagnostics in a floating window.
Also add a "float" key to 'vim.diagnostic.config()' to provide global
values of configuration options that can be overridden ephemerally.
This makes the float API consistent with the rest of the diagnostic API.

BREAKING CHANGE
2021-10-19 11:45:51 -06:00
sim
aa4f0879e3
feat(lsp): set codelens virtual text hl_mode to combine (#16048)
It looks a bit off with the extmark going over the cursorline.

(With hl_mode combine it keeps the background of the cursorline under the codelens virtualtext)
2021-10-19 18:41:57 +02:00
zeertzjq
308fd88d0d
vim-patch:8.2.3537: wrong mode() during 'operatorfunc' #16087
Problem:    mode() does not return the right value in 'operatorfunc'.
Solution:   Reset finish_op while calling 'operatorfunc'.
75c30e96cf
2021-10-19 07:39:25 -07:00
zeertzjq
bdd180b5d2
docs: clarify chdir/CWD behaviors #16083 2021-10-19 07:37:11 -07:00
Famiu Haque
da7a4684df
fix(api/nvim_eval_statusline): allow maxwidth=0 #16080
Allows disabling statusline truncation by allowing maxwidth to be
set to 0 in `nvim_eval_statusline`.
2021-10-19 07:35:44 -07:00
William Chargin
9fb0f12357
feat(man.vim): convert spaces to underscores #16068
PostgreSQL ships with man pages for SQL statements like `CREATE TABLE`,
which are provided with underscores as `man 7 CREATE_TABLE`. This patch
updates `man#open_page` (as used by `:Man`) such that visually selecting
the words `CREATE TABLE` in SQL code and pressing `K` properly opens the
desired man page.

Writing `:Man CREATE TABLE` still does not work, since `CREATE` is
interpreted as a section name. (Similarly, `:Man CREATE TABLE AS` fails
because there are too many arguments to `:Man`.) But this is okay,
because if you're typing it anyway then you can just enter underscores
and also tab-completion properly suggests `:Man CREATE_TABLE(7)`.

This is a bit bespoke, but my box has over 9000 man pages (as reported
by `man -k '' | wc -l`), and not one of them has a space in the man page
name, whereas the Postgres manuals do exist and are actually useful.

Test Plan:
On a machine with Postgres manual pages, running

    nvim -u NORC +'exe "norm iCREATE TABLE foo(x int);" | norm 0veeK'

should open the appropriate man page.

wchargin-branch: man-spaces-to-underscores
2021-10-19 07:24:43 -07:00
Justin M. Keyes
aac15cf4ad
Merge #16000 refactor: uncrustify 2021-10-19 06:51:42 -07:00
Dundar Göc
6059784770 refactor: remove space after star 2021-10-19 15:20:33 +02:00
Dundar Göc
38dd53c525 refactor: make commas trail in enums 2021-10-19 15:20:33 +02:00
Dundar Göc
f98b8d2d44 refactor: enable formatting for files under lib 2021-10-19 15:20:33 +02:00
github-actions[bot]
29b718d04c
docs: regenerate (#15986)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-10-19 06:03:20 -07:00
James McCoy
4219cfcb90
Merge pull request #16084 from dundargoc/ci/commitlint/checkout-branch-directly
ci(commitlint): use action to checkout to pr branch directly
2021-10-19 07:30:09 -04:00
Dundar Göc
9039aa24b6 ci(commitlint): use action to checkout to pr branch directly 2021-10-19 09:58:30 +02:00
Famiu Haque
9086938f7b
feat(api): evaluate statusline string #16020
Adds API function `nvim_eval_statusline` to allow evaluating a
statusline string and obtaining information regarding it.

Closes https://github.com/neovim/neovim/issues/15849
2021-10-18 12:44:17 -07:00
Josa Gesell
e7ea54a3df
feat(lsp): use vim.ui.select() in codelenses (#16004)
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2021-10-18 11:52:22 -07:00
hrsh7th
bd2f61c6c4
fix(lsp): fix cursor row after textEdits (#16038) 2021-10-18 11:49:33 -07:00
Gregory Anders
bcc9ba51fa
fix(lsp): persist diagnostic config for clients
Persist configuration settings set with `vim.lsp.with` and
`vim.lsp.diagnostic.on_publish_diagnostics` by setting the config for
the namespace associated with the client.
2021-10-18 10:01:41 -06:00
Jakub Łuczyński
6b0a2e6996 build(install): rescan GLOB files on rebuild 2021-10-18 11:44:15 +02:00
James McCoy
389a898586
Merge pull request #16034 from rcowsill/ci/labeler/no-checkout
ci(labeler): Remove checkout steps
2021-10-17 21:18:27 -04:00
dundargoc
e62cac5be1
refactor: convert to doxygen-style comments #16013 2021-10-17 17:55:27 -07:00
dundargoc
aff444659e
fix(PVS/V1028): prevent possible overflow #16023
Full warning: "Possible overflow. Consider casting operands, not the
result."

https://pvs-studio.com/en/docs/warnings/v1028/
2021-10-17 17:11:23 -07:00
Björn Linse
ffc28dcbdb
Merge pull request #15999 from famiu/fix/build/export-windows-symbols
fix(build): export symbols on Windows
2021-10-17 23:58:14 +02:00
Björn Linse
8f9f127274
Merge pull request #15973 from bfredl/luapath
fix(runtime): don't use regexes inside lua require'mod'
2021-10-17 18:35:53 +02:00
Jan Edmund Lazo
a1e8199fff
Merge pull request #15952 from zeertzjq/vim-8.1.1291
vim-patch:8.0.{1459,1460,1461,1463},8.1.{0602,0604,1291},8.2.{0189,0876,0909,1411}: chdir and DirChanged related patches
2021-10-17 10:26:11 -04:00
Björn Linse
ea2023f689 fix(runtime): don't use regexes inside lua require'mod'
Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently
this only caches whether an rtp entry has a "lua/" subdir but we could
consider cache other subdirs potentially or even "lua/mybigplugin/"
possibly.

Note: the async_leftpad test doesn't actually fail on master, at least
not deterministically (even when disabling the fast_breakcheck
throttling). It's still useful as a regression test for further changes
and included as such.
2021-10-17 16:21:42 +02:00
Jan Edmund Lazo
77e6ecf85a
Merge pull request #15930 from dundargoc/vim-patch/old-style-c-comments
vim-patch:8.1.2396,8.1.2395,8.1.2394,8.1.2392,8.1.2368,8.1.2388,8.1.2379
2021-10-17 10:21:40 -04:00
Gregory Anders
d2d30dfabd
fix(diagnostic): do not override existing config settings #16043
When using `true` as the value of a configuration option, the option is
configured to use default values. For example, if a user configures
virtual text to include the source globally (using
vim.diagnostic.config) and a specific namespace or producer configures
virtual text with `virt_text = true`, the user's global configuration is
overriden.

Instead, interpret a value of `true` to mean "use existing settings if
defined, otherwise use defaults".
2021-10-17 07:18:35 -07:00
zeertzjq
38821cc50e test(dirchanged): add tests for DirChanged pattern "auto" 2021-10-17 22:04:53 +08:00
zeertzjq
6004f9137a refactor(dirchanged): tab -> tabpage
Match Vim's behavior.
2021-10-17 22:04:53 +08:00
zeertzjq
36290a2ebd vim-patch:8.2.1411: when splitting a window localdir is copied but prevdir is not
Problem:    when splitting a window localdir is copied but prevdir is not.
Solution:   Also copy prevdir. (closes vim/vim#6667)
a9a47d157a
2021-10-17 22:04:53 +08:00
zeertzjq
60584c0245 vim-patch:8.2.0909: cannot go back to the previous local directory
Problem:    Cannot go back to the previous local directory.
Solution:   Add "tcd -" and "lcd -". (Yegappan Lakshmanan, closes vim/vim#4362)
002bc79991
2021-10-17 22:04:53 +08:00
zeertzjq
34cfe74568 vim-patch:8.2.0876: :pwd does not give a hint about the scope of the directory
Problem:    :pwd does not give a hint about the scope of the directory
Solution:   Make ":verbose pwd" show the scope. (Takuya Fujiwara, closes vim/vim#5469)
950587242c
2021-10-17 22:04:53 +08:00
zeertzjq
b1dd90c760 vim-patch:8.2.0189: cd() with NULL argument crashes
Problem:    cd() with NULL argument crashes.
Solution:   Check for NULL. (Ken Takata, closes vim/vim#5558)
7cc96923c4
2021-10-17 22:04:53 +08:00
zeertzjq
8a2489d0a4 test: partially port Vim patches 8.1.2278 and 8.2.1432 2021-10-17 22:04:53 +08:00
zeertzjq
8727d38012 vim-patch:8.1.1291: not easy to change directory and restore
Problem:    Not easy to change directory and restore.
Solution:   Add the chdir() function. (Yegappan Lakshmanan, closes vim/vim#4358)
1063f3d200

Also includes some documentation changes from patch 8.1.1218.
2021-10-17 22:04:53 +08:00
zeertzjq
57651df9c1 vim-patch:8.1.0604: autocommand test fails on MS-Windows
Problem:    Autocommand test fails on MS-Windows.
Solution:   Use pathcmp() instead of strcmp() to check if a directory differs.
9eb76af451
2021-10-17 22:04:53 +08:00
zeertzjq
e91dee5c21 vim-patch:8.1.0602: DirChanged is also triggered when directory didn't change
Problem:    DirChanged is also triggered when the directory didn't change.
            (Daniel Hahler)
Solution:   Compare the current with the new directory. (closes vim/vim#3697)
2caad3fbbd
2021-10-17 22:04:53 +08:00
zeertzjq
eed89d5e0c vim-patch:8.0.1463: test fails without 'autochdir' option
Problem:    Test fails without 'autochdir' option.
Solution:   Skip test if 'autochdir' is not supported.
ec48a9c589
2021-10-17 22:04:53 +08:00
zeertzjq
920473d2f2 vim-patch:8.0.1459: cannot handle change of directory
Problem:    Cannot handle change of directory.
Solution:   Add the DirChanged autocommand event. (Andy Massimino,
            closes vim/vim#888)  Avoid changing directory for 'autochdir' too often.
b7407d3fc9

Only add "auto" pattern. "window" and "global" are already implemented.
Skip `Test_dirchanged_auto` using `CheckFunction test_autochdir`.
Part of PR #15952. More information can be found there.

N/A patches for version.c:

vim-patch:8.0.1460: missing file in patch

Problem:    Missing file in patch.
Solution:   Add changes to missing file.
b5cb65ba2b

vim-patch:8.0.1461: missing another file in patch

Problem:    Missing another file in patch.
Solution:   Add changes to missing file.
15833239a4
2021-10-17 22:04:53 +08:00
Justin M. Keyes
30af69509d
Merge #15994 feat(:source, nvim_exec): script-local scope 2021-10-17 06:20:35 -07:00
Famiu Haque
aa644b7fd3 fix(build): export symbols on Windows
Closes https://github.com/neovim/neovim/issues/15063

Allows using Neovim core functions using LuaJIT FFI on Windows.
2021-10-17 18:49:55 +06:00
Dundar Göc
b98383a250 fixup! vim-patch:8.1.2379: using old C style comments 2021-10-17 12:04:06 +02:00
dundargoc
f19dc06081
vim-patch:8.2.3519: TOML files are not recognized (#16045)
Problem:    TOML files are not recognized.
Solution:   Add filetype patterns for TOML. (Aman Verma, closes vim/vim#8984)
28b6a3bef6
2021-10-16 23:38:05 +02:00