Compare commits

...

4581 Commits

Author SHA1 Message Date
fe869a8ce2 NVIM 0.9.2
This is a maintenance release, focused on bug fixes and improvements.
However, There are included features related to TUI and :terminal.

BRAM

Nvim is a fork of the Vim editor, created and developed by Bram Moolenaar.
On August 3, 2023, he passed away at the age of 62. If Vim or Nvim have
been of use to you in your life, read `:help Bram` and `:help Uganda`
and consider honoring his memory in a way you see fit.

CHANGES SINCE 0.9.1

BREAKING CHANGES

An adjustment was made to the `grid_line` event as part of the exernal
UI protocol the `cells` array might now end with a `[' ', attr, 0]` item
with a repeat count of zero. This is needed by the TUI to disambiguate
final spaces on a line from just clearing the line, which will make a
difference when copying text using the terminal emulators builtin
primary selection support.

External UI:s can safely ignore such an empty item and most UIs already
handle this fine. But it could break some UI:s which has an assert to
validate the cell count to be bigger than zero, or similar checks.

FEATURES

- tui: Support Super and Meta modifiers
- terminal: forward more special keys and modifier-mouse combinations

BUG FIXES

- lua: Always set arg0 to lua scripts
- api: Redundant error when using `nvim_cmd`
- api, lua: Make blank lines in a message work properly
- column: fix bugs related to signs in 'statuscol'
- completion: Don't add backslash in runtime completion
- diff: Filler lines for hunks bigger than linematch limit
- edit: Fix K_EVENT interfering with 'digraph'
- editorconfig: Better validation and error handling
- events: Don't expand non-file as file name
- events: Trigger VimResume on next UI request
- extmarks: Wrong display when changing text with virt_lines
- folds: Update folds in Insert mode with fdm=indent
- helptags: Make multibyte help tags work properly
- highlight: Make CurSearch work properly with 'winhl'
- inccommand: Fix saving of undo info
- keycodes: Recognize <t_xx> as a key
- lsp: Do not assume client capability exists in watchfiles check (#24558)
- mouse: Handle folded lines with virt_lines attached to line above
- remote: Make --remote-expr print to stdout
- remote: Restore previous --remote-expr output formatting
- spell: Splice extmarks on :spellrepall
- startup: Don't truncate when printing with -l
- startup: Run embedded Nvim with real path
- statusline: Redraw when Visual submode changes
- statusline: Fill for double-width char after moving items
- treesitter: updates to queries and injections
- treesitter: Fix TSNode:tree() double free
- ui: Propagate line wrapping state on grid_line events
- ui: Avoid ambiguity about chunk that clears part of line

PERFORMANCE
- extmarks: Avoid unnecessary marktree traversal with folds
- substitute: Don't reallocate new_start every time

BUILD SYSTEM
- deps: Bump libvterm to 0.3.3
- deps: Bump LuaJIT to HEAD - 03c31124c
- deps: Bump libuv to v1.46.0
- deps: Bump Luv to 1.45.0-0
- deps: Bump tree-sitter-c to v0.20.5
- deps: Bump tree-sitter-lua to v0.0.18
2023-09-07 12:26:08 +02:00
3a13777289 Merge pull request #25022 from neovim/backport-25021-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1866: undo is synced after character find
2023-09-05 06:41:04 +08:00
4728f2d2f9 vim-patch:9.0.1866: undo is synced after character find
Problem:  Undo is synced after character find.
Solution: Set no_u_sync when calling gotchars_nop().

closes: vim/vim#13022
closes: vim/vim#13024

dccc29c228
(cherry picked from commit 311386c09f)
2023-09-04 22:26:12 +00:00
6490d937b2 Merge pull request #24999 from neovim/backport-24997-to-release-0.9
[Backport release-0.9] perf(substitute): don't reallocate new_start every time
2023-09-03 12:43:49 +08:00
bee2ee211c perf(substitute): don't reallocate new_start every time
(cherry picked from commit f5f35a7c18)
2023-09-03 04:33:16 +00:00
876cb05e2a Merge pull request #24995 from neovim/backport-24993-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1840: [security] use-after-free in do_ecmd
2023-09-03 11:27:11 +08:00
ed626d2f8f vim-patch:9.0.1840: [security] use-after-free in do_ecmd
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

e1dc9a6275

N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 2ffd8d98fa)
2023-09-03 03:16:02 +00:00
c23bff6603 Merge pull request #24984 from zeertzjq/backport
Backport to release-0.9
2023-09-02 19:20:56 +08:00
f54806fd7f fix(ui): avoid ambiguity about chunk that clears part of line
Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-02 18:58:59 +08:00
3c5339ba36 test(tui): add test for overriding argv[0] 2023-09-02 18:58:56 +08:00
40a7228dcc fix(startup): run embedded Nvim with real path 2023-09-02 18:58:52 +08:00
a285a0b36d fix(tui): v:argv does not report the original argv[0] 2023-09-02 18:58:30 +08:00
3ada031231 Revert "Revert "[Backport release-0.9] fix(ui): propagate line flags on grid_line events""
This reverts commit be14ead380.
2023-09-02 17:16:54 +08:00
be14ead380 Revert "[Backport release-0.9] fix(ui): propagate line flags on grid_line events" 2023-08-31 12:04:57 +08:00
fec20ce15c [Backport release-0.9] fix(filetype): make sure buffer is valid before call nvim_buf_call (#24950)
fix(filetype): make sure buffer is valid before call nvim_buf_call

(cherry picked from commit c3e611694e)

Co-authored-by: HongboLiu <lhbf@qq.com>
2023-08-30 12:21:01 -05:00
033059e781 Merge pull request #24923 from neovim/fix/ts-double-free
[backport release-0.9] fix(treesitter): fix TSNode:tree() double free
2023-08-29 18:20:46 +02:00
32de3f98ed fix(treesitter): fix another TSNode:tree() double free
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
2023-08-29 17:35:20 +02:00
a3c963adfc fix(treesitter): fix TSNode:tree() double free (#24796)
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.

Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
2023-08-29 10:51:44 +02:00
e3389c1533 build(deps): bump tree-sitter-lua to v0.0.18
also update highlight queries
2023-08-28 11:03:42 +09:00
f5e6f592b6 build(deps): bump tree-sitter-c to v0.20.5
also update highlight queries and test

fixup: tests
2023-08-28 11:03:42 +09:00
5ef7bc50cc build(deps): bump Luv to 1.45.0-0 2023-08-28 11:03:42 +09:00
eacd5ca6b8 build(deps): bump libuv to v1.46.0 2023-08-28 11:03:42 +09:00
a6226aea6c build(deps): bump LuaJIT to HEAD - 03c31124c
adapt to upstream build system changes (rolling release)
2023-08-28 11:03:42 +09:00
8ec03bbc8b Merge pull request #24907 from neovim/backport-24848-to-release-0.9
[Backport release-0.9] fix(editorconfig): only warn once on errors
2023-08-28 05:14:50 +08:00
3cca5449ac fix(editorconfig): only warn once on errors
(cherry picked from commit f3e8942ce2)
2023-08-27 21:04:32 +00:00
1fc72d3e62 Merge pull request #24906 from neovim/backport-24407-to-release-0.9
[Backport release-0.9] fix(editorconfig): highlight properties with dashes
2023-08-28 05:03:27 +08:00
2aa88ee86a feat(editorconfig): update Lua code in syntax file
(cherry picked from commit 5f29f7b59f)
2023-08-27 20:49:50 +00:00
2ac6405e80 fix(editorconfig): add metadata comment
(cherry picked from commit aa4900dff0)
2023-08-27 20:49:50 +00:00
96dc2d559b fix(editorconfig): highlight properties with dashes
(cherry picked from commit bcf91761bf)
2023-08-27 20:49:50 +00:00
40361818c1 Merge pull request #24905 from neovim/backport-23462-to-release-0.9
[Backport release-0.9] fix(editorconfig): add missing root validation
2023-08-28 04:47:25 +08:00
11cb728c35 fix(editorconfig): add missing root validation
(cherry picked from commit a94d35fcde)
2023-08-27 20:35:49 +00:00
62ae5f373a Merge pull request #24904 from neovim/backport-24871-to-release-0.9
[Backport release-0.9] fix(editorconfig): do not set 'endofline'
2023-08-28 04:27:52 +08:00
9f928902c7 fix(editorconfig): do not set 'endofline'
Problem:
  'endofline' can be used to detect if a file ends of <EOL>, however
  editorconfig can break this.

Solution:
  Set 'endofline' during BufWritePre

Fixes: #24869
(cherry picked from commit 84376afc72)
2023-08-27 20:13:39 +00:00
b30896bbaf Merge pull request #24885 from neovim/backport-24859-to-release-0.9
[Backport release-0.9] fix(statuscolumn): force full redraw when signcolumn is invalid
2023-08-26 21:25:21 +08:00
13c368eca5 fix(statuscolumn): force full redraw when signcolumn is invalid
Fix #24655

(cherry picked from commit 36108bfa11)
2023-08-26 13:10:44 +00:00
bb847a8b55 Merge pull request #24883 from neovim/backport-24879-to-release-0.9
[Backport release-0.9] fix(extmarks): wrong display when changing text with virt_lines
2023-08-26 19:53:06 +08:00
b353c27338 fix(extmarks): wrong display when changing text with virt_lines
(cherry picked from commit e3e74c363a)
2023-08-26 11:39:24 +00:00
46fc9d547c Merge pull request #24809 from neovim/backport-24806-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line
2023-08-21 07:28:42 +08:00
c083d7ac78 vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line
Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: vim/vim#12865

8fc6a1dae0
(cherry picked from commit 03e7d4fc85)
2023-08-20 23:18:57 +00:00
016b883def Merge pull request #24777 from neovim/backport-24776-to-release-0.9
[Backport release-0.9] fix(ui_compositor): only reset skipstart at first column
2023-08-18 12:18:44 +08:00
2a9af09187 fix(ui_compositor): only reset skipstart at first column
Problem:    A double-width char in a floating window causes an extra
            space to be drawn to the left of its boundary.
Solution:   Only reset skipstart at the first column.

Fix #24775

(cherry picked from commit 6b283f6e01)
2023-08-18 04:08:38 +00:00
167499d36f Merge pull request #24768 from neovim/backport-24767-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1734: :runtime completion fails for multiple args
2023-08-18 06:31:29 +08:00
35bc5d1af3 vim-patch:9.0.1734: :runtime completion fails for multiple args
Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: vim/vim#12616

be5cdd1d63
(cherry picked from commit cc9ba413a4)
2023-08-17 22:20:25 +00:00
7854874367 vim-patch:9.0.1714: getcompletion() "cmdline" fails after :autocmd
Problem:  getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().

closes: vim/vim#12804

e4c79d3615
(cherry picked from commit 05927f8058)
2023-08-16 06:35:54 +08:00
4d6d4f8fbe vim-patch:9.0.1708: getcompletion() failes for user-defined commands
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: vim/vim#12681
closes: vim/vim#12680

8ef1fbc0c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 5f546248f9)
2023-08-16 06:18:05 +08:00
021bed5ac2 Merge pull request #24701 from neovim/backport-24700-to-release-0.9
[Backport release-0.9] fix(keycodes): recognize <t_xx> as a key
2023-08-13 22:25:21 +08:00
931bcc8081 fix(keycodes): recognize <t_xx> as a key
Problem:    The result of keytrans() sometimes can't be translated back.
Solution:   Recognize <t_xx> as a key.
(cherry picked from commit 0284b15bd4)
2023-08-13 14:15:08 +00:00
392e0b56f0 docs: backport intro.txt changes to release-0.9 (#24698) 2023-08-13 21:18:01 +08:00
403d17b5b7 vim-patch:cd4e4e169ab3
.cirrus.yml: skip pkg update for FreeBSD 13.1 (vim/vim#12767)

cd4e4e169a

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-13 07:38:38 +08:00
b82ba25ba5 Merge pull request #24677 from neovim/backport-24676-to-release-0.9
[Backport release-0.9] fix(diff): filler lines for hunks bigger than linematch limit
2023-08-12 17:35:40 +08:00
52669b5c69 fix(diff): filler lines for hunks bigger than linematch limit
Apply linematch filler computation only if the hunk is actually
linematched.

Fixes #24580

(cherry picked from commit ed1da3ac24)
2023-08-12 09:14:54 +00:00
211db74a31 vim-patch:9.0.1694: wrong mapping applied when replaying a char search
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: vim/vim#12708
closes: vim/vim#6350

bacc83009b
(cherry picked from commit c3d853cb89)
2023-08-12 07:12:59 +08:00
79067685ab vim-patch:9.0.1687: mapset() not properly handling script ID
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: vim/vim#12699
closes: vim/vim#12697

7e0bae024d
(cherry picked from commit 526d2d40f6)
2023-08-12 07:02:07 +08:00
1cd08f242f Merge pull request #24649 from neovim/backport-24595
Backport #24595 to release-0.9
2023-08-10 18:50:39 +02:00
ac2dff64a5 fix(treesitter): make sure injections don't return empty ranges (#24595)
When an injection has not set include children, make sure not to add
the injection if no ranges are determined.

This could happen when there is an injection with a child that has the
same range as itself. e.g. consider this Makefile snippet

```make
foo:
  $(VAR)
```

Line 2 has an injection for bash and a make variable reference. If
include-children isn't set (default), then there is no range on line 2
to inject since the variable reference needs to be excluded.

This caused the language tree to return an empty range, which the parser
now interprets to mean the full buffer. This caused makefiles to have
completely broken highlighting.
2023-08-10 18:08:54 +02:00
bedd4bd746 Merge pull request #24576 from neovim/backport-24575-to-release-0.9
[Backport release-0.9] fix(inccommand): don't set an invalid 'undolevels' value
2023-08-05 22:56:47 +08:00
06ec1a49d7 fix(inccommand): don't set an invalid 'undolevels' value
Problem:    Cannot break undo by setting 'undolevels' to itself in
            'inccommand' preview callback.
Solution:   Don't set an invalid 'undolevels' value.

Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
(cherry picked from commit 7c5e7d831a)
2023-08-05 14:42:55 +00:00
df63474930 fix(lsp): do not assume client capability exists in watchfiles check (#24558)
Backports #24550.

Adjusts test to expect that didChangeWatchedFiles is *not* registered if
client `capabilities` is nil (as it's not enabled by default for v0.9).
2023-08-04 10:16:54 +01:00
5e6c8b3385 Merge pull request #24554 from zeertzjq/backport
Backport libvterm bump to release-0.9
2023-08-04 10:57:24 +08:00
9d1c8bc5c0 Merge pull request #24555 from neovim/backport-23224-to-release-0.9
[Backport release-0.9] refactor(env): remove unused mutex
2023-08-04 10:51:40 +08:00
e977f3dd4f refactor(env): remove unused mutex
This was needed when TUI was a thread.
lua code uses os_getenv only on the main thread.

(cherry picked from commit b773a52515)
2023-08-04 02:41:55 +00:00
060886e16c fix(terminal): forward horizontal mouse scrolling 2023-08-04 10:34:55 +08:00
241d649c23 build(deps): bump libvterm to 0.3.3
Fix #21106
2023-08-04 10:34:22 +08:00
f237c92076 Merge pull request #24551 from neovim/backport-24549-to-release-0.9
[Backport release-0.9] fix(terminal): include modifiers when forwarding mouse
2023-08-04 10:15:58 +08:00
90b1a3250a fix(terminal): include modifiers when forwarding mouse
(cherry picked from commit d7da156929)
2023-08-04 01:34:34 +00:00
ff689ed1a9 Merge pull request #24505 from zeertzjq/backport
Backport to release-0.9
2023-07-28 16:28:04 +08:00
f33d49a7a7 fix(inccommand): don't save information of a buffer twice
Problem:    'inccommand' doesn't restore 'undolevels' properly for a
            buffer shown in multiple windows.
Solution:   Don't save information of a buffer twice.
2023-07-28 16:09:15 +08:00
d0a6c1437d test: reduce flakiness
Avoid consecutive RPC requests involving :startinsert or :stopinsert,
because consecutive RPC requests may be processed together, before the
:startinsert or :stopinsert takes effect.

Also change some feed_command() to command() to make tests faster.
2023-07-28 15:57:57 +08:00
9f6fc24bcb test: check that TextChangedT cannot delete terminal buffer 2023-07-28 15:57:57 +08:00
c03d38c51d test: check real cursor position in Terminal mode 2023-07-28 15:57:57 +08:00
bde56f4e37 Merge pull request #24503 from zeertzjq/backport
Backport of #24289 and #24489 to release-0.9
2023-07-28 15:40:27 +08:00
1fdb41969f test(inccommand): add a test for #20248 2023-07-28 15:21:37 +08:00
1e905c52ca fix(inccommand): restrict cmdpreview undo calls
Problem:
The cmdpreview saved undo nodes on cmdpreview_prepare() from ex_getln.c may
become invalid (free) if the preview function makes undo operations, causing
heap-use-after-free errors.

Solution:
Save the buffer undo list on cmdpreview_prepare)_ and start a new empty one. On
cmdpreview_restore_state(), undo all the entries in the new undo list and
restore the original one. With this approach, the preview function will be
allowed to undo only its own changes.

Fix #20036
Fix #20248
2023-07-28 15:20:58 +08:00
b31b01cac2 Merge pull request #24486 from zeertzjq/backport
Backport to release-0.9
2023-07-26 03:09:27 +08:00
46301281f7 fix(folds): update folds in Insert mode with fdm=indent
Previously, when using foldmethod=indent, inserting an unindented line
would inadvertently open closed folds below it.
As a performance improvement, folds were only updated once, across all
lines, after Insert mode was exited.

Now, the performance improvement is no longer being used when
foldmethod=indent, so folds are updated multiple times during Insert
mode, but only across the lines that are changing, which preserves the
folds (and their open/close states) instead of recreating them.
2023-07-25 22:56:02 +08:00
d6733abc69 fix(ui-ext): backport win_viewport fixes to release-0.9 2023-07-25 22:56:02 +08:00
42a735e524 fix(startup): don't truncate when printing with -l 2023-07-25 22:56:02 +08:00
ada9443999 fix(mouse): handle folded lines with virt_lines attached to line above 2023-07-25 22:56:02 +08:00
69f11f6d26 fix(plines): folded lines with virt_lines attached to line above 2023-07-25 22:56:02 +08:00
badb6f4bc3 vim-patch:9.0.1607: screenpos() returns wrong row with diff filler lines
Problem:    screenpos() returns wrong row with diff filler lines.
Solution:   Only add filler lines when appropriate.  Also don't add the
            'smoothscroll' marker when w_skipcol is zero. (closes vim/vim#12485,
            closes vim/vim#12484)

55daae3921
2023-07-25 22:56:02 +08:00
0afec352da vim-patch:9.0.1600: screenpos() does not take w_skipcol into account
Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476)

f0e68c0e2a
2023-07-25 22:56:01 +08:00
1da1e5a4f3 Merge pull request #24484 from neovim/backport-24481-to-release-0.9
[Backport release-0.9] test(core/startup_spec): use retry() instead of jobwait()
2023-07-25 20:48:04 +08:00
dfed74188d [Backport release-0.9] fix(ui): delay win_viewport until screen update #24182 (#24480)
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-25 05:37:07 -07:00
d1a7aaa7f2 test(core/startup_spec): use retry() instead of jobwait()
This should work on Windows.

(cherry picked from commit 9ade0702b6)
2023-07-25 12:33:21 +00:00
76bbfb3cfd Merge pull request #24479 from neovim/backport-24477-to-release-0.9
[Backport release-0.9] fix(startup): make recovery mode work without --headless
2023-07-25 19:46:52 +08:00
11e90126ba fix(startup): make recovery mode work without --headless
(cherry picked from commit e483d95289)
2023-07-25 11:28:42 +00:00
aefacff567 Merge pull request #24478 from neovim/backport-23910-to-release-0.9
[Backport release-0.9] test(core/startup_spec): add a test for #13720
2023-07-25 19:23:32 +08:00
cba4362d85 test(core/startup_spec): add a test for #13720
(cherry picked from commit 3cd69055de)
2023-07-25 11:11:31 +00:00
8dd4a2bdd1 Merge pull request #24476 from neovim/backport-24425-to-release-0.9
[Backport release-0.9] fix(terminal): call validate_cursor to update the viewport
2023-07-25 11:44:24 +08:00
dc2860d821 fix(terminal): call validate_cursor to update the viewport
(cherry picked from commit 0f5f0dd07b)
2023-07-25 03:26:05 +00:00
78b39d510a Merge pull request #24463 from neovim/backport-24462-to-release-0.9
[Backport release-0.9] fix(mouse): drag vsep of window with 'statuscolumn'
2023-07-24 18:29:12 +08:00
16e690d595 fix(mouse): drag vsep of window with 'statuscolumn'
Problem:    Cannot drag a vertical separator to the right of a window
            whose 'statuscolumn' is wider than itself.
Solution:   Never treat a click on a vertical separator as a click on
            'statuscolumn'.
(cherry picked from commit c0007e6300)
2023-07-24 10:17:14 +00:00
740cb0c7dd Merge pull request #24460 from neovim/backport-24459-to-release-0.9
[Backport release-0.9] fix(statuscolumn): don't update clicks if current width is 0
2023-07-24 15:32:33 +08:00
48d5eaffcd fix(statuscolumn): don't update clicks if current width is 0
(cherry picked from commit f46241d8a8)
2023-07-24 07:18:44 +00:00
af1da51d11 Merge pull request #24449 from neovim/backport-24448-to-release-0.9
[Backport release-0.9] fix(highlight): make CurSearch work properly with 'winhl'
2023-07-23 21:56:01 +08:00
e2d14926d7 fix(highlight): make CurSearch work properly with 'winhl'
(cherry picked from commit 56d7627e1a)
2023-07-23 13:37:43 +00:00
a3889e743f Merge pull request #24439 from neovim/backport-24438-to-release-0.9
[Backport release-0.9] test: fix VimResume test flakiness
2023-07-23 10:14:06 +08:00
8ac7491685 test: fix VimResume test flakiness
(cherry picked from commit 95c3f8be68)
2023-07-23 02:03:28 +00:00
776a9b59b6 Merge pull request #24434 from neovim/backport-24426-to-release-0.9
[Backport release-0.9] fix(events): trigger VimResume on next UI request
2023-07-23 07:31:07 +08:00
e8ff921ed3 fix(events): trigger VimResume on next UI request
(cherry picked from commit cdd076d6c1)
2023-07-22 23:17:02 +00:00
d82f386201 Merge pull request #24419 from neovim/backport-24418-to-release-0.9
[Backport release-0.9] fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End
2023-07-22 08:12:45 +08:00
cf4b89f16b fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End
(cherry picked from commit fa898b6f92)
2023-07-22 00:01:01 +00:00
953904c006 Merge pull request #24384 from neovim/backport-23753-to-release-0.9
[Backport release-0.9] fix(fs.lua): normalize slash truncation
2023-07-18 14:46:07 +08:00
c0c6294123 fix(fs.lua): normalize slash truncation
Preserve last slash in windows' root drive directories

(cherry picked from commit 886996ff74)
2023-07-18 06:36:24 +00:00
b0abe426d6 Merge pull request #24379 from neovim/backport-24378-to-release-0.9
[Backport release-0.9] fix(terminal): don't send unknown special keys to terminal
2023-07-17 21:53:33 +08:00
115fe762b4 fix(terminal): don't send unknown special keys to terminal
Special keys are negative integers, so sending them to terminal leads to
strange behavior.

(cherry picked from commit 6b76fd9109)
2023-07-17 13:43:14 +00:00
f0e4d284fd Merge pull request #24370 from neovim/backport-23378-to-release-0.9
[Backport release-0.9] fix(clipboard): suppression exit warning if exit code is >= 128
2023-07-16 22:42:57 +08:00
65d9407835 clipboard: suppression exit warning if exit code is >= 128
This is a matching change to 939d9053bd

Fixes: 7054
(cherry picked from commit 62b5d66e43)
2023-07-16 14:24:57 +00:00
d3ac249806 Merge pull request #24358 from neovim/backport-24357-to-release-0.9
[Backport release-0.9] feat(tui): support Super and Meta modifiers
2023-07-15 15:13:46 +08:00
344bcb5f30 feat(tui): support Super and Meta modifiers
(cherry picked from commit 881835000d)
2023-07-15 07:03:21 +00:00
0bc272d0ea Merge pull request #24321 from neovim/backport-24320-to-release-0.9
[Backport release-0.9] fix(mouse): copy the line before syntax matching
2023-07-12 09:04:35 +08:00
7253cb3905 fix(mouse): copy the line before syntax matching
(cherry picked from commit 32e726e626)
2023-07-12 00:50:53 +00:00
9fdaecba90 Merge pull request #24318 from neovim/backport-24316-to-release-0.9
[Backport release-0.9] fix(tutor): don't use concealed text in expected lines
2023-07-11 18:20:51 +01:00
6808f47ec5 fix(tutor): don't use concealed text in expected lines
(cherry picked from commit 24c3962a2e)
2023-07-11 17:11:07 +00:00
e9030d109e Merge pull request #24307 from neovim/backport-24306-to-release-0.9
[Backport release-0.9] perf(extmarks): avoid unnecessary marktree traversal with folds
2023-07-11 09:09:20 +08:00
541439b4ab perf(extmarks): avoid unnecessary marktree traversal with folds
(cherry picked from commit 3fc4da17df)
2023-07-11 00:59:41 +00:00
160bdee527 Merge pull request #24298 from neovim/backport-24296-to-release-0.9
[Backport release-0.9] fix(completion): don't add backslashes to runtime pattern
2023-07-09 04:59:20 +08:00
84086283ac fix(completion): don't add backslash in runtime completion
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.
(cherry picked from commit 895cb173d2)
2023-07-08 15:29:44 +00:00
5174ed6735 Merge pull request #24269 from neovim/backport-24268-to-release-0.9
[Backport release-0.9] fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n
2023-07-06 11:18:07 +08:00
f36433f83a fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n
(cherry picked from commit 38bceb6269)
2023-07-06 03:07:43 +00:00
3fc024f238 Merge pull request #24259 from neovim/backport-24258-to-release-0.9
[Backport release-0.9] fix(edit): fix K_EVENT interfering with 'digraph'
2023-07-05 12:16:02 +08:00
1234861183 fix(edit): fix K_EVENT interfering with 'digraph'
(cherry picked from commit b08549eb69)
2023-07-05 04:06:37 +00:00
8fe351b674 Merge pull request #24245 from neovim/backport-24244-to-release-0.9
[Backport release-0.9] fix(api, lua): make blank lines in a message work properly
2023-07-04 07:32:09 +08:00
617c6014ea fix(api, lua): make blank lines in a message work properly
(cherry picked from commit e6bb22e691)
2023-07-03 23:19:26 +00:00
041bc87333 Merge pull request #24243 from neovim/backport-23891-to-release-0.9
[Backport release-0.9] fix(ui): propagate line flags on grid_line events
2023-07-04 05:26:33 +08:00
08ae485984 fix(ui): propagate line wrapping state on grid_line events
This fixes the TUI's line-wrapping behavior, which was broken with the
migration to the msgpack-based UI protocol (see
https://github.com/neovim/neovim/issues/7369#issuecomment-1571812273).

(cherry picked from commit 981acc2922)
2023-07-03 21:07:38 +00:00
3a6235cb81 Merge pull request #24217 from neovim/backport-24161-to-release-0.9
[Backport release-0.9] fix: always set arg0 to lua scripts
2023-07-01 08:31:02 +08:00
38af92ce39 fix: always set arg0 to lua scripts
Sets script's basename when no extra arguments are given

(cherry picked from commit bb9ee80a39)
2023-07-01 00:18:15 +00:00
04f6463ee2 Merge pull request #24211 from neovim/backport-24147-to-release-0.9
[Backport release-0.9] fix(ftplugin): respect runtimepath ordering
2023-06-30 18:32:27 +08:00
1f9c2cfa91 test(lua/runtime_spec): add test for ftplugin ordering
(cherry picked from commit 6cceef6d4c)
2023-06-30 10:22:24 +00:00
657072fc62 fix(ftplugin): respect runtimepath ordering
Problem: bundled `ftplugin/foo/*.vim` are sourced before user
`ftplugin/foo.vim`.

Solution: call `runtime!` once on all patterns to be sourced.

Followup to #23801. Fixes #24003.

(cherry picked from commit 502a7a0558)
2023-06-30 10:22:24 +00:00
f088b26ab1 Merge pull request #24208 from neovim/backport-24207-to-release-0.9
[Backport release-0.9] fix(statusline): fill for double-width char after moving items
2023-06-30 08:47:49 +08:00
072d0b796e fix(statusline): fill for double-width char after moving items
(cherry picked from commit 55fa460c0a)
2023-06-30 00:36:28 +00:00
4be7f29af6 Merge pull request #24201 from neovim/backport-24200-to-release-0.9
[Backport release-0.9] refactor: remove some casts to char *
2023-06-29 16:09:49 +08:00
914717aa8b refactor: remove some casts to char *
(cherry picked from commit ac26b66821)
2023-06-29 07:49:05 +00:00
e2ceb8dd47 Merge pull request #24199 from neovim/backport-24198-to-release-0.9
[Backport release-0.9] fix(column): handle unprintable chars in 'statuscolumn'
2023-06-29 11:48:11 +08:00
a830373860 fix(column): handle unprintable chars in 'statuscolumn'
(cherry picked from commit 4e206a6a41)
2023-06-29 03:38:15 +00:00
81290cda02 Merge pull request #24193 from neovim/backport-24190-to-release-0.9
[Backport release-0.9] fix(column): use maxwidth to allocate/fill 'statuscolumn' click defs
2023-06-29 06:12:14 +08:00
f81b85a0fa fix(column): use maxwidth to allocate/fill 'statuscolumn' click defs
(cherry picked from commit d9477a730b)
2023-06-28 21:16:23 +00:00
c8bd1d131f [Backport release-0.9] fix(api): nvim_cmd{cmd="win_getid"} parsed as :winsize (#24189)
fix(api): nvim_cmd{cmd="win_getid"} parsed as :winsize

Problem:
`:lua vim.cmd.win_getid(30,10)` is interpreted as `:win[size] 30 10`.
User intention was to call `vim.fn.win_getid(30,10)`.

Solution:
Check that the `cmd` actually matches the resolved command.

(cherry picked from commit 629f8d1e46)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-06-28 05:34:55 -07:00
213a5204ee Merge pull request #24160 from neovim/backport-24158-to-release-0.9
[Backport release-0.9] fix(charset): fix wrong display of 0xffff
2023-06-26 12:37:01 +08:00
54294140d7 fix(charset): fix wrong display of 0xffff
(cherry picked from commit fe3493679d)
2023-06-26 03:53:14 +00:00
e4945e69f7 Merge pull request #24125 from neovim/backport-24123-to-release-0.9
[Backport release-0.9] fix(cmdline): don't redraw 'tabline' in Ex mode
2023-06-23 07:11:03 +08:00
74c8878e9f fix(cmdline): don't redraw 'tabline' in Ex mode
Redrawing of 'statusline' and 'winbar' are actually already inhibited by
RedawingDisabled in Ex mode.

In Vim there is a check for `msg_scrolled == 0` (which is false in Ex
mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here
in Nvim instead.

(cherry picked from commit e056777a88)
2023-06-22 22:40:44 +00:00
b9a513ae11 [Backport release-0.9] fix(fs): make normalize() work with '/' path (#24060)
fix(fs): make `normalize()` work with '/' path

Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.

(cherry picked from commit 80ff66118a)

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-06-19 02:01:12 -07:00
d9a76056bb Merge pull request #24036 from neovim/backport-24034-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1636: expanding a pattern interferes with cmdline completion
2023-06-16 07:18:06 +08:00
6ed84f8571 vim-patch:9.0.1636: expanding a pattern interferes with cmdline completion
Problem:    Expanding a pattern interferes with command line completion.
Solution:   Set the file index only when appropriate. (closes vim/vim#12519)

094dd152fe
(cherry picked from commit a81b2b72c2)
2023-06-15 23:02:40 +00:00
0f121fea81 [Backport release-0.9] fix(codelens): add buffer and line checks before displaying codelens (#24014)
fix(codelens): add buffer and line checks before displaying codelens

(cherry picked from commit 928dc33053)

Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
2023-06-13 19:55:00 +02:00
db41f29b7c Merge pull request #24012 from neovim/backport-24010-to-release-0.9
[Backport release-0.9] fix(api): redundant error when using `nvim_cmd`
2023-06-13 21:54:13 +08:00
4c8376a876 fix(api): redundant error when using nvim_cmd
`nvim_cmd` shows multiple errors when attempting to edit another buffer
through a command when `curbuf->b_ro_locked` is set. This PR fixes that
by removing a redundant error in `execute_cmd`.

(cherry picked from commit 3e6af30888)
2023-06-13 13:43:45 +00:00
3d06b6c6af Merge pull request #23990 from neovim/backport-23988-to-release-0.9
[Backport release-0.9] fix(remote): restore previous --remote-expr output formatting
2023-06-11 22:26:37 +08:00
abed0acf56 fix(remote): restore previous --remote-expr output formatting
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.

(cherry picked from commit b6d89de60e)
2023-06-11 14:12:51 +00:00
2f9ee5eb16 Merge pull request #23982 from neovim/backport-23980-to-release-0.9
[Backport release-0.9] fix(remote): make --remote-expr print to stdout
2023-06-11 15:42:35 +08:00
4dafd5341a fix(remote): make --remote-expr print to stdout
(cherry picked from commit 54a05558e6)
2023-06-11 07:30:08 +00:00
adea8885c4 Merge pull request #23979 from neovim/backport-23975-to-release-0.9
[Backport release-0.9] fix(helptags): make multibyte help tags work properly
2023-06-11 12:37:17 +08:00
135cdd5ac0 fix(helptags): make multibyte help tags work properly
(cherry picked from commit 9b6702c370)
2023-06-11 04:23:32 +00:00
d182c1b526 Merge pull request #23974 from neovim/backport-23973-to-release-0.9
[Backport release-0.9] ci: add runner image version to cache key
2023-06-10 22:58:46 +08:00
3dae99d86a ci: add runner image version to cache key
This will ensure the cache isn't used when an image upgrade changes the
compiler version, causing the build to fail.

(cherry picked from commit dd6b6f185b)
2023-06-10 14:37:00 +00:00
470017c9a8 Merge pull request #23952 from neovim/backport-23951-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1616: quickfix text field is truncated
2023-06-08 09:08:25 +08:00
5825aec7ae vim-patch:9.0.1616: quickfix text field is truncated
Problem:    Quickfix text field is truncated.
Solution:   Fix output of text field after pattern field in quickfix buffer.
            (Shane Harper, closes vim/vim#12498)

5bf042810b

Co-authored-by: Shane Harper <shane@shaneharper.net>
(cherry picked from commit 8fe24cc428)
2023-06-07 23:03:42 +00:00
3904bf4906 Merge pull request #23944 from neovim/backport-23943-to-release-0.9
[Backport release-0.9] fix(events): don't expand non-file as file name
2023-06-07 10:29:08 +08:00
27c3e1d18f fix(events): don't expand non-file as file name
(cherry picked from commit dd24ea8195)
2023-06-07 02:17:40 +00:00
0bbd78aef1 revert: "refactor: eliminate autocmd_fname_full global"
This reverts commit 82cd0be2ea.

(cherry picked from commit 971049f318)
2023-06-07 02:17:40 +00:00
db33f17618 Merge pull request #23935 from neovim/backport-23933-to-release-0.9
[Backport release-0.9] fix(statusline): redraw when VIsual_mode changes
2023-06-06 19:40:46 +08:00
7e7fc4885f fix(statusline): redraw when VIsual_mode changes
(cherry picked from commit 397d861566)
2023-06-06 11:25:03 +00:00
55373061ab Merge pull request #23931 from neovim/backport-23929-to-release-0.9
[Backport release-0.9] fix(spell): splice extmarks on :spellrepall
2023-06-06 10:49:15 +08:00
79c8df7e97 fix(spell): splice extmarks on :spellrepall
(cherry picked from commit 22241639eb)
2023-06-06 02:32:51 +00:00
6937075304 Merge pull request #23923 from neovim/backport-23922-to-release-0.9
[Backport release-0.9] fix(editorconfig): check that buffer is valid
2023-06-06 06:24:10 +08:00
d7212c10e2 fix(editorconfig): check that buffer is valid
Fixes: https://github.com/neovim/neovim/issues/23921
(cherry picked from commit 1cf3184f95)
2023-06-05 16:53:33 +00:00
af1f4c7122 Merge pull request #23900 from neovim/backport-23899-to-release-0.9
[Backport release-0.9] fix(ui): don't send empty grid_line with redrawdebug=compositor
2023-06-04 10:58:37 +08:00
06d0985722 fix(ui): don't send empty grid_line with redrawdebug=compositor
(cherry picked from commit 12f2e47f2a)
2023-06-04 02:49:20 +00:00
b9e380fed9 Merge pull request #23883 from neovim/backport-23073-to-release-0.9
[Backport release-0.9] build: don't print installed files locally
2023-06-02 22:14:28 +08:00
d964aba20d build: don't print installed files locally
It takes a significant amount of time to install neovim, and doubly so
on Windows, due to the sheer amount of files neovim ships with. On CI
this information may be important though, so we enable it if the
CI_ENABLE option is set to ON.

(cherry picked from commit 85baadd3d5)
2023-06-02 14:01:36 +00:00
4892db22e2 fix(treesitter): remove incompatible c query (#23859)
`#has-parent?` and `#has-ancestor?` predicates were not backported
2023-06-02 11:53:40 +02:00
7ef651beaf Merge pull request #23881 from neovim/backport-23878-to-release-0.9
[Backport release-0.9] ci: remove ci/ from cache key
2023-06-02 17:40:15 +08:00
0db9169a52 ci: remove ci/ from cache key
The ci/ directory is now only used for Cirrus, not for GitHub Actions.

(cherry picked from commit d928079c81)
2023-06-02 09:39:00 +00:00
9078db9bbb Merge pull request #23874 from neovim/backport-23873-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1597: cursor ends up below the window after a put
2023-06-02 09:00:13 +08:00
0e39b334c0 vim-patch:9.0.1597: cursor ends up below the window after a put
Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes vim/vim#12465)

8509014add

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7a0726caee)
2023-06-02 00:49:10 +00:00
f9a615fb21 Merge pull request #23862 from neovim/backport-23854-to-release-0.9
[Backport release-0.9] fix(column): don't overflow sign column with extmark signs
2023-06-01 17:00:41 +08:00
022b5ba45d test(ui/decorations_spec): add local variable assert_alive 2023-06-01 16:34:18 +08:00
56c35faf8b fix(column): don't overflow sign column with extmark signs
(cherry picked from commit 24a6804528)
2023-06-01 08:20:53 +00:00
06d137681e [Backport release-0.9] ci(response): use pagination for timeline events (#23844)
ci(response): use pagination for timeline events

GitHub paginates responses with many results, which needs to be taken
into account as the number of events in an issue can be large.

(cherry picked from commit b5a8b6b16d)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-30 21:53:07 +02:00
4b79441b14 [Backport release-0.9] ci: replace stale bot with custom implementation (#23843)
ci: replace stale bot with custom implementation

The stale action has a bug where it won't close an issue/PR if it has
comments after the stale label.

(cherry picked from commit 5a97c0b0b9)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-30 21:51:29 +02:00
2113b9e4b0 [Backport release-0.9] ci: auto add label according title (#23842)
ci: add issue open check
2023-05-30 21:48:43 +02:00
6edd802840 Merge pull request #23841 from dundargoc/backport/token
ci: remove unnecessary token usage
2023-05-30 21:31:34 +02:00
1513666203 ci(labeler): add back GitHub token for type-scope
It is required by `gh pr edit`.
2023-05-30 21:30:45 +02:00
afdb5fa3cd ci: remove unnecessary token usage 2023-05-30 21:30:16 +02:00
cd73e54c42 ci: remove reviewdog for uncrustify (#23840)
Now that uncrustify is bundled it is no longer necessary.
2023-05-30 21:16:07 +02:00
0a954f41c4 ci: replace stylua action with our own lint target (#23838)
This will prevent situations where the linting works on CI but not
locally, at the cost of increased CI time.

Also manually ignore `runtime/vim/lua/re.lua`, as the .styluaignore
isn't respected when specifying a file instead of a directory.
2023-05-30 21:10:55 +02:00
8463161daa [Backport release-0.9] ci: update reviewers (#23837)
ci: update reviewers

(cherry picked from commit a647cfcbcb)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-30 20:42:49 +02:00
72209f4bf7 ci: remove team reviewers (#23836)
Team reviewers is a nice feature that comes with a severe drawback: it
makes testing the workflows incredibly difficult as they won't work
without a similar token by the tester.
2023-05-30 20:39:25 +02:00
2833230791 [Backport release-0.9] ci: use a set instead of array for team reviewers (#23835)
ci: use a set instead of array for team reviewers

Adding the same team multiple times will fails the review job.

(cherry picked from commit 4cb2b747c0)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-30 20:29:26 +02:00
09f97ff9a8 Merge pull request #23833 from neovim/backport-23626-to-release-0.9
[Backport release-0.9] ci: remove api-docs-check workflow
2023-05-30 19:34:04 +02:00
b257480955 ci: remove api-docs-check workflow
Having a workflow that creates a PR with the necessary changes on master
is redundant as this check is enforced for each PR anyway.

(cherry picked from commit c84e668242)
2023-05-30 17:32:39 +00:00
a4097be568 [Backport release-0.9] ci: simplify backport workflow (#23832)
ci: simplify backport workflow

(cherry picked from commit baebb30e36)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-30 18:37:31 +02:00
433ccdfc79 Merge pull request #23828 from neovim/backport-23823-to-release-0.9
[Backport release-0.9] fix(statusline): corrupted screen with minwid sign item in 'statuscolumn'
2023-05-30 21:24:43 +08:00
126a757c55 fix(column): corrupted screen with minwid sign item in 'statuscolumn'
(cherry picked from commit 2016ff6f37)
2023-05-30 12:56:36 +00:00
65fc17b343 Merge pull request #23815 from neovim/backport-23283-to-release-0.9
[Backport release-0.9] ci(release): clean up wording and undeprecate tar.gz
2023-05-29 19:56:54 +08:00
954cc51226 ci(release): clean up wording and undeprecate tar.gz
(cherry picked from commit 0357de7d72)
2023-05-29 11:41:11 +00:00
18fe3a6a44 version bump 2023-05-29 13:27:47 +02:00
7d4bba7aa7 NVIM 0.9.1
This is a maintenance release, consisting of bug fixes.

- checkhealth: Add shims for health functions (#23241)
- Add vim.lsp.buf.formatting_sync() to deprecated.txt
- treesitter: update parsers and queries
- api: Extmark highlight groups not always included in details
- api: Avoid assertion when autocmd group id is 0
- api: Don't change title when setting buffer in a window
- api: Nvim_get_hl should return default flag
- colorscheme: Try .lua files in 'rtp' before .vim files in 'pp'
- statuscolumn: fix issues when used with virt_lines and signs
- drawline: Make cursorlineopt=screenline work with resized grid
- eval: Prevent double-free in garbage collection
- extmarks: Don't show virt lines for end mark
- float: Make bufpos work properly with resized parent grid
- highlight: Add missing g: prefix for colors_name
- highlight: Combine ColorColumn with low-priority CursorLine
- highlight: Apply 'winblend' to NormalNC
- lua: Inspect_pos respect bufnr when get syntax info
- lua: Vim.split may trim inner empty items
- man.lua: Don't continue on command error
- man.lua: Return support of all sections
- mark: Properly init mark views
- messages: Ensure msg_grid is at top at more prompt
- mkspell: Prevent Unicode character overflow
- mouse: Cmdline click registered as statuscolumn
- mouse: Fix popup menu position check with winbar
- normal: Make "g$" work properly with resized grid
- pum: Show right-click menu above cmdline area
- pum: Position properly with multigrid and floats
- pum: Fix issues with with 'rightleft'
- redo: Make redo of Lua mappings in op-pending mode work
- redraw: Multibyte characters are wrapped at the end of a line
- redraw: Overwrite double-width char with virt_text properly
- ruler: Show ruler of curwin with no statusline in cmdline
- spell: Extmark with spell=false should disable spell
- statusline: Also allow right click when 'mousemodel' is "popup*"
- substitute: Properly check if preview is needed
- termdebug: Handle partial lines passed to callback
- tui: Position cursor at bottom-left before stopping
- tui: Redraw on SIGWINCH even if size didn't change
- tui: Grid_clear properly clears the screen
- tui: Fix title restore with title stack or altscreen
- ui: Send title to newly-attached UI
- windows: Set stdout to binary mode for --api-info
- windows: Revert installation context to per-machine
- build: Include all dependency directories when generating headers
2023-05-29 13:24:38 +02:00
c0137e711b Merge pull request #23810 from neovim/backport-23809-to-release-0.9
[Backport release-0.9] fix(substitute): properly check if preview is needed
2023-05-29 09:11:14 +08:00
a2bfe4e524 fix(substitute): properly check if preview is needed
(cherry picked from commit c8004af17d)
2023-05-29 00:45:14 +00:00
a1007597ca [Backport release-0.9] fix(ftplugin): source Lua files after Vimscript files per directory (#23805)
fix(ftplugin): source Lua files after Vimscript files per directory

Problem: Lua ftplugins in runtime take precedence over Vimscript
ftplugins in user configs (even in `after/`).
Solution: Source ftplugins separately per directory, first Vimscript
then Lua.

(cherry picked from commit d2e4386991)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-05-28 15:23:51 +02:00
b1f5be5338 Merge pull request #23798 from neovim/backport-23792-to-release-0.9
[Backport release-0.9] fix(extmarks): don't show virt lines for end mark
2023-05-28 17:32:28 +08:00
edf2a5aa25 fix(extmarks): don't show virt lines for end mark
(cherry picked from commit ffbf0cecb6)
2023-05-28 09:22:44 +00:00
e953f29c9b Merge pull request #23787 from neovim/backport-23785-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1582: :stopinsert may not work in a popup close handler
2023-05-27 22:25:47 +08:00
eaacdd059e vim-patch:9.0.1582: :stopinsert may not work in a popup close handler
Problem:    :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution:   Restore stop_insert_mode when appropriate. (closes vim/vim#12452,
            closes vim/vim#12434)

a40c0bcc83
(cherry picked from commit a9d6bc7082)
2023-05-27 14:15:41 +00:00
b5a66b1830 Merge pull request #23779 from neovim/backport-23727-to-release-0.9
[Backport release-0.9] fix(colorscheme): try .lua files in 'rtp' before .vim files in 'pp'
2023-05-27 11:14:44 +08:00
7556850724 fix(colorscheme): try .lua files in 'rtp' before .vim files in 'pp'
This ensures that colorschemes in 'rtp' are tried before ones in 'pp',
because some colorschemes in 'pp' may not work if not added to 'rtp'.

This also match the current documentation better.

(cherry picked from commit 237a6ed2ff)
2023-05-27 03:03:56 +00:00
68f967ce47 Merge pull request #23778 from neovim/backport-23776-to-release-0.9
[Backport release-0.9] fix(tui): restore title before exiting alternate screen
2023-05-27 10:30:39 +08:00
84542fc97f fix(tui): restore title before exiting alternate screen
Since title stack is now saved after entering alternate screen, it makes
more sense to restore title before exiting alternate screen.

(cherry picked from commit c5355072ae)
2023-05-27 02:14:09 +00:00
a090be56bd backport treesitter parser and queries (#23767) 2023-05-26 19:19:28 +02:00
3591252cc8 [Backport release-0.9] fix(tui): don't set tty background if &bg was set before VimEnter (#23766)
* fix(tui): don't set tty background if &bg was set before VimEnter

(cherry picked from commit 7d1b3c2b46)

* fix(tui): use nvim_get_option_info2 instead of &bg

(cherry picked from commit a60cfebdb9)

---------

Co-authored-by: Null Chilly <nullchilly@gmail.com>
2023-05-26 12:20:11 +02:00
ea5ebe509b Merge pull request #23765 from neovim/backport-23583-to-release-0.9
[Backport release-0.9] fix(ui-ext): send title to newly-attached UI
2023-05-26 17:40:21 +08:00
fdf33d9b00 Merge pull request #23764 from neovim/backport-23523-to-release-0.9
[Backport release-0.9] fix(windows): set stdout to binary mode for "--api-info"
2023-05-26 17:38:59 +08:00
86a1e79ee2 fix(ui-ext): send title to newly-attached UI
(cherry picked from commit 43d66c0ebb)
2023-05-26 09:30:18 +00:00
9e603ec3e1 fix(windows): set stdout to binary mode for --api-info
Problem:  --api-info output is binary.  Not setting the mode may cause
the OS to impose unexpected eof.  For Windows, it scatters extra '0d0a'
words in the output.

Solution:  On Windows, set stdout to binary mode for --api-info.

Fixes #20977

(cherry picked from commit 4bfc7802f0)
2023-05-26 09:23:41 +00:00
624c25a70a Merge pull request #23763 from neovim/backport-23760-to-release-0.9
[Backport release-0.9] fix(mkspell): prevent Unicode character overflow
2023-05-26 12:26:21 +08:00
b6ddf72bf1 fix(mkspell): prevent Unicode character overflow
introduced in: bd22585061
fixes #23758

(cherry picked from commit 007ce3a114)
2023-05-26 04:13:18 +00:00
a532f7d527 Merge pull request #23761 from neovim/backport-23466-to-release-0.9
[Backport release-0.9] vim-patch:9.0.{0138,0240}: two spell fixes
2023-05-26 11:55:34 +08:00
d0d9662ea1 vim-patch:9.0.0240: crash when using ":mkspell" with an empty .dic file
Problem:    Crash when using ":mkspell" with an empty .dic file.
Solution:   Check for an empty word tree.

6669de1b23

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7ddf235d7e)
2023-05-26 03:44:11 +00:00
d34d987070 vim-patch:9.0.0138: not enough characters accepted for 'spellfile'
Problem:    Not enough characters accepted for 'spellfile'.
Solution:   Add vim_is_fname_char() and use it for 'spellfile'.

bc49c5f48f

Cherry-pick related doc update from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7e70a1e44b)
2023-05-26 03:44:11 +00:00
c75cf9b64a Merge pull request #23718 from neovim/backport-23708-to-release-0.9
[Backport release-0.9] fix(redraw): overwrite double-width char with virt_text properly
2023-05-22 18:33:48 +08:00
ceba495e88 fix(redraw): overwrite double-width char with virt_text properly
(cherry picked from commit e998bada7c)
2023-05-22 10:23:08 +00:00
55138cdd8f Merge pull request #23716 from neovim/backport-23713-to-release-0.9
[Backport release-0.9] fix(highlight): remove unnecessary assignment to char_attr for 'spell'
2023-05-22 17:19:03 +08:00
cbe9351f8b fix(highlight): remove unnecessary assignment to char_attr for 'spell'
(cherry picked from commit 889e0df9dc)
2023-05-22 09:08:16 +00:00
8ace26ade7 Merge pull request #23715 from neovim/backport-23702-to-release-0.9
[Backport release-0.9] fix(api): nvim_get_hl should return default flag
2023-05-22 16:59:33 +08:00
2430e96da5 fix(api): nvim_get_hl should return default flag
(cherry picked from commit 5ba43c18e8)
2023-05-22 08:49:28 +00:00
2625d84577 Merge pull request #23700 from neovim/backport-23696-to-release-0.9
[Backport release-0.9] fix(redraw): multibyte characters are wrapped at the end of a line
2023-05-21 19:26:42 +08:00
a01f8de1f0 fix(redraw): multibyte characters are wrapped at the end of a line
Problem:    Multibyte characters may be wrapped at the end of a line
            when 'statuscolumn' and 'spell' are set.
Solution:   Update line pointerdiff "v" before fetching the line pointer
            after evaluating 'statuscolumn'.
(cherry picked from commit 5fa5fff184)
2023-05-21 11:00:55 +00:00
c8d6d14f71 [Backport release-0.9] fix(treesitter): allow foldexpr without highlights (#23673)
fix(treesitter): allow foldexpr without highlights (#23672)

Ref nvim-treesitter/nvim-treesitter#4748

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-21 11:36:18 +02:00
2be8c29406 [Backport release-0.9] fix(lsp): don't register didChangeWatchedFiles when capability not set (#23690)
fix(lsp): don't register didChangeWatchedFiles when capability not set

Some LSP servers (tailwindcss, rome) are known to request registration
for `workspace/didChangeWatchedFiles` even when the corresponding client
capability does not advertise support. This change adds an extra check
in the `client/registerCapability` handler not to start a watch unless
the client capability is set appropriately.

(cherry picked from commit 78510add5b)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-05-20 08:01:52 +02:00
d5ac60c093 Merge pull request #23679 from neovim/backport-23585-to-release-0.9
[Backport release-0.9] fix(tui): make disabling title restore old title from stack
2023-05-19 07:44:32 +08:00
3ea6c5e7ba fix(tui): make disabling title restore old title from stack
This makes setting 'notitle' in Nvim behave more like Vim in terminals
that support title stacking.

(cherry picked from commit c0bce603d3)
2023-05-18 23:30:42 +00:00
59e63b455b Merge pull request #23663 from neovim/backport-23584-to-release-0.9
[Backport release-0.9] fix(messages): ensure msg_grid is at top at more prompt
2023-05-17 21:51:48 +08:00
87c44c7a0b fix(messages): ensure msg_grid is at top at more prompt
(cherry picked from commit 5b9d1a972b)
2023-05-17 13:06:46 +00:00
626e2277a9 Merge pull request #23633 from neovim/backport-23631-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1555: setcharsearch() does not clear last searched char properly
2023-05-15 08:14:28 +08:00
f3c7182482 vim-patch:9.0.1555: setcharsearch() does not clear last searched char properly
Problem:    setcharsearch() does not clear last searched char properly.
Solution:   Do not accept lastc_bytelen smaller than one. (closes vim/vim#12398)

e5d91ba1de
(cherry picked from commit 8a751ca360)
2023-05-15 00:04:41 +00:00
6f7e5ce006 Merge pull request #23582 from neovim/backport-23557-to-release-0.9
[Backport release-0.9] test: move most title tests to a separate file
2023-05-11 11:54:59 +08:00
ae7db749b5 test: move most title tests to a separate file
This avoids running title tests twice unnecessarily.

(cherry picked from commit b6199f667b)
2023-05-11 02:58:36 +00:00
9b90f5fa28 Merge pull request #23580 from neovim/backport-23492-to-release-0.9
[Backport release-0.9] fix(api): don't change title when setting buffer in a window
2023-05-11 10:56:14 +08:00
e019371554 fix(api): don't change title when setting buffer in a window
(cherry picked from commit f2d97a3842)
2023-05-11 02:38:43 +00:00
35997026a2 Merge pull request #23573 from neovim/backport-23555-to-release-0.9
[Backport release-0.9] fix(highlight): apply 'winblend' to NormalNC
2023-05-11 00:02:06 +08:00
4e0cfe3805 fix(highlight): apply 'winblend' to NormalNC
(cherry picked from commit e33790d0f6)
2023-05-10 15:50:26 +00:00
31a009c883 Merge pull request #23568 from neovim/backport-23566-to-release-0.9
[Backport release-0.9] fix(redo): make redo of Lua mappings in op-pending mode work
2023-05-10 18:11:02 +08:00
06bee06ee5 fix(redo): make redo of Lua mappings in op-pending mode work
(cherry picked from commit 5e9ef7b95b)
2023-05-10 09:51:31 +00:00
9652f7c4c9 Merge pull request #23564 from neovim/backport-23175-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1464: strace filetype detection is expensive
2023-05-10 15:21:05 +08:00
17bdaeb79e vim-patch:9.0.1464: strace filetype detection is expensive
Problem:    Strace filetype detection is expensive.
Solution:   Match with a cheap pattern first. (Federico Mengozzi,
            closes vim/vim#12220)

6e5a9f9482

Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com>
(cherry picked from commit 9808866d57)
2023-05-10 07:05:51 +00:00
4d30f34a37 Merge pull request #23562 from neovim/backport-23428-to-release-0.9
[Backport release-0.9] fix(tui): grid_clear properly clears the screen
2023-05-10 07:12:23 +08:00
59ee42d05e fix(tui): grid_clear properly clears the screen
Problem:    When setting a shell size smaller than the containing
            terminal window through `:winsize` or `:set lines/columns`
            the screen is not properly cleared.
Solution:   Clear the tui dimensions rather than the grid dimensions.
(cherry picked from commit 197827321a)
2023-05-09 19:29:14 +00:00
1a104253df [Backport release-0.9] fix(lsp): fix relative patterns for workspace/didChangeWatchedFiles (#23559)
fix(lsp): fix relative patterns for `workspace/didChangeWatchedFiles`

(cherry picked from commit 10f102a3a3)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-05-09 18:23:22 +02:00
ac93bd3817 [Backport release-0.9] build: add luajit runtime files when installing (#23556)
build: add luajit runtime files when installing

Closes https://github.com/neovim/neovim/issues/15543.

(cherry picked from commit 36c4a58acf)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-05-09 17:28:33 +02:00
c0c95bc823 Merge pull request #23537 from neovim/backport-23535-to-release-0.9
[Backport release-0.9] fix(statusline): bail out properly on negative row
2023-05-08 16:44:03 +08:00
152c07249e fix(statusline): bail out properly on negative row
(cherry picked from commit 89274f9221)
2023-05-08 08:25:22 +00:00
8f2b0d9b5d Merge pull request #23536 from neovim/backport-23486-to-release-0.9
[Backport release-0.9] fix(man.lua): return support of all sections
2023-05-08 16:19:59 +08:00
bdb7c180b7 test: add more tests for :Man section extraction
(cherry picked from commit 3001d86aea)
2023-05-08 08:09:54 +00:00
965f817ade fix(man.lua): return support of all sections
Current behaviour of `:Man` is to only work with "number" sections.
This is caused by wrong assumptions about man sections naming.

Also, there was similar assumption about length of section dirs
in `paths` variable.

fixes #23485

Signed-off-by: Vadim Misbakh-Soloviov <git@mva.name>
(cherry picked from commit 209ed16f57)
2023-05-08 08:09:54 +00:00
9ea3a9c15b build: point deps urls to deps repo (#23506)
This is a manual backport of https://github.com/neovim/neovim/pull/23502
and https://github.com/neovim/neovim/pull/23494.
2023-05-06 18:24:49 +02:00
c3d11208bc [Backport release-0.9] perf(lsp): load buffer contents once when processing semantic tokens responses (#23505)
perf(lsp): load buffer contents once when processing semantic token responses

Using _get_line_byte_from_position() for each token's boundaries was a
pretty huge bottleneck, since that function would load individual buffer
lines via nvim_buf_get_lines() (plus a lot of extra overhead). So each
token caused two calls to nvim_buf_get_lines() (once for the start
position, and once for the end position).

For semantic tokens, we only attach to buffers that have already been
loaded, so we can safely just get all the lines for the entire buffer at
once, and lift the rest of the _get_line_byte_from_position()
implementation directly while bypassing the part that loads the buffer
line.

While I was looking at get_lines (used by _get_line_byte_from_position),
I noticed that we were checking for non-file URIs before we even looked
to see if we already had the buffer loaded. Moving the buffer-loaded
check to be the first thing done in get_lines() more than halved the
average time spent transforming the token list into highlight ranges vs
when it was still using _get_line_byte_from_position. I ended up
improving that loop more by not using get_lines, but figured the
performance improvement it provided was worth leaving in.

(cherry picked from commit dc38eafab5)

Co-authored-by: John Drouhard <john@drouhard.dev>
2023-05-06 12:10:49 +02:00
fe261706a2 [Backport release-0.9] perf(treesitter): insert/remove items efficiently (#23504)
perf(treesitter): insert/remove items efficiently

(cherry picked from commit c8fdc57b88)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-06 12:10:35 +02:00
592e4459fa Merge pull request #23503 from neovim/backport-23415-to-release-0.9
[Backport release-0.9] fix(tui): redraw on SIGWINCH even if size didn't change
2023-05-06 18:00:22 +08:00
1b09bcef52 [Backport release-0.9] fix(treesitter): redraw added/removed injections properly (#23408)
fix(treesitter): redraw added/removed injections properly

When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed

(cherry picked from commit b68157834a)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-06 11:55:51 +02:00
c464df84f7 fix(tui): redraw on SIGWINCH even if size didn't change
(cherry picked from commit 0f1b511f23)
2023-05-06 09:48:54 +00:00
13d8cca951 Merge pull request #23479 from dundargoc/backport
ci: make all linux releases work with same glibc version
2023-05-04 17:17:46 +02:00
9edddceb18 ci: make all linux releases work with same glibc version 2023-05-04 17:12:11 +02:00
7c48810397 Merge pull request #23457 from neovim/backport-23456-to-release-0.9
[Backport release-0.9] fix(mouse): fix popup menu position check with winbar
2023-05-03 11:10:56 +08:00
fb56d2a452 Merge pull request #23458 from neovim/backport-23002-to-release-0.9
[Backport release-0.9] test(lsp_spec): fix unstable tests for set_defaults
2023-05-03 10:59:02 +08:00
106695d47e test(lsp_spec): fix unstable tests for set_defaults
In the `test_rpc_server` procedure, both `on_setup` and `on_init`
callbacks can run concurrently in some scenarios. This caused some CI
failures in tests for the LSP set_defaults feature.

This commit attempts to fix this by merging those two callbacks in the
impacted tests.

See: https://github.com/neovim/neovim/actions/runs/4553550710/attempts/1
(cherry picked from commit c2f5159987)
2023-05-03 02:43:23 +00:00
56e0b425ea fix(mouse): fix popup menu position check with winbar
(cherry picked from commit e37fb2515d)
2023-05-03 02:29:39 +00:00
017afa2fcf Merge pull request #23452 from neovim/backport-23442-to-release-0.9
[Backport release-0.9] fix(pum): don't position too far with resized parent grid
2023-05-03 06:29:20 +08:00
61351adee8 fix(pum): don't position too far with resized parent grid
(cherry picked from commit 1fa6482faf)
2023-05-02 22:18:12 +00:00
7dfddb3e43 Merge pull request #23449 from neovim/backport-23448-to-release-0.9
[Backport release-0.9] fix(pum): fix missing scrollbar with 'rightleft'
2023-05-03 06:14:35 +08:00
5fbe8409b5 fix(pum): fix missing scrollbar with 'rightleft'
(cherry picked from commit 3d1a9eeb1b)
2023-05-02 17:13:23 +00:00
4d1d9472fe Merge pull request #23447 from neovim/backport-23445-to-release-0.9
[Backport release-0.9] fix(pum): fix missing rightmost column with 'rightleft'
2023-05-03 00:06:09 +08:00
bbf600b7b5 fix(pum): fix missing rightmost column with 'rightleft'
(cherry picked from commit 97ac7e10c6)
2023-05-02 15:55:42 +00:00
76dd0f81b0 [Backport release-0.9] fix(treesitter): do not calc folds on unloaded buffers (#23440)
fix(treesitter): do not calc folds on unloaded buffers

Fixes #23423

(cherry picked from commit 2e08228a16)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-02 11:23:45 +01:00
607237a20a Merge pull request #23438 from neovim/backport-23436-to-release-0.9
[Backport release-0.9] fix(mouse): fix popup_setpos position check with ext_multigrid
2023-05-02 15:36:20 +08:00
5267e7b07a fix(mouse): fix popup_setpos position check with ext_multigrid
(cherry picked from commit 50f6609032)
2023-05-02 07:25:59 +00:00
49092de818 Merge pull request #23435 from neovim/backport-23430-to-release-0.9
[Backport release-0.9] Fix bugs with ext_multigrid resized grid
2023-05-02 12:38:53 +08:00
20f5f4e916 fix(normal): make "g$" work properly with resized grid
(cherry picked from commit 088cdf69e3)
2023-05-02 04:28:44 +00:00
5b158b9375 fix(drawline): make cursorlineopt=screenline work with resized grid
(cherry picked from commit 37b73cf14b)
2023-05-02 04:28:43 +00:00
c693df02b3 fix(float): make bufpos work properly with resized parent grid
(cherry picked from commit 03e8b5fc91)
2023-05-02 04:28:43 +00:00
beaa29d70e Merge pull request #23434 from neovim/backport-23352-to-release-0.9
[Backport release-0.9] fix(pum): make :popup position correctly with float border
2023-05-02 12:13:26 +08:00
11a0fc9644 vim-patch:9.0.1493: popup menu position wrong in window with toolbar
Problem:    Popup menu position wrong in window with toolbar.
Solution:   Take the window toolbar into account when positioning the popup
            menu. (closes vim/vim#12308)

4e1ca0d9a6

Fixed in the previous commit. Test only.

(cherry picked from commit aca226d728)
2023-05-02 03:59:44 +00:00
756b74758d fix(pum): make :popup position correctly with float border
(cherry picked from commit fbaa278773)
2023-05-02 03:59:44 +00:00
3563f4b623 Merge pull request #23433 from neovim/backport-23336-to-release-0.9
[Backport release-0.9] fix(pum): position properly with ext_multigrid
2023-05-02 11:57:56 +08:00
f5cf033314 fix(pum): position properly with ext_multigrid
(cherry picked from commit 239d19d908)
2023-05-02 03:46:37 +00:00
7a9624f035 Merge pull request #23432 from neovim/backport-23298-to-release-0.9
[Backport release-0.9] fix(pum): show right-click menu above cmdline area
2023-05-02 11:45:55 +08:00
5c30930fec fix(pum): show right-click menu above cmdline area
(cherry picked from commit 1d7172e925)
2023-05-02 03:36:07 +00:00
3754d833ec Merge pull request #23431 from neovim/backport-23265-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1476: lines put in non-current window are not displayed
2023-05-02 11:33:26 +08:00
b8b1221e58 vim-patch:9.0.1476: lines put in non-current window are not displayed
Problem:    Lines put in non-current window are not displayed. (Marius
            Gedminas)
Solution:   Don't increment the topline when inserting just above it.
            (closes vim/vim#12212)

e7f05a8780

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 60f21d96c6)
2023-05-02 03:21:00 +00:00
f77b2740ee [Backport release-0.9] docs(lsp): remove vim.lsp.sync (#23419)
docs(lsp): remove vim.lsp.sync

The module is used internally and not intended to be used by plugins or
users.

(cherry picked from commit 02d5a678fb)

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-05-01 11:51:30 +02:00
98a90abca9 [Backport release-0.9] perf(lsp): process semantic tokens response in a coroutine that yields every 5ms (#23414)
perf(lsp): process semantic tokens response in a coroutine that yields every 5ms

(cherry picked from commit 46cd1d957c)

Co-authored-by: John Drouhard <john@drouhard.dev>
2023-05-01 07:27:44 +02:00
fc2822a819 Merge pull request #23413 from neovim/backport-23400-to-release-0.9
[Backport release-0.9] fix(spell): extmark with spell=false should disable spell
2023-05-01 12:41:06 +08:00
b8d0a2d2b2 fix(spell): extmark with spell=false should disable spell
(cherry picked from commit 6d47d77449)
2023-05-01 04:31:14 +00:00
e81b2eb94a Merge pull request #23372 from neovim/backport-23371-to-release-0.9
[Backport release-0.9] vim-patch:8.2.3509: undo file is not synced
2023-04-28 21:24:15 +08:00
5c2f442a74 vim-patch:8.2.3509: undo file is not synced
Problem:    Undo file is not synced. (Sami Farin)
Solution:   Sync the undo file if 'fsync' is set. (Christian Brabandt,
            closes vim/vim#8879, closes vim/vim#8920)

340dd0fbe4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit ff5b103ac7)
2023-04-28 13:07:22 +00:00
fb73bfd667 [Backport release-0.9] fix(tui): position cursor at bottom-left before stopping 2023-04-28 20:53:11 +08:00
6a8d1bb90b fix(tui): position cursor at bottom-left before stopping
Fix #23361
2023-04-28 20:30:01 +08:00
feb8134b43 Merge pull request #23359 from neovim/backport-23358-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1494: crash when recovering from corrupted swap file
2023-04-28 09:23:22 +08:00
d926f92ba1 vim-patch:9.0.1494: crash when recovering from corrupted swap file
Problem:    Crash when recovering from corrupted swap file.
Solution:   Bail out when the line index looks wrong. (closes vim/vim#12276)

bf1b713202

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 21136d49dd)
2023-04-27 22:28:12 +00:00
66a196c951 Merge pull request #23334 from neovim/backport-23333-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split
2023-04-27 09:18:52 +08:00
d366a1f8ed vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split
Problem:    Wrong scrolling with ls=0 and :botright split.
Solution:   Add statusline before calling frame_new_height(). (closes vim/vim#12299)

fbf2071ac9
(cherry picked from commit fa38c7ce4d)
2023-04-27 01:07:50 +00:00
53d29a8b62 Merge pull request #23332 from neovim/backport-23305-to-release-0.9
[Backport release-0.9] refactor: remove unnecessary height change in frame_add_hsep()
2023-04-27 08:20:06 +08:00
26aa39f80c refactor: remove unnecessary height change in frame_add_hsep()
This height change is wrong, and the height will be overwritten later by
another height change.

(cherry picked from commit 0a4ea7eb55)
2023-04-27 00:04:20 +00:00
a8c62d3024 Merge pull request #23328 from neovim/backport-23288-to-release-0.9
[Backport release-0.9] fix(normal): fix repeated trigger modechanged for scheduled callback
2023-04-27 00:35:01 +08:00
c236e674ce test: scheduled callback shouldn't trigger ModeChanged repeatedly
(cherry picked from commit a35bca2112)
2023-04-26 16:24:00 +00:00
0874a14dcf vim-patch:9.0.1490: the ModeChanged event may be triggered too often
Problem:    The ModeChanged event may be triggered too often.
Solution:   Only trigger ModeChanged when no operator is pending.
            (closes vim/vim#12298)

73916bac5a
(cherry picked from commit e0d6703a6a)
2023-04-26 16:24:00 +00:00
4bc50de152 fixup: remove trailing space 2023-04-25 14:05:57 +08:00
a7578a873c revert: "fix(ui_client): check return code of dup()"
This reverts commit c0845343b6.
2023-04-25 14:04:39 +08:00
af6669cd35 Merge pull request #23304 from neovim/backport-23258-to-release-0.9
[Backport release-0.9] fix(statusline): also allow right click when 'mousemodel' is "popup*"
2023-04-25 11:18:42 +08:00
f24449d35c fix(statusline): also allow right click when 'mousemodel' is "popup*"
Problem:    The 'statusline'-format ui elements do not receive right
            click events when "mousemodel" is "popup*"
Solution:   Do not draw popupmenu and handle click event instead.
(cherry picked from commit 6b5b6e5e07)
2023-04-25 03:05:22 +00:00
0c8e2d128e Merge pull request #23300 from neovim/backport-23296-to-release-0.9
[Backport release-0.9] fix(column): don't reset 'statuscolumn' width after it has been drawn
2023-04-24 22:36:40 +08:00
f991ddd1ab fix(column): don't reset 'statuscolumn' width after it has been drawn
Problem:     'statuscolumn' width may be reset after it has been drawn
              when multiple windows contain the same buffer. This results
              in an offset for the drawn cursor position.
Solution:     Loop over all windows (twice) prior to drawing them to
              reset the 'statuscolumn' width and validate the sign
              column when necessary.
(cherry picked from commit 89f9921a9e)
2023-04-24 14:22:31 +00:00
a977c8b5fe Merge pull request #23299 from neovim/backport-23252-to-release-0.9
[Backport release-0.9] build: include all dependency directories when generating headers
2023-04-24 17:48:35 +08:00
f5bf29a0ad build: include all dependency directories when generating headers
This will add all interface include directories property from all
targets to main_lib. This may not be universally wanted, in which case
we can revisit/rework it.

Closes https://github.com/neovim/neovim/issues/23237.

(cherry picked from commit 096e91b988)
2023-04-24 07:48:11 +00:00
deec5e6e2a Merge pull request #23277 from neovim/backport-23267-to-release-0.9
[Backport release-0.9] test(lsp): fix unstable tests for semantic tokens
2023-04-23 10:21:09 +08:00
d6deffad57 test(lsp): fix unstable tests for semantic tokens
add screen:expect() calls after insert() to make sure the screen has
been drawn before we assert the state of the semantic tokens table

(cherry picked from commit e97b6536bb)
2023-04-23 02:02:04 +00:00
d7b720f3d8 Merge pull request #23276 from neovim/backport-23210-to-release-0.9
[Backport release-0.9] fix(api): avoid assertion when autocmd group id is 0
2023-04-23 09:37:00 +08:00
39ae0a0b7a fix(api): avoid assertion when autocmd group id is 0
(cherry picked from commit 3a35d7c0e8)
2023-04-23 01:23:48 +00:00
f960f2621d Merge pull request #23274 from neovim/backport-23273-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1477: crash when recovering from corrupted swap file
2023-04-23 08:36:30 +08:00
e937b9a9c7 vim-patch:9.0.1477: crash when recovering from corrupted swap file
Problem:    Crash when recovering from corrupted swap file.
Solution:   Check for a valid page count. (closes vim/vim#12275)

b67ba03d3e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit dcb6b5c62d)
2023-04-23 00:24:29 +00:00
c52085997b Merge pull request #23248 from neovim/backport-23234-to-release-0.9
[Backport release-0.9] fix(lua): vim.split may trim inner empty items
2023-04-21 10:20:01 -04:00
127a483142 refactor(lua): simplify vim.gsplit impl
(cherry picked from commit 824766612d)
2023-04-21 12:05:39 +00:00
2363d44d5a fix(lua): vim.split may trim inner empty items
Problem:
`vim.split('a:::', ':', {trimempty=true})` trims inner empty items.
Regression from 9c49c10470

Solution:
Set `empty_start=false` when first non-empty item is found.
close #23212

(cherry picked from commit 622b1ae38a)
2023-04-21 12:05:39 +00:00
5cb6c44e30 Merge pull request #23246 from zeertzjq/backport-23225-to-release-0.9
[Backport release-0.9] fix(usercmd): fix buffer overflow in uc_list()
2023-04-21 19:52:23 +08:00
df3982e704 feat(checkhealth): add shims for health functions (#23241)
This is for plugins wanting to support many versions of neovim.
2023-04-21 13:39:03 +02:00
30cfd28257 fix(usercmd): fix buffer overflow in uc_list()
Build with: -Wp,-D_FORTIFY_SOURCE=3 -O1 and gcc 13.

*** buffer overflow detected ***: terminated

(gdb) bt
  #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
  #1  0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
  #2  0x00007f3eb8b42aee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  #3  0x00007f3eb8b2b87f in __GI_abort () at abort.c:79
  #4  0x00007f3eb8b2c60f in __libc_message (fmt=fmt@entry=0x7f3eb8ca72e6 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:150
  #5  0x00007f3eb8c27b29 in __GI___fortify_fail (msg=msg@entry=0x7f3eb8ca728c "buffer overflow detected") at fortify_fail.c:24
  #6  0x00007f3eb8c26364 in __GI___chk_fail () at chk_fail.c:28
  #7  0x00007f3eb8c25f45 in ___snprintf_chk (s=s@entry=0x55b8c7c096a5 <IObuff+5> "t' item", maxlen=maxlen@entry=1025, flag=flag@entry=2, slen=slen@entry=1020, format=format@entry=0x55b8c7b872a6 "%ldc") at snprintf_chk.c:29
  #8  0x000055b8c7aea59f in snprintf (__fmt=0x55b8c7b872a6 "%ldc", __n=1025, __s=0x55b8c7c096a5 <IObuff+5> "t' item") at /usr/include/bits/stdio2.h:54
  #9  uc_list (name=name@entry=0x55b8c8351788 "Explore", name_len=name_len@entry=7) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:534
  #10 0x000055b8c7aeb8a0 in ex_command (eap=0x7fffdc350e60) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:1009
  #11 0x000055b8c7972537 in execute_cmd0 (retv=retv@entry=0x7fffdc350e54, eap=eap@entry=0x7fffdc350e60, errormsg=errormsg@entry=0x7fffdc350e58, preview=preview@entry=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:1620
  #12 0x000055b8c7975c55 in do_one_cmd (cmdlinep=cmdlinep@entry=0x7fffdc3510b8, flags=flags@entry=0, cstack=cstack@entry=0x7fffdc351140, fgetline=fgetline@entry=0x55b8c79882b8 <getexline>, cookie=cookie@entry=0x0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:2279
  #13 0x000055b8c79767fe in do_cmdline (cmdline=<optimized out>, fgetline=0x55b8c79882b8 <getexline>, cookie=0x0, flags=0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:578
  #14 0x000055b8c7a17463 in nv_colon (cap=0x7fffdc351780) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:3228
  #15 0x000055b8c7a11b35 in normal_execute (state=0x7fffdc351700, key=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:1196
  #16 0x000055b8c7ab0994 in state_enter (s=0x7fffdc351700) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/state.c:99
  #17 0x000055b8c7a0ef68 in normal_enter (cmdwin=false, noexmode=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:497
  #18 0x000055b8c78a0640 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641
2023-04-21 19:25:37 +08:00
1085e91876 Merge pull request #23245 from neovim/backport-23239-to-release-0.9
[Backport release-0.9] Fix compiler warnings detected by gcc 13
2023-04-21 19:15:55 +08:00
c0845343b6 fix(ui_client): check return code of dup()
gsrc/nvim/ui_client.c: In function ‘ui_client_start_server’:
gsrc/nvim/ui_client.c:68:5: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |     dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 4d654472e6)
2023-04-21 11:06:22 +00:00
a99d5d17d5 fix(statusline): fix uninitialized variable and possible overflow
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/statusline.c:10:
In function ‘strcat’,
    inlined from ‘build_stl_str_hl’ at gsrc/nvim/statusline.c:1688:9:
/usr/include/bits/string_fortified.h:130:10: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized]
  130 |   return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 54f5602038)
2023-04-21 11:06:22 +00:00
a77a8a9934 fix(linematch): initialize array
gsrc/nvim/linematch.c: In function ‘try_possible_paths’:
gsrc/nvim/linematch.c:204:35: warning: ‘from_vals’ may be used uninitialized [-Wmaybe-uninitialized]
  204 |       size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit f5530bf566)
2023-04-21 11:06:22 +00:00
6b32fe96b0 fix(ex_getln): initialize pointer with NULL
In function ‘cmdpreview_open_win’,
    inlined from ‘cmdpreview_may_show’ at gsrc/nvim/ex_getln.c:2487:28:
gsrc/nvim/ex_getln.c:2251:16: warning: ‘cmdpreview_buf’ may be used uninitialized [-Wmaybe-uninitialized]
 2251 |   int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, cmdpreview_buf->handle, 0);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit a114a21eff)
2023-04-21 11:06:22 +00:00
6ba14ff182 fix(userfunc): fix possible out of bound access
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/eval/userfunc.c:11:
In function ‘strcpy’,
    inlined from ‘cat_func_name’ at gsrc/nvim/eval/userfunc.c:662:5,
    inlined from ‘get_user_func_name’ at gsrc/nvim/eval/userfunc.c:2854:5:
/usr/include/bits/string_fortified.h:79:10: warning: ‘__builtin___strcpy_chk’ offset 0 from the object at ‘<unknown>’ is out of the bounds of referenced subobject ‘uf_name’ with ty
pe ‘char[]’ at offset 0 [-Warray-bounds=]
   79 |   return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gsrc/nvim/eval/typval.h:10,
                 from gsrc/nvim/buffer_defs.h:20,
                 from gsrc/nvim/autocmd.h:8,
                 from gsrc/nvim/eval/userfunc.c:15:
gsrc/nvim/eval/typval_defs.h: In function ‘get_user_func_name’:
gsrc/nvim/eval/typval_defs.h:342:8: note: subobject ‘uf_name’ declared here
  342 |   char uf_name[];    ///< Name of function (actual size equals name);
      |        ^~~~~~~

(cherry picked from commit 9802de9334)
2023-04-21 11:06:22 +00:00
6bd73ed2d9 fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘win_line’:
src/nvim/drawline.c:1418:16: warning: ‘charsize’ may be used uninitialized [-Wmaybe-uninitialized]
 1418 |       wlv.vcol -= charsize;
      |                ^~

(cherry picked from commit 2819718873)
2023-04-21 11:06:22 +00:00
b91278c4fa fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘draw_virt_text’:
src/nvim/drawline.c:298:28: warning: ‘col’ may be used uninitialized [-Wmaybe-uninitialized]
  298 |       state->eol_col = col + 1;
      |                        ~~~~^~~

(cherry picked from commit e9280a68f7)
2023-04-21 11:06:22 +00:00
b2a43b5287 fix(api): avoid integer truncation
gsrc/nvim/api/vim.c: In function ‘nvim_eval_statusline’:
gsrc/nvim/api/vim.c:2268:55: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-tru
ncation=]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                       ^~
gsrc/nvim/api/vim.c:2268:50: note: directive argument in the range [1, 2147483647]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                  ^~~~~~~~
In file included from /usr/include/stdio.h:906,
                 from gsrc/nvim/api/vim.c:9:
In function ‘snprintf’,
    inlined from ‘nvim_eval_statusline’ at gsrc/nvim/api/vim.c:2268:9:
/usr/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 6 and 15 bytes into a destination of size 6
   54 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   55 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~

(cherry picked from commit ef7ae66eef)
2023-04-21 11:06:22 +00:00
400bf2851a Merge pull request #23244 from neovim/backport-23187-to-release-0.9
[Backport release-0.9] fix(column): rebuild status column when sign column is invalid
2023-04-21 18:59:31 +08:00
a5d8024b24 fix(column): rebuild status column when sign column is invalid
(cherry picked from commit 44d4f03573)
2023-04-21 10:46:50 +00:00
2d3c825ada test(column): statuscolumn is rebuild when signs are (un)placed
(cherry picked from commit d799456a6b)
2023-04-21 10:46:50 +00:00
ef7513c87f [Backport release-0.9] fix(treesitter playground): fix the wrong range of a node displayed i… (#23220)
fix(treesitter playground): wrong range of a node displayed in playground

The call parameters order of the function `get_range_str` is flipped for the last two arguments compared to the declaration.

(cherry picked from commit 8613ba118c)

Co-authored-by: William <50717946+BIKA-C@users.noreply.github.com>
2023-04-20 18:30:56 +02:00
9cb2f2fc31 [Backport release-0.9] fix(runtime): do not allow breakcheck inside runtime path calculation (#23201)
fix(runtime): do not allow breakcheck inside runtime path calculation

problem: breakcheck might run arbitrary lua code, which might require
modules and thus invoke runtime path calculation recursively.
solution: Block the use of breakcheck when expanding glob patterns
inside 'runtimepath'

fixes #23012

(cherry picked from commit aee6f08ce1)

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-04-19 17:19:59 +02:00
a41930bcf0 [Backport release-0.9] fix(watchfiles): skip Created events when poll starts (#23197)
fix(watchfiles): skip Created events when poll starts

(cherry picked from commit 8ca1bae217)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-04-19 16:55:06 +02:00
fa5fe845cc Merge pull request #23193 from neovim/backport-23192-to-release-0.9
[Backport release-0.9] test(terminal/channel_spec): fix screen test immediate success
2023-04-19 12:20:21 +08:00
30581744e4 test(terminal/channel_spec): fix screen test immediate success
Check for the [No Name] after wiping the buffer.

(cherry picked from commit 954fe75eab)
2023-04-19 04:10:23 +00:00
535d8553c4 [Backport release-0.9] fix(loader): reset hashes when running the loader (#23181)
fix(loader): only keep hashes for the current loop iteration

(cherry picked from commit e12cfa567f)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-04-18 17:08:45 +02:00
40ef3b2bd4 Merge pull request #23180 from neovim/backport-23179-to-release-0.9
[Backport release-0.9] fix(api): extmark highlight groups not always included in details
2023-04-18 21:20:57 +08:00
54f930f4e3 fix(api): extmark highlight groups not always included in details
Problem:    Erroneous for loop condition.
Solution:   Remove for loop condition.
(cherry picked from commit 5d97d61eab)
2023-04-18 13:08:35 +00:00
37a44f3247 Merge pull request #23174 from neovim/backport-23005-to-release-0.9
[Backport release-0.9] fix(ruler): fix some ruler issues with no statusline
2023-04-18 10:14:21 +01:00
470aa2dbf9 fix(ruler): show ruler of curwin with no statusline in cmdline
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.

Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).

This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.

Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.

(cherry picked from commit 65dd3c1180)
2023-04-18 09:02:02 +00:00
ba198bd7cc vim-patch:9.0.1461: ruler not drawn correctly when using 'rulerformat'
Problem:    Ruler not drawn correctly when using 'rulerformat'.
Solution:   Adjust formatting depending on whether the ruler is drawn in the
            statusline or the command line. (Sean Dewar, closes vim/vim#12246)

fc8a601c32

This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
(cherry picked from commit 7095f8ff9d)
2023-04-18 09:02:02 +00:00
96de6bbaad Merge pull request #23169 from neovim/backport-23163-to-release-0.9
[Backport release-0.9] fix(mouse): cmdline click registered as statuscolumn
2023-04-18 08:19:10 +08:00
54c6dfa009 fix(mouse): cmdline click registered as statuscolumn
(cherry picked from commit dea3774def)
2023-04-18 00:01:09 +00:00
8e2af977b1 Merge pull request #23160 from neovim/backport-23159-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1460: insufficient testing for getcmdcompltype()
2023-04-17 23:39:22 +08:00
fc545cb008 vim-patch:9.0.1460: insufficient testing for getcmdcompltype()
Problem:    Insufficient testing for getcmdcompltype().
Solution:   Add a few more test cases. (closes vim/vim#12268)

961b2e54bd
(cherry picked from commit 56472e5262)
2023-04-17 15:27:23 +00:00
42199afc14 Merge pull request #23147 from neovim/backport-23146-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1400: find_file_in_path() is not reentrant
2023-04-17 14:58:31 +08:00
c9f1e6837a vim-patch:9.0.1400: find_file_in_path() is not reentrant
Problem:    find_file_in_path() is not reentrant.
Solution:   Instead of global variables pass pointers to the functions.
            (closes vim/vim#12093)

5145c9a829

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7b8daa25cd)
2023-04-17 06:39:18 +00:00
1103a4c2c6 Merge pull request #23130 from neovim/backport-23098-to-release-0.9
[Backport release-0.9] fix(lua): inspect_pos respect bufnr when get syntax info
2023-04-16 18:13:36 +08:00
79ee63bc36 fix(lua): inspect_pos respect bufnr when get syntax info
(cherry picked from commit ee4d1f9c52)
2023-04-16 09:50:49 +00:00
6b88a9555c Merge pull request #23089 from neovim/backport-22968-to-release-0.9
[Backport release-0.9] fix(api): update "w_scwidth" in nvim_eval_statusline()
2023-04-14 21:31:49 +08:00
9066b68832 fix(api): update "w_scwidth" in nvim_eval_statusline()
Problem:    `w_scwidth` may be outdated in `nvim_eval_status()`, causing
            `build_stl_str_hl()` to return an empty `%s` sign segment.
Solution:   Update `w_scwidth` for `'statuscolumn'` evaluation.
(cherry picked from commit d3ea9a04bc)
2023-04-14 13:13:13 +00:00
f92d99f0d9 Merge pull request #23077 from neovim/backport-23071-to-release-0.9
[Backport release-0.9] fix: winbar is not redrawn on window change when 'showcmdloc' is "statusline"
2023-04-14 07:11:32 +08:00
fee9452b77 test(winbar_spec): properly update winbar when 'showcmdloc' is "statusline"
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
(cherry picked from commit 80f6d55521)
2023-04-13 23:00:23 +00:00
69d4e64c60 vim-patch:9.0.1451: unnecessary redrawing when 'showcmdloc' is not "last"
Problem:    Unnecessary redrawing when 'showcmdloc' is not "last".
Solution:   Redraw later when "showcmd_is_clear" is set. (Luuk van Baal,
            closes vim/vim#12260)

aa7f25ebf1
(cherry picked from commit 086088ce44)
2023-04-13 23:00:23 +00:00
d24bdc4999 [Backport release-0.9] fix(api): make nvim_get_hl not return non-existing groups (#23065)
fix(api): make nvim_get_hl not return non-existing groups

fixes #23063

(cherry picked from commit d05d63a18f)

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-04-13 15:04:45 +02:00
6625fd8766 Merge pull request #23060 from neovim/backport-23059-to-release-0.9
[Backport release-0.9] vim-patch:partial:9.0.0364: clang static analyzer gives warnings
2023-04-13 13:43:47 +08:00
30627250bd vim-patch:partial:9.0.0364: clang static analyzer gives warnings
Problem:    Clang static analyzer gives warnings.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#11043)

c99e182e1f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
(cherry picked from commit 13c76c4b0d)
2023-04-13 05:29:41 +00:00
232fdf2ccd Merge pull request #23050 from neovim/backport-23048-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1444: crash when passing NULL to setcmdline()
2023-04-13 00:08:26 +08:00
46e875a8a2 vim-patch:9.0.1444: crash when passing NULL to setcmdline()
Problem:    Crash when passing NULL to setcmdline(). (Andreas Louv)
Solution:   Use tv_get_string() instead of using v_string directly.
            (closes vim/vim#12231, closes vim/vim#12227)

ac6cd31afc
(cherry picked from commit 60549b1352)
2023-04-12 15:57:01 +00:00
4b728cc3d7 Merge pull request #23049 from neovim/backport-22983-to-release-0.9
[Backport release-0.9] fix(column): add truncated width during estimation for 'statuscolumn'
2023-04-12 23:51:11 +08:00
2479c63d4a fix(column): add truncated width during estimation for 'statuscolumn'
Problem:    Estimated 'statuscolumn' width estimated is not properly used,
            executing the `w_redr_statuscol` path unnecessarily.
Solution:   Adjust `w_nrwidth` and 'statuscolumn' width before anything
            is actually drawn in a `win_update()`.
(cherry picked from commit 309eeb4109)
2023-04-12 15:41:21 +00:00
f64518ed9c Merge pull request #23047 from neovim/backport-23045-to-release-0.9
[Backport release-0.9] docs: add vim.lsp.buf.formatting_sync() to deprecated.txt
2023-04-12 23:03:07 +08:00
eb9a95ea8e docs: add vim.lsp.buf.formatting_sync() to deprecated.txt
(cherry picked from commit d5b8a1b3d3)
2023-04-12 14:52:24 +00:00
2e819d3707 [Backport release-0.9] fix(runtime): add commentstring for C# ftplugin (#23041)
fix(runtime): add commentstring for C# ftplugin

Problem: No commentstring is set for C# buffers after removing the
default C-style commentstring

Solution: Add `ftplugin/cs.lua` with C-style commentstring
(cherry picked from commit 15c3f2da30)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-04-12 14:01:46 +02:00
911aabeaeb Merge pull request #23020 from neovim/backport-23017-to-release-0.9
[Backport release-0.9] fix(highlight): combine ColorColumn with low-priority CursorLine
2023-04-11 17:05:53 +08:00
763164cd9c fix(highlight): combine ColorColumn with low-priority CursorLine
(cherry picked from commit b0e4f91cc2)
2023-04-11 08:51:49 +00:00
702621f058 [Backport release-0.9] fix(treesitter): Use the correct replacement args for #gsub! directive (#23018)
fix(treesitter): use the correct replacement args for #gsub! directive

(cherry picked from commit 07db1f7432)

Co-authored-by: scottming <therealscottming@gmail.com>
2023-04-11 10:40:43 +02:00
e50ce4ee3f Merge pull request #23013 from neovim/backport-23009-to-release-0.9
[Backport release-0.9] fix(man.lua): don't continue on command error
2023-04-11 09:49:38 +08:00
14e3936871 fix(man.lua): don't continue on command error
Fix #21169

(cherry picked from commit 43648ebb69)
2023-04-11 01:35:19 +00:00
00a1a9327e Merge pull request #22997 from neovim/backport-22996-to-release-0.9
[Backport release-0.9] fix(mark): properly init mark views
2023-04-10 22:59:28 +08:00
7b64dcb30e fix(mark): properly init mark views
(cherry picked from commit 51d4ea17b7)
2023-04-10 14:49:49 +00:00
2658511d77 Merge pull request #22991 from neovim/backport-22990-to-release-0.9
[Backport release-0.9] fix(eval): prevent double-free in garbage collection
2023-04-10 18:18:22 +08:00
974bd47067 fix(eval): prevent double-free in garbage collection
(cherry picked from commit ea969dfd41)
2023-04-10 10:07:18 +00:00
3cde3ae9b5 Merge pull request #22986 from neovim/backport-22967-to-release-0.9
[Backport release-0.9] fix(column): 'statuscolumn' not drawn after virt_lines with "n" in 'cpo'
2023-04-10 08:51:02 +08:00
4758f8ea7a fix(column): 'statuscolumn' not drawn after virt_lines with "n" in 'cpo'
Problem:    The 'statuscolumn' is not drawn and the line itself is drawn
            at an offset to the rest of the buffer after virt_lines if
            'cpoptions' includes "n".
Solution:   Make sure 'statuscolumn' is drawn.
(cherry picked from commit 118c1e7685)
2023-04-10 00:39:48 +00:00
2812d6a6dd Merge pull request #22985 from neovim/backport-22984-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1443: ending Insert mode when accessing a hidden prompt buffer
2023-04-10 07:44:42 +08:00
8146fe86f9 vim-patch:9.0.1443: ending Insert mode when accessing a hidden prompt buffer
Problem:    Ending Insert mode when accessing a hidden prompt buffer.
Solution:   Don't stop Insert mode when it was active before. (closes vim/vim#12237)

05a627c3d4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7a64eecff4)
2023-04-09 23:33:43 +00:00
ae797c08e9 [Backport release-0.9] docs: add hl-DiagnosticDeprecated and hl-DiagnosticUnnecessary (#22964)
docs: add `hl-DiagnosticDeprecated` and `hl-DiagnosticUnnecessary`

(cherry picked from commit 99c86bae15)

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-04-08 19:44:48 +02:00
8aeb262b1b Merge pull request #22959 from neovim/backport-22950-to-release-0.9
[Backport release-0.9] fix(termdebug): handle partial lines passed to callback
2023-04-08 19:38:59 +08:00
76631ee593 fix(termdebug): handle partial lines passed to callback
Problem:
Job callbacks in termdebug cannot handle partial lines.

Solution:
Add a wrapper function that handles partial lines and only passes full
lines to the real callback.

Fix #22929.

(cherry picked from commit f5601737ee)
2023-04-08 11:28:14 +00:00
ebd091f39e Merge pull request #22955 from neovim/backport-22949-to-release-0.9
[Backport release-0.9] fix(packaging): revert installation context to per-machine on Windows
2023-04-08 17:13:02 +08:00
756dd439db Merge pull request #22954 from neovim/backport-22952-to-release-0.9
[Backport release-0.9] fix(highlight): add missing g: prefix for colors_name
2023-04-08 17:10:26 +08:00
e542e07c01 fix(packaging): revert installation context to per-machine
(cherry picked from commit b22e5efbda)
2023-04-08 09:02:33 +00:00
d9ceb213d9 fix(highlight): add missing g: prefix for colors_name
Fix #22951.
This was fixed in Vim in patch 8.2.0613.

(cherry picked from commit a28aa614f5)
2023-04-08 08:58:06 +00:00
92ffc44ce7 Merge pull request #22948 from neovim/backport-22936-to-release-0.9
[Backport release-0.9] ci: don't automatically enable -Werror on CI environments
2023-04-08 09:41:43 +08:00
19bc7456b8 ci: don't automatically enable -Werror if in CI environment
This catches downstream consumers of neovim off-guard when trying to use
neovim in an esoteric environment not tested in our own CI.

Closes https://github.com/neovim/neovim/issues/22932

(cherry picked from commit 0256b67e89)
2023-04-08 01:28:25 +00:00
7a3dbde15c Merge pull request #22947 from neovim/backport-22942-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1442: mapset() does not restore non-script context
2023-04-08 09:25:26 +08:00
513c881900 vim-patch:9.0.1442: mapset() does not restore non-script context
Problem:    mapset() does not restore non-script context.
Solution:   Also accept negative sid. (closes vim/vim#12132)

bfc7cbd1d4

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
(cherry picked from commit 90c33cd0a2)
2023-04-08 01:15:40 +00:00
eced07e6e3 Merge pull request #22946 from neovim/backport-22937-to-release-0.9
[Backport release-0.9] refactor: remove redundant casts
2023-04-08 09:14:51 +08:00
5f263789e0 refactor: remove redundant casts 2
(cherry picked from commit 994314a86d)
2023-04-08 01:02:53 +00:00
4db8c7d570 Merge pull request #22945 from neovim/backport-22935-to-release-0.9
[Backport release-0.9] refactor: remove redundant casts
2023-04-08 09:02:06 +08:00
67dc341aa0 refactor: remove redundant casts
(cherry picked from commit 347c8bbbd6)
2023-04-08 00:51:48 +00:00
e2ab8f78c4 Merge pull request #22944 from neovim/backport-22930-to-release-0.9
[Backport release-0.9] refactor: make char * parameters const in message.c
2023-04-08 08:51:20 +08:00
07cba9e90a refactor: make char * parameters const in message.c
Add const to char * parameters in message.c functions and remove some
redundant casts.

(cherry picked from commit 9c3edbe2c1)
2023-04-08 00:35:13 +00:00
f073f6248b Merge pull request #22943 from neovim/backport-22925-to-release-0.9
[Backport release-0.9] refactor: remove redundant const char * casts
2023-04-08 08:34:36 +08:00
2399f4a539 refactor: remove redundant const char * casts
(cherry picked from commit 1afb4a2963)
2023-04-08 00:24:00 +00:00
060fa561f7 docs(news): fix taglinks 2023-04-07 15:42:32 +02:00
13b21bec0a version bump 2023-04-07 13:54:30 +02:00
040f145984 NVIM v0.9.0
For a summary of notable changes, see runtime/doc/news.txt or run `:help news` within nvim.

BREAKING CHANGES
- Remove hardcopy
- Make iconv a non-optional dep
- Remove has("debug") (#22060)
- Make libintl a required dependency
- Rename vim.pretty_print => vim.print
- Rename sanitizer options from CLANG_* to ENABLE_*
- Remove the .deb release (#22773)
- **column**: Ensure 'statuscolumn' works with virtual and wrapped lines
- **cscope**: Remove
- **defaults**: Change default 'commentstring' value to empty (#22862)
- **edit**: Remove old c implementation of hebrew keymap
- **editorconfig**: Change editorconfig_enable to editorconfig
- **exepath**: Prefers extensionless for powershell
- **health**: Remove deprecated health.lua
- **lsp**: Add rule-based sem token highlighting (#22022)
- **lua**: Execute Lua with "nvim -l"
- **messages**: Graduate the 'msgsep' feature
- **options**: Deprecate paste, remove pastetoggle (#22647)
- **rpc**: Preseve files when stdio channel is closed (#22137)
- **runtime**: Remove filetype.vim (#20428)
- **treesitter**: Remove g:ts_highlight_lua (#22257)
- **treesitter**: Remove silent option from language.add()
- **treesitter**: Consolidate query util functions
- **treesitter**: Remove deprecated show_tree func
- **treesitter**: Deprecate top level indexes to modules (#22761)
- **treesitter**: Rename help parser to vimdoc

FEATURES
- Added support for @generic to lua2dox.lua
- Added support for optional params to lua2dox
- Added support for specifying types for lua2dox
- Mention ":help news" in intro #20674
- ":write ++p" creates parent dirs #20835
- Add vim.secure.read()
- `vim.inspect_pos`, `vim.show_pos`, `:Inspect`
- $NVIM_APPNAME #22128
- Try to recover from missing tempdir #22573
- Add `vim.filetype.get_option()`
- Add `vim.treesitter.language.get_filetypes()` (#22643)
- Allow function passed to defaulttable to take an argument (#22839)
- **api**: Nvim_select_popupmenu_item support cmdline pum (#20652)
- **api**: Add command name to Lua command callback opts
- **api**: Show more exception info
- **api**: More fields in nvim_list_uis
- **api**: Add filetype option nvim_get_option_value
- **api**: Add nvim_get_hl (#22693)
- **api**: Nvim_exec2(), deprecate nvim_exec() #19032
- **api**: Evaluate 'statuscolumn' with nvim_eval_statusline()
- **api**: Set statuscolumn line number in nvim_eval_statusline()
- **aucmd_win**: Allow crazy things with hidden buffers (#21250)
- **checkhealth**: Improve treesitter report
- **checkhealth**: Check runtime ($VIMRUNTIME)
- **checkhealth**: Use "help" syntax, avoid tabpage #20879
- **clipboard**: Copy to system clipboard in tmux when supported (#20936)
- **clipboard**: Added wayclip support (#21091)
- **diagnostic**: Add `suffix` option to `open_float()` (#21130)
- **diagnostic**: Add `suffix` option to `virt_text` config (#21140)
- **diagnostic**: Don't open quickfix/loclist if no diagnostics #21397
- **diagnostic**: Vim.diagnostic.is_disabled() #21527
- **diagnostic**: Add support for tags
- **docs**: Nested lists in HTML, update :help parser
- **docs**: Format parameters as a list #20485
- **docs**: Update parser, HTML gen #20720
- **docs-html**: Try to use tags for ToC headings
- **editorconfig**: Add builtin EditorConfig support
- **editorconfig**: Add editorconfig syntax file
- **editorconfig**: Allow editorconfig to be toggled dynamically
- **exrc**: Use vim.secure.read() for 'exrc' option
- **exrc**: Support .nvim.lua (#21436)
- **extmarks**: Allow preventing spellchecking with spell = false
- **extmarks**: Extend nvim_buf_get_extmarks()
- **filetype**: Fall back to file extension when matching from hashbang (#22140)
- **float**: Open float relative to mouse #21531
- **fs**: Add opts argument to vim.fs.dir()
- **gen_help_html.lua**: Remove old AWK scripts
- **health**: Detect tmux RGB support via `client_termfeatures`
- **help**: Highlighted codeblocks
- **highlight**: Add DiagnosticOk (and associated) highlight groups (#21286)
- **highlight**: Define the concept of altfont as a (c)term rendering attribute
- **l10n**: Update Turkish translations (#20444)
- **l10n**: Update zh_CN translations (#21085)
- **lsp**: Add bufnr option to lsp.start (#20473)
- **lsp**: Support window/showDocument (#19977)
- **lsp**: Run handler in coroutine to support async response (#21026)
- **lsp**: Support set title in lsp relate floatwindow (#21110)
- **lsp**: Support willSave & willSaveWaitUntil capability (#21315)
- **lsp**: Initial support for semantic token highlighting
- **lsp**: Highlight semantic token modifiers (#21390)
- **lsp**: Add function to get semantic tokens at cursor
- **lsp**: Add function to clear codelens (#21504)
- **lsp**: Show active clients in :checkhealth vim.lsp (#21670)
- **lsp**: Add triggerKind option for vim.lsp.buf.code_action (#21905)
- **lsp**: Implement workspace/didChangeWatchedFiles (#21293)
- **lsp**: Implement workspace/didChangeWatchedFiles (#22405)
- **lsp**: Overwrite omnifunc/tagfunc set by ftplugin #22267
- **lsp**: Render markdown in docs hover #22766
- **lsp**: Create default link from @lsp.type.comment to Comment (#22888)
- **lua**: Send "--" literally to Lua "-l" script
- **lua**: Exit 1 on Lua "-l" script error
- **lua**: Execute stdin ("-") as Lua
- **lua**: Store "nvim -l" scriptname in _G.arg[0]
- **lua**: Low-level interpreter mode (nvim -ll)
- **lua**: Make sure require'bit' always works, even with PUC lua 5.1
- **lua**: Add semver api
- **lua**: Omnifunc for builting lua interpreter
- **lua**: Use vim.empty_dict() for empty return value in new api functions  (#22737)
- **lua**: Allow `:=expr` as a shorter version of `:lua =expr`
- **lua**: Add `vim.loader`
- **lua-api**: Avoid unnecessary allocations (#19877)
- **man**: Add health check
- **man.lua**: Support spaces in manpage names
- **message**: Avoid spam on failed os_msg
- **packaging**: Add start menu and desktop shortcuts on Windows
- **provider**: Add support for Yarn node modules on Windows (#21246)
- **secure**: Add `:trust` command  and vim.secure.trust() (#21107)
- **spell**: Support nospell in treesitter queries
- **spell**: Also source `spell/LANG.lua` when setting `spelllang` (#22111)
- **test**: Add Lua forms for API methods (#20152)
- **treesitter**: Add vim.treesitter.show_tree() (#21322)
- **treesitter**: Add 'lang' option to show_tree() (#21341)
- **treesitter**: Show filetype associated with parser (#17633)
- **treesitter**: Allow capture text to be transformed
- **treesitter**: Add metadata option for get_node_text
- **treesitter**: Respect metadata[id].range for offset!
- **treesitter**: Playground improvements
- **treesitter**: Add filetype -> lang API
- **treesitter**: Upstream foldexpr from nvim-treesitter
- **treesitter**: Expand the API
- **treesitter**: Add :InspectTree command (#22477)
- **treesitter**: Bundle query parser and queries (#22483)
- **treesitter**: Use upstream format for injection queries
- **tui**: Run TUI as external process
- **tui**: Graduate the +tui feature
- **tui**: Support altfont mode in tui.c
- **ui**: Add support to display a title in the border of a float (#20184)
- **ui**: Add 'statuscolumn' option
- **ui**: Restore has('gui_running')
- **ui**: Add scroll_delta to win_viewport event #19270
- **vim-patch**: Mention original author #20772
- **vim.diff**: Allow passing an integer for linematch
- **vim.fs**: Pass path to find() predicate, lazy evaluate #22378
- **vim.fs**: Improve normalize
- **vim.gsplit**: Gain features of vim.split
- **vim.version**: More coercion with strict=false
- **web**: Syntax highlighting via highlight.js
- **window/ui**: Add splitkeep option (#19243)
- **windows**: Show icon in terminal titlebar, taskbar #20607

PERFORMANCE
- **column**: Only build fold/sign column when present in 'statuscolumn'
- **completion**: Use one call to globpath() for .vim and .lua #21942
- **diagnostic**: Use api variable and improve validate (#21111)
- **lsp**: Update semantic tokens algorithm for parsing modifiers (#21383)
- **lsp**: Only redraw the windows containing LSP tokens
- **lsp**: Better binary search mid calculation in semantic token (#22607)
- **statuscolumn**: Only fill click defs array once per redraw (#21884)
- **statusline**: UI elements are always redrawn on K_EVENT
- **treesitter**: Smarter languagetree invalidation
- **treesitter**: More efficient foldexpr
- **ui**: Mitigate redraw latency regression from TUI refactor

BUG FIXES
- Make_filter_cmd for :! powershell
- :! pwsh redirection for `command not found`
- Find multibyte file name in line (#20519)
- Change did_emsg back to int
- 'scroll' is not set correctly for floats with 'splitkeep'
- Setting tabline option not redrawing tabline
- Avoid unsigned overflow in home_replace() (#20854)
- Add lfs to luarc.json (#20979)
- Vim.ui.input always calls callback #21006
- Don't disable compositor widgets when a GUI with multigrid attaches
- Pvs warnings (#21145)
- Clang warnings (#21247)
- Vim.opt_local:append ignoring global option value (#21382)
- Issues with command line if ui elements are externalized
- Properly close builtin popup in ext_popupmenu
- Failing XDG test on Windows CI
- Pass value instead of pointer to isalpha (#21898)
- Use correct number for INT_MAX (#21951)
- Add manifest file to correctly determine Windows version (#21953)
- Uv_tty_set_mode failed in Windows #22264
- Lsp github issue template example (#22285)
- Remove "Features" section from --version/:version (#22315)
- Remove "Compiled by:" from :version/--version (#22316)
- Add missing void as function argument (#22317)
- Windows assertion failure due to incorrect path length (#22324)
- Resolve error from -Werror=maybe-uninitialized
- Address -Wmaybe-uninitialized warnings (#22436)
- Pasting in terminal buffer on windows #22566
- Invalid buffer size argument to snprintf #22729
- Snprintf buffer overflow detected by -D_FORTIFY_SOURCE=3 (#22780)
- **MSVC**: Set the active code page to utf-8 (#22384)
- **Windows**: Restore console title at exit #21922
- **api**: Dynamically allocate line buffer for nvim_out_write (#20537)
- **api**: Nvim_buf_get_text regression (#21071)
- **api**: Nvim_win_set_cursor redraw cursorcolumn for non-current window (#21072)
- **api**: Set correct curbuf when temporarily changing curwin (#21371)
- **api**: "emsg_silent" should imply "silent" in nvim_cmd (#21438)
- **api**: Nvim_create_autocmd crash on invalid types inside pattern array
- **api**: Avoid memory leak with click functions in nvim_eval_statusline() (#21845)
- **api**: Don't allow hiding aucmd_win from another tabpage (#21975)
- **api**: Allow empty Lua table for nested dicts #22268
- **api**: Set script context when setting usercmd or option (#22624)
- **api**: Vim.filetype.get_option() (#22753)
- **api**: Make nvim_get_hl return 'cterm' attrs properly
- **api**: Use local LastSet structure in nvim_get_option_info (#22741)
- **api**: Return both link and attributes with nvim_get_hl (#22824)
- **api**: Avoid double hit-enter prompt with nvim_err_writeln (#22879)
- **autocmd**: Handle recursion for force set (#22820)
- **buffer_updates**: Save and restore current window cursor (#16732)
- **build**: "make clean" fails
- **build**: Duplicate version string "v0.8.0-v0.8.0" #20578
- **build**: Fix invalid use of EXITFREE
- **chansend**: Sending lines to terminal in reverse order on Windows #19315
- **ci**: Skip test on windows (#21502)
- **ci/release/winget**: Bump action version
- **client**: Wait for session to exit
- **clint**: Disable whitespace/newline #20619
- **clipboard**: Prefer xsel #20918
- **clipboard**: Update version regex pattern (#21012)
- **clipboard**: Show provider warning when not during batch changes #21451
- **column**: Avoid drawing columns for virt_lines_leftcol
- **column**: Estimate 'statuscolumn' width appropriately
- **column**: No longer reset nrwidth_line_count for 'statuscolumn'
- **column**: Cmdwin cursor is offset with 'statuscolumn' (#22445)
- **column**: Issues with 'statuscolumn' width (#22542)
- **column**: Rebuild status column when sign column is invalidated (#22690)
- **column**: Invalidate statuscolumn width when UPD_NOT_VALID (#22723)
- **completion**: Set pum_size even if ext_popupmenu is used (#20648)
- **completion**: Correct what modes support fuzzy completion
- **completion**: Include lua syntaxes in :ownsyntax completion (#21941)
- **coverity/433537**: Don't call kv_concat_len() when read_size is 0 (#21664)
- **decoration**: Redraw correctly when re-using ids
- **decoration**: Call providers in win_update() earlier
- **decoration**: Do not reset must_redraw after calling providers (#21459)
- **decoration**: Don't show signcolumn for non-sign_text extmark (#22135)
- **diagnostic**: Correct type annotations; add Diagnostic type (#21120)
- **diagnostic**: Clear stale cache on reset (#21454)
- **diagnostic**: Sort diagnostics by column (#21457)
- **diagnostic**: Revert notification on missing diagnostics (#21632)
- **diagnostic**: Use correct field name for tags (#22835)
- **diff**: Remove size_t underflow (#20929)
- **diff**: Fix a crash in diff mode with linematch enabled (#21070)
- **diff**: Handle long lines without crashing (#21389)
- **diff**: Avoid restoring invalid 'foldcolumn' value (#21650)
- **diff**: "nvim -d" should only diff arglist files #21829
- **diff**: Adjust extmarks after diffput/diffget (#22440)
- **diff**: Add NULL check
- **diff**: Trigger on_bytes only once after diffget/diffput
- **diff.c**: Regression in diffgetput (#20843)
- **docs**: Missing "(" in :help HTML
- **docs**: Nil as viable argument for goto_prev (#20852)
- **docs-html**: Keycodes, taglinks, column_heading #20498
- **docs-html**: Update parser
- **docs-html**: Misaligned tabs after conceal #20690
- **edit**: Don't subtract msg_scrolled when removing double quote (#22630)
- **editorconfig**: Do not highlight unknown properties as errors (#21673)
- **embed**: Handle stdio in server properly
- **eval**: Make error number of charidx() same as Vim
- **eval**: Change some tv_dict_add() usages back to hash_add()
- **events**: Save v:event for cmdline autocommands separately (#21316)
- **events**: Skip WinScrolled for newly-created float windows (#21333)
- **ex_cmds**: Fix a mistake in the porting of Vim patch 8.1.0306 (#21096)
- **exit**: The TUI should not ui_flush() itself (#21625)
- **exit**: Skip unnecessary steps in TUI preserve_exit() (#21897)
- **extmarks**: Adjust extmarks when inserting prompt prefix
- **extmarks**: Problems with folded virtual lines (#21930)
- **extmarks**: Don't leak memory on error (#22507)
- **fileio**: Use first available directory in backupdir for backupcopy (#20655)
- **fileio.c**: Don't use uninitialized memory (#22031)
- **filetype**: Don't pass empty string to detect (#20766)
- **filetype**: Correctly detect tex files
- **filetype**: Make vim.filetype.match() work with contents only (#22181)
- **filetype**: Avoid recursive FileType autocmds (#22813)
- **filetype**: Make recursive work...again (#22826)
- **float**: Make closing float in another tab return to correct window
- **float**: Fix ml_get error with bufpos
- **float**: Fix crash with bufpos and non-existent window (#21319)
- **float**: Remove -1 in height clamp
- **folds**: Fix fold marker multibyte comparison (#20439)
- **folds**: Use long for number of folded lines (#21447)
- **folds**: Cursorline highlight is not always applied on closed folds (#22242)
- **folds**: Handle visual blockwise indent insertion correctly (#22898)
- **fs**: Duplicate path separator #21509
- **health**: Correct tmux rgb verification (#20868)
- **health**: Fix `tmux_esc_time` comparison
- **health**: Iterate using ipairs correctly (#22119)
- **health**: Stop using deprecated ts.language.inspect_language() (#22850)
- **help**: Force tree reparse after local addition insertion
- **helpers**: Restore channel id after a call to WITH_SCRIPT_CONTEXT
- **highlight**: Link more treesitter groups by default (#20711)
- **highlight**: Properly deal with underline mask when listing (#22057)
- **highlight**: Avoid ORing underline flags (#22372)
- **highlight**: Use winhl=Foo:Bar even when Bar is empty
- **inspect**: Alwasy resolve full treesitter lang hl groups
- **intro**: Omit patch version in ":help news" item #20713
- **intro**: Make :help news line easier to translate (#21974)
- **lintcommit**: Capitalized description #22282
- **loader**: Disable profiling by default
- **lsp**: Reporting bogus capabilities in CodeActionKind #20678
- **lsp**: Ignore hover and signatureHelp responses on buffer change (#21121)
- **lsp**: Render <pre>{lang} code blocks and set separator default to false (#21271)
- **lsp**: Remove workspaceFolders field (#21284)
- **lsp**: Call show_document with correct args
- **lsp**: Ensure open_logfile is safe for fast events (#21288)
- **lsp**: Followup fixes for semantic tokens support (#21357)
- **lsp**: Correct some type annotations (#21365)
- **lsp**: Fix get_active_clients bufnr parameter (#21366)
- **lsp**: Ignore null responses for semanticTokens request (#21364)
- **lsp**: Token_edit.data might be null on deletion (#21462)
- **lsp**: Adjust gravity of semantic tokens extmarks (#21574)
- **lsp**: Fix nil client access in get_active_clients (#21524)
- **lsp**: Change vim.lsp.get_active_clients.filter name annotation to string (#21624)
- **lsp**: Correct callHierarchy capability to fix lsp.buf.incoming_calls() (#21665)
- **lsp**: Fix `removed` param value in add_workspace_folder (#21915)
- **lsp**: Assert workspace/applyEdit receives params (#21945)
- **lsp**: Check method is supported when range formatting (#21970)
- **lsp**: Check if the buffer is a directory before w! it (#22289)
- **lsp**: Wrong format of bufnr and client order in error message (#22336)
- **lsp**: Fix some type annotations (#22397)
- **lsp**: CallHierarchy methods also require the callHierarchyProvider (#22427)
- **lsp**: Use buffer scheme for files not stored on disk (#22407)
- **lsp**: Only fire LspDetach for attached buffers (#22468)
- **lsp**: Don't monitor files if workspace_folders is nil (#22531)
- **lsp**: Change LspTokenUpdate to use buffer instead of pattern (#22559)
- **lsp**: Prevent lsp tests from picking up local user config (#22606)
- **lsp**: Send didClose on buffer rename (#22623)
- **lsp**: Use line start/end for visual line selection (#22632)
- **lsp**: Remove_workspace_folders fails if client has no workspace_folders #22633
- **lsp**: Vim.lsp.util.apply_text_edits cursor validation #22636
- **lsp**: Kill buffers after renaming a directory #22618
- **lsp**: Avoid switching buffers on lsp attach (#22689)
- **lsp**: Jump to tag locations reliably when :ltag is used (#22750)
- **lsp**: Add missing silent check in lsp hover handler (#22763)
- **lsp/window_showDocument**: Correctly handle external resources #20867
- **lua**: Properly configure luacheck and remove `local vim = ...` lines (#20551)
- **lua**: Assert failure with vim.regex() error inside :silent! (#20555)
- **lua**: On_yank error with blockwise multibyte region #20162
- **lua**: Pesc, tbl_islist result types #20751
- **lua**: Make `vim.deepcopy` work with `vim.NIL`
- **lua**: Always return nil values in vim.tbl_get when no results
- **lua**: Mark some eval functions that can run in API-fast
- **lua**: Vim.deprecate() shows ":help deprecated" #22677
- **luado**: Get old_line length before executing Lua code
- **man**: Support MacOS 13
- **man**: Handle absolute paths as `:Man` targets (#20624)
- **man**: Use italics for `<bs>_` (#22086)
- **man.lua**: Set modifiable before writing page (#20914)
- **man.lua**: Use `env` command (#21007)
- **man.lua**: Open in current window if it's already a man page (#21987)
- **man.lua**: Tests, naming
- **mappings**: Use all buckets in second round of unmap (#21534)
- **mappings**: Fix check for cpo-B inverted in completion
- **mappings**: Make "<" escaping in completion match Vim
- **mark**: Do not restore view in op-pending mode (#20889)
- **memline**: Use long instead of linenr_T for db_line_count
- **memory**: Fix memory alignment for dynamic allocation
- **messages**: Reset msg_grid_scroll_discount when redrawing (#21000)
- **messages**: Don't set cmdline_row when messages have scrolled (#21015)
- **mouse**: Ensure no scrolling with "ver:0" in 'mousescroll' (#20861)
- **mouse**: Statusline click registered as statuscolumn (#21748)
- **options**: No matter what is said, 'cmdheight' is tab-local (susy baka)
- **options**: Fix local 'sidescrolloff' doesn't work for mouse (#21162)
- **options**: Restore exists() behavior for options (#21510)
- **paste**: Feed keys as typed in cmdline mode (#20959)
- **path**: Don't remove trailing slash when getting absolute path (#20853)
- **powershell**: Wrong length allocation for ":%w !" #20530
- **qflist**: Avoid read of uninitialized memory (#20709)
- **rbuffer**: Handle edge case where write_ptr has wrapped around
- **redraw**: Get the line again after evaluating something
- **remote**: Don't leak memory on failure to connect to server (#21931)
- **rpc**: Don't free args on error in rpc_send_event
- **rpc**: Don't parse msgpack if buflen is 0 (#21899)
- **rpc**: Ignore redraw events when not in UI client (#21892)
- **rpc**: Ignore redraw events when exiting (#22184)
- **runtime**: Properly rely on t_Co for colorschemes (#20602)
- **runtime**: Use `g:terminal_color_{0-15}` in colorschemes (#20637)
- **screen**: Correctly draw background and eob with 'rightleft' (#22640)
- **screen**: Redraw the ruler for a current floating window
- **secure**: Crash when hitting escape in prompt (#21283)
- **shell**: On Windows :make does not echo #22728
- **showcmd**: Assert failure with cmdheight=0 (#21536)
- **sleep**: Correct cursor placement (#22639)
- **spell**: Fix wrong cast (#20810)
- **spell**: Properly source spell/LANG.{vim,lua} (#22716)
- **startup**: Support .exrc or .nvimrc with init.lua (#21181)
- **status**: Handle unprintable chars in the statusline
- **statuscolumn**: Fix crashes and clang/PVS warnings (#21725)
- **statuscolumn**: Fix sign column highlights (#21727)
- **statuscolumn**: Foldcolumn buffer is too small (#21761)
- **statuscolumn**: Make %l/%r respect 'number'/'relativenumber' (#21747)
- **statuscolumn**: Always fill click defs array (#21878)
- **statusline**: Don't show showcmd when not enough space (#21550)
- **statusline**: Make nvim_eval_statusline() work with %S (#21553)
- **statusline**: Don't leak memory with zero-width click labels
- **statusline**: Don't leak memory with truncated click labels
- **stdpath**: Default to /tmp if stdpath('run') cannot be created #20952
- **syntax**: Correct conceal for annotated code blocks (#21272)
- **tabline**: Avoid memory leak in tabline click definitions (#21847)
- **terminal**: Fix 'mousescroll' not respected in terminal mode (#21415)
- **test**: Unset XDG_CONFIG_HOME when running oldtest
- **test**: Fix issues detected by running unittests in ASAN/UBSAN
- **test**: Fix C imports on macOS arm64
- **tests**: Only get the color map once, even for multiple test files
- **tests**: Initialize Screen.colors in API highlight tests
- **tests**: Use -l mode for lsp tests
- **tests**: Fixes for using vim.mpack and more ASAN
- **tests**: Adapt treesitter/highlight_spec priority test
- **treesitter**: Properly restore `'syntax'` (#21358)
- **treesitter**: Really restore syntax
- **treesitter**: Validate language name
- **treesitter**: Fix most diagnostics
- **treesitter**: Don't trample parsers when filetype!=lang
- **treesitter**: Make params optional
- **treesitter**: Fixup language invalidation (#22381)
- **treesitter**: Remove virtual text from playground
- **treesitter**: Ipairs -> pairs
- **treesitter**: Fixup for health
- **treesitter**: Maintain cursor position when toggling anonymous nodes
- **treesitter**: Disallow empty filetypes
- **treesitter**: Typos in _range.lua
- **treesitter**: Break early from loop when match is found (#22499)
- **treesitter**: Raise ts_match_limit to 256 (#22497)
- **treesitter**: Is_in_node_range (#22582)
- **treesitter**: Correct include_bytes arg for parse()
- **treesitter**: Do not error on empty filetype
- **treesitter**: Better lang handling of get_parser()
- **treesitter**: Foldexpr (#22652)
- **treesitter**: InspectTree does not respect 'splitright' #22692
- **treesitter**: Annotations
- **treesitter**: Add missing deprecate
- **treesitter**: Update queries from nvim-treesitter
- **treesitter**: Use capture metadata range if exists
- **treesitter**: Disable folding in inspect_tree() (#22885)
- **treesitter**: Do not track ranges of the root tree (#22912)
- **ts**: Check buffer is loaded when restoring options (#21419)
- **tui**: Resume main thread if suspending isn't implemented (#20523)
- **tui**: Set cursor color param as string when required #21407
- **tui**: More work in the TUI
- **tui**: Do not set ui_client_termname if it is already set (#21607)
- **tui**: Make a copy of data->params before unibi_format() (#21643)
- **tui**: Do not invoke loop recursively for pad()
- **tui**: Set stdin as "blocking" on exit (#21973)
- **tui**: Detach/attach on suspend/resume (#22040)
- **tui**: Exit on input eof
- **tui**: Set taskbar, icon in Windows #22270
- **tui**: Only forward stdin_fd on first attach (#22293)
- **tui**: Properly check if stdin is a tty (#22321)
- **tui**: Avoid stack-use-after-scope with cursor color (#22435)
- **tutor**: Failing to get buf name #20933
- **ui**: Msg_ext_set_kind for nvim_echo (#20476)
- **ui**: Setting 'cmdheight' with global statusline (#20515)
- **ui**: Send grid_resize events before triggering VimResized (#20760)
- **ui**: Fix some cases of stale highlight definitions
- **ui**: Allow resize commands to set 'cmdheight' to 0
- **ui**: Fix fragile UI_CALL macro invocation (#21656)
- **ui**: Convert title_pos string in nvim_win_get_config
- **ui**: Set stc to empty in floatwin with minimal style (#21720)
- **ui**: Command line issues with external messages (#21709)
- **ui**: Re-organize tty fd handling and fix issues
- **ui**: Make sure screen is valid after resizing
- **ui**: Recording change doesn't trigger statusline redraw
- **ui**: Ruler is not redrawn in cmdline with redrawstatus
- **ui-ext**: Correct message kind in history before vim.ui_attach()
- **ui-ext**: Log and clear error in ui_comp_event (#21147)
- **ui-ext**: Force cursor update after resize in char-based UI
- **unittest**: Delete unused duplicated code
- **unittests**: Do not consider process crash to be a success
- **unittests**: Fix TUI broken test previously ignored
- **vim-patches**: Ensure libfuse is installed
- **vim.diff**: Correctly apply hunk offsets with linematch (#20931)
- **vim.diff**: Fix fastforward off-by-1 (#20937)
- **vim.ui.input**: Return empty string when inputs nothing (#20883)
- **vim.version**: Incorrect version.cmp()
- **vim.version**: Prerelease compare
- **win_close**: Remove float grid after closing buffer (#21551)
- **win_update**: Don't use unintialized memory in edge case (#22266)
- **windows**: Set console icon later in startup
- **windows**: Consistent normalization in fs.find

BUILD SYSTEM!
- Remove unused variable CMAKE_C_COMPILER_ARG1
- Remove code for cross-compilation
- Remove url for 32-bit winyank
- Remove unnecessary translation-related code
- Rely on builtin cmake downloading rather than custom script
- Define EP_PREFIX property
- Only generate compilation database for the nvim target (#20449)
- Remove EXITFREE for debug builds
- Generate compilation database for older cmake versions
- Add clang-tidy configuration file (#15601)
- Fix incorrect clang-tidy identifier rules (#20650)
- Rely on default cmake installation if possible
- Give example on complex regexes
- Preprocess vim patches with uncrustify #20786
- Copy each treesitter parser library individually #20797
- Fix plural messages missing from .po files (#20830)
- Make update-po support optwin.vim (#20840)
- Remove python linting #20851
- Add EXCLUDE option to add_glob_target
- Always ignore user's cmake preset (#20935)
- Allow IWYU to fix includes for all .c files
- Restrict `git describe` to top level source directory (#20993)
- Fix help tags generation when SHELL=fish (#21562)
- Add git sha to version when built with nix flake (#21210)
- Remove workaround for old luajit versions
- Remove workaround for ancient clang versions
- Use modern cmake (#21589)
- Include our libraries before system libraries (#21746)
- Enable iwyu with target properties instead of variables (#21797)
- Exclude tui/terminfo_defs.h from lintc-clint (#21822)
- Enable cmake workflow presets (#21860)
- Remove nvim as a dependency of unittests (#21903)
- Various cmake fixes (#21902)
- Bump MSVC warning to level two (#21890)
- Use CMAKE_POSITION_INDEPENDENT_CODE instead of -fPIC (#21947)
- Make generated source files reproducible #21586
- Remove unnecessary unit test code (#21940)
- Use cmake for all platforms for unibilium and libtermkey (#21926)
- Simplify treesitter installation (#21969)
- Use upstream CMakeLists.txt for unibilium (#21976)
- Delete pthreads import (#21732)
- Remove GNU make check (#21977)
- Remove tests for libtermkey (#21983)
- Use cmake to build treesitter on all platforms (#21984)
- Introduce default build variables (#21991)
- Use cmake to build libvterm on all platform (#21986)
- Check if libvterm version meets requirement (#22010)
- Find unibilium without relying on libfindmacros (#22015)
- Fix dependencies in find modules (#22017)
- Enable ccache by default if available (#22020)
- Enable ccache project-wide (#22045)
- Add uninstall make target (#22059)
- Remove unnecessary file generation (#22099)
- Update release data
- Stop relying on CMAKE_BUILD_TYPE to determine the build type (#22051)
- Unbreak building neovim with multi-config generators (#22104)
- Don't build libnvim when running the CI (#22149)
- Remove duplicate INTERFACE keyword (#22106)
- Prefer -D <variable>=<value> over -D<variable>=<value> (#22164)
- Replace check-single-includes with clang-tidy (#22061)
- Remove unused function get_test_target (#22176)
- Reuse source files with interface library (#22177)
- Create test/CMakeLists.txt and move test-related code (#22179)
- Remove codecov related files (#20859)
- Mark uninteresting variables as advanced (#22208)
- Enable MSVC level 3 warnings (#21934)
- Don't check environment variable to detect CI (#22234)
- Treat clang-tidy warnings as errors (#22238)
- Remove ENABLE_COMPILER_SUGGESTIONS option (#22249)
- Only use HOSTNAME_PRG if HOSTNAME is undefined (#22288)
- Use custom command to create single versiondef (#22290)
- Use libuv config file (#22209)
- Test multi-config generator (#22310)
- Build all dependencies in parallel (#22329)
- Remove unused dependency penlight (#22334)
- Build luajit in parallel (#22327)
- Set libtermkey project language to C (#22410)
- Remove pkgconfig-related code (#22422)
- Remove libfindmacros library (#22423)
- Cmake cleanup (#22251)
- Unset variables ending with "URL" if USE_EXISTING_SRC_DIR is ON
- Show build type specific compiler flags when using --version
- Fix unknown pragma warning with mingw (#22533)
- Consistently use the provided option paths
- Fix USE_EXISTING_SRC_DIR option
- Silence git describe error output
- Remove workaround for incorrectly packaged libluv
- Enable unit testing on release builds (#22554)
- Fix build warning when using gcc 4.9.2
- Explicitly add dependency include dir for header generation
- Sanitizers for gcc
- Set CMAKE_C_STANDARD to 99 for all dependencies
- Drop curl.exe on Windows
- Download wintools executables separately
- Cmake cleanup
- **MSVC**: Enable assertions on RelWithDebInfo build type (#22326)
- **Windows**: Fix redoing version generation (#21880)
- **Windows**: Make bundling nvim-qt optional (#21866)
- **Windows**: Allow building without custom md5sum
- **bump_deps.lua**: Run command -v in shell (#22030)
- **ci**: Let ASAN print tracebacks for more errors (SIGABORT, SIGILL)
- **cmake**: Add modelines to enable syntax highlighting
- **deps**: Restore support for USE_EXISTING_SRC_DIR (#20491)
- **deps**: Add build type for libuv (#20575)
- **deps**: Disable shared library for libvterm. (#20566)
- **deps**: Bump tree-sitter to v0.20.8 (#22663)
- **deps**: Bump luarocks to v3.9.2
- **deps**: Bump coxpcall to 1.17.0-1
- **deps**: Bump luacheck to 1.1.0-1
- **deps**: Bump mpack to 1.0.10
- **deps**: Bump lua parser to v0.0.14 (#20897)
- **deps**: Switch vim parser to maintained fork (#22896)
- **deps**: Bump vimdoc parser to v2.0.0 (#22870)
- **deps**: Set query parser to release (#22603)
- **deps**: Bump libvterm to v0.3.1
- **deps**: Bump msgpack-c to v6.0.0 (#22522)
- **deps**: Bump win32yank to v0.1.1 (#22700)
- **deps**: Bump actions/stale from 7 to 8
- **deps**: Switch to Launchpad for libvterm and libtermkey (#22811)
- **editorconfig**: Set indent_size to 4 for python files (#21135)
- **lint**: Remove clint.py rules for braces #20880
- **lint**: Add more shell scripts to lintsh
- **lintsh**: Double quote to prevent word splitting (#21571)
- **luarocks**: Update busted version to v2.1.1 (#22029)
- **nix**: Change the pkgs to final, add new version of libvterm (#20410)
- **nix**: Update nixpkgs
- **nix**: Clean up nix flake (#21565)
- **nix**: Remove pylint as it has been removed (#21572)
- **nix**: Fixed build (#22918)
- **vim-patch.sh**: Handle added/removed files properly
- **vim-patch.sh**: Checkout files with path for uncrustify (#20863)
- **windows**: Export extern symbols for use in FFI #22756
- **windows**: Specify Windows 8 as the minimum version (#22173)
- **windows**: Work around luarocks not finding its own md5sum

DOCUMENTATION
- Refer to vim.lsp.start() in LSP issue template #20422
- Fix incorrect :help tag (#20511)
- Added proper annotations to functions in shared.lua
- Fix typos
- Fix/remove invalid URLs #20647
- "supported platforms" matrix #19615
- Update vimdoc parser #20747
- ":che" is ":checkhealth" #20147
- .git-blame-ignore-revs (#20820)
- Swap CursorLineFold and CursorLineSign (#20875)
- Add language annotation to Nvim manual
- Add missing docs from some Vim patches (#21296)
- Dark/light color/accessibilty pass for generated html docs #21345
- Add links to extmarks and namespaces (#21378)
- Remove "How-to disable mouse" menu item #21394
- Add security policy (#17338)
- Fix order of numbers in syntax.txt (#21581)
- Clarify line about converse of lua-heredoc (#21592)
- Fix treesitter parsing errors
- Add 'statuscolumn' docstrings (#21717)
- Builtin TUI is no longer channel 0 (#21794)
- Treesitter.add_directive, add_predicate #21206
- Docs: use codeblocks in runtime/doc/options.txt (#21919)
- Clarify :runtime behavior without [where] again (#22003)
- Clarify "pipe" mode for sockconnect
- Reword news.txt to ensure a consistent style (#22215)
- Remove mentions of 'balloonexpr' #22049
- Remove the test badge from the README (#22350)
- Mention getmousepos() for click execute function label
- Naming conventions, guidelines
- Fix more treesitter parsing errors
- Use build/bin/nvim instead of nvim in gen_vimdoc (#22398)
- Fix vim.treesitter tags
- Lua2dox.lua debugging
- Module-level docstrings (@defgroup) #22498
- Add missing highlight groups for floats
- Add removed features in news.txt
- Fix g:terminal_color_x terminal colors #22746
- More details about vim.region (#21116)
- How to debug TUI using gdb/lldb #22771
- Add vim.treesitter.query.get_query() to deprecated.txt
- **README**: Add Kotlin as a language which can use the API (#21567)
- **README**: Fix CI status badge (#22308)
- **api**: Pattern is not expanded for autocommands (#20812)
- **api**: Fix treesitter parsing errors
- **api**: Tweak data arg for nvim_create_autocmd (#22008)
- **api**: Link to nvim_set_hl_ns from nvim_set_hl (#22678)
- **dev-style**: Remove rule about variable declarations (#20446)
- **dev-style**: Remove rules covered by uncrustify
- **diagnostic**: Number → integer (#22512)
- **docstrings**: Fix runtime type annotations
- **editorconfig**: Update news.txt
- **editorconfig**: Add editorconfig.txt
- **editorconfig**: Number → integer (#22514)
- **filetype**: Number → integer (#22516)
- **gen**: Support language annotation in docstrings
- **gitignore**: Correct oldtest path
- **help**: Consistent headers for local additions
- **highlight**: Fix type annotations (#22272)
- **html**: Render @see items as a list #22675
- **inspect**: Number → integer (#22511)
- **lsp**: Add formatting APIs to deprecated.txt (#20487)
- **lsp**: Update buf_notify and rpc.notify params types (#21753)
- **lsp**: Fix type annotation on convert_input_to_markdown_lines (#21772)
- **lsp**: Format arguments to start_client() (#21980)
- **lsp**: Update cmd_env description (#22438)
- **lsp**: Change type annotations from number → integer (#22510)
- **lsp**: Type annotation for lsp.client (#22509)
- **lsp**: More precise type annotations (#22621)
- **lsp**: Opt-out of default LSP "gq" #22615
- **lua**: Add clarifications for fs.find() and fs.normalize() (#21132)
- **lua**: Correct the tags for vim.opt_local and vim.opt_global (#21138)
- **lua**: Correct vim.spell.check example (#21311)
- **lua**: Add guide to using Lua in Neovim (#21137)
- **lua**: Add `vim.json` (#21538)
- **lua**: Fix treesitter parsing errors
- **lua**: Adjust some type annotations
- **lua**: Lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814)
- **lua**: Use luaref tag instead of www.lua.org #21813
- **lua**: Number → integer (#22517)
- **luvref**: Fix treesitter parsing errors
- **luvref**: Update to version bump
- **maintain**: CI strategy #20778
- **maintain**: Add note on updating luvref.txt
- **manual**: Fix treesitter parsing errors
- **news**: Add news.txt and link from README (#20426)
- **options**: Remove mentions of 'imactivatefunc' and 'imstatusfunc'
- **shell**: Mention "&" for piping with powershell #20459
- **support**: Update tested versions (#21126)
- **test**: Using cmake directly (without make) #22781
- **treesitter**: Fix predicate syntax (#21016)
- **treesitter**: Change links for `eq?` and `set!` to codeblocks  (#21047)
- **treesitter**: Use full function names in tags (#21321)
- **treesitter**: Fix parse errors
- **treesitter**: Number → integer (#22513)
- **treesitter**: Add query injections
- **tutor**: Fix TODO line demo (#21965)
- **uri**: Number → integer (#22515)
- **usr**: Make usr_05.txt more coherent with Nvim changes (#22428)
- **usr_05**: Update sentence about Nvim default behavior of Q (#20817)
- **vim.fs**: Normalize Windows example was incorrect (#21966)
- **website**: Soft wrap code blocks #21644

REFACTOR
- Remove char_u type and replace with char, uint8_t, etc
- remove STRNCMP (#21208) and STRLCPY (#21235)
- Remove clint error suppression as all errors has been fixed #21782
- Explicitly convert HANDLE to intptr_t for _open_osfhandle()
- Clang-tidy fixes to silence clangd warning (#20683)
- Fix uncrustify lint errors
- Move do_mouse() and its helpers to mouse.c (#20895)
- Fix clang-tidy warnings
- Click definition functions #20923
- Remove stray emsg check after #20992 (#20996)
- Move tabline code to statusline.c (#21008)
- Convert drawline.c draw states to enum (#21067)
- Remove __STDC_ISO_10646__ check
- Deprecate 'secure' option
- Remove old TODO comments that aren't relevant anymore (#21144)
- Maybe suppress a PVS warning
- Rework parameter validation in vim.secure.trust() (#21223)
- Buffer_ensure_loaded()
- Move ex_retab() to indent.c
- Remove COMMA (#21260)
- Make sure getting a callback doesn't modify argument
- Rename mch_msg => os_msg
- Rename mch_get_acl => os_get_acl
- Eliminate os_unix.c #21621
- Extract code to open stdin for reading
- Eliminate bump-deps.sh using "nvim -l"
- Fix IWYU mapping file and use IWYU (#21802)
- Format with stylua (#21821)
- Remove E5500, adjust tests
- Fix sign conversion warning from gcc (#21833)
- Use uint8_t for blobs and ga_append() (#21916)
- Use flexible arrays instead of the length-of-one trick (#22072)
- Reduce scope of locals as per the style guide (#22206)
- Move init_default_autocmds to lua
- Rename show_tree => inspect_tree #22474
- Move ga_loaded to runtime.c (#22626)
- Do more in TRY_WRAP
- Add const and remove unnecessary casts (#22841)
- Use bool type for global variables (#22842)
- Rename local API alias from a to api
- Make error message definitions const
- Remove use of reserved c++ keywords
- **PVS**: Suppress false positive V547 in drawline.c (#21875)
- **PVS/V1048**: Remove unnecessary assignment (#21870)
- **PVS/V1048**: Remove redundant assignment (#21871)
- **PVS/V1048**: Remove duplicated assignments (#21873)
- **PVS/V581**: Merge identical if statements (#22390)
- **api**: Do not allocate temporaries for internal events
- **api**: VALIDATE macros #22187 #22256 #22262
- **build**: Remove unused stdlib function and include checks
- **build**: Graduate HAVE_LOCALE_H feature
- **build**: Graduate libtreesitter features which are 1+ years old
- **build**: Graduate msgpack-c FLOAT32 "feature" since forever
- **build**: Graduate unibilium VAR_FROM feature from 2017
- **build**: Graduate -Wvla, -fno-common and -Og "features"
- **build**: Make installation of runtime/ more effective
- **checkhealth**: Convert "nvim" check to Lua
- **clint**: Convert short to int16_t (#20815)
- **column**: Remove unused build_statuscol_str() arguments
- **completion**: Don't add and remove '^' for Lua (#22702)
- **diagnostic**: Remove deprecated function (#20423)
- **diagnostic**: DRY for loop #21521
- **diff.c**: Reduce scope of variables (#20781)
- **diff.c**: Break up ex_diffgetput()
- **diff.c**: Allocate hunks directly in ga_array
- **diff.c**: Factor out hunk extraction
- **diff.c**: Factor out hunk processing
- **diff.c**: Simplify diff_buf_idx()
- **diff.c**: Internal does not need diffstyle
- **diff.c**: Factor out diffblock deletion
- **diff.c**: Copy lines via memmove
- **drawline.c**: Leadcol/trailcol
- **drawline.c**: Move number column helpers function together
- **drawscreen.c**: Reduce scopes of locals (#20668)
- **eval**: Make get_lval() explicitly check for v:lua
- **eval.c**: Factor out get_number_tv() (#21893)
- **exit**: Pass error message to preserve_exit() (#22097)
- **extmarks**: Some minor internal API changes
- **f_has**: Remove wrong comment (#21561)
- **fileio.c**: Reduce scope of locals
- **fileio.c**: Refactor match_file_path()
- **fileio.c**: Refactor vim_rename()
- **fileio.c**: Refactor buf_write_bytes
- **fileio.c**: Refactor buf_write_bytes (2)
- **fileio.c**: Remove HAS_BW_FLAGS
- **fileio.c**: Factor out autocmd handling from buf_write()
- **fileio.c**: More bools
- **fileio.c**: Reduce scope of locals
- **fileio.c**: Do not use macros for error handling
- **fileio.c**: Factor out buf_write post autocmds
- **fileio.c**: Factor out file info calc
- **fileio.c**: Make unreadable expression readable
- **fileio.c**: Factor out backup creation
- **fileio.c**: Remove HAVE_ACL ifdefs
- **fileio.c**: Normalize ifdefs
- **fs**: Replace vim.fn/vim.env in vim.fs (#20379)
- **highlight**: Rename FloatBorderTitle #20988
- **highlight**: Reshape the HL_UNDER* bits into a 3-bit integer mask
- **highlight_group.c**: Reduce scope of locals
- **intro**: Avoid Coverity warning (#22000)
- **loader**: Use vim.fs
- **loader**: Remove BufWritePost autocmd
- **loader**: Add typing for package.loaders
- **loader**: Simplify tracking logic
- **loader**: Cache hash information
- **log**: Reduce compile time LOG_LEVEL granularity
- **lsp**: Remove deprecated lsp functions (#20421)
- **lsp**: Extract a _create_server method in lsp_spec
- **lsp**: Remove deprecated vim.lsp.buf_get_clients calls (#21337)
- **lsp**: Remove workaround for missing bit module (#22373)
- **lsp**: Remove deprecated code (#22389)
- **lsp**: Remove _resolve_capabilities_compat (#22628)
- **lsp**: Do not parse verbose output when overwriting options (#22810)
- **lua**: Move _G.arg init to nlua_init()
- **lua**: Get all marks instead of iterating over namespaces
- **lua2dox**: Format with stylua
- **main.c**: Remove unreachable use_builtin_ui conditions (#22338)
- **man**: Pass env directly to spawn() (#20591)
- **man**: Add type annotations
- **memory**: Simplify new alignment logic
- **option.c**: Reduce scope of locals
- **option.c**: Add get_varp_from and get_varp_scope_from
- **option.c**: De-nest set_option_value
- **option.c**: Use intermediate for options ref
- **option.c**: Add do_set_num
- **option.c**: Add do_set_bool
- **option.c**: Simplify do_set_string
- **option.c**: Factor out common skip check
- **option.c**: Factor out loop code from do_set()
- **option.c**: Remove goto
- **option.c**: Change nextchar to uint8_t
- **option.c**: Use skiptowhite_esc
- **option.c**: Factor out set op parsing
- **option.c**: Factor out option prefix parsing
- **option.c**: Factor out option name parsing
- **option.c**: Factor out opt_idx validation
- **option.c**: De-nest code in do_set_option
- **option.c**: Move bool prefix check
- **option.c**: Add do_set_option_value
- **option.c**: Factor out some nextchar checks
- **option.c**: Factor out string option special case handling
- **options**: Don't pass negative number to illegal_char() (#21999)
- **optionstr.c**: Reduce scope of locals
- **optionstr.c**: Break up did_set_string_option 1-52
- **optionstr.c**: Remove some simple did_set_* functions
- **optionstr.c**: Add did_set_string_option_for
- **optionstr.c**: Break up did_option_listflags
- **optionstr.c**: Remove some redundant parens
- **optionstr.c**: Break up did_set_expropt
- **optionstr.c**: Move handling of formatlistpat
- **optionstr.c**: Align comments (#22070)
- **params**: Open -s and -w script files after parsing commands
- **pty**: Remove old logic for inheriting termios from host terminal
- **redraw**: No type argument in update_screen()
- **redraw**: Various simplifications
- **redraw**: Make cursor position redraw use the "redraw later" pattern
- **runtime**: Use vim.version to compare versions #22550
- **runtime.c**: Factor out find_script_by_name() (#22620)
- **screen**: Screen.c delenda est
- **sleep**: Simplify rube goldberg implementation of :sleep
- **spell**: Use uint8_t for "byts" variables (#22519)
- **statusline**: Move statusline defs to statusline_defs.h
- **tag**: Remove return type from do_tag()
- **test**: Create an lsp-specific helpers.lua file
- **tests**: Lift retry() into assert_log()
- **tests**: Run unittests using main nvim binary in interpreter mode
- **tests**: Move lua-client into core and use it for functionaltests
- **treesitter**: Add vim.treesitter.get_node() (#22360)
- **treesitter**: Use string.format to create lines
- **treesitter**: Simplify some range functions
- **treesitter**: Delegate region calculation to treesitter (#22553)
- **treesitter**: Use byte ranges from treesitter (#22589)
- **treesitter**: Add Range type aliase for Range4|Range6
- **treesitter**: Delegate region calculation to treesitter (#22576)
- **treesitter**: Move inspect_tree impl
- **tui**: Use nvim_echo() for verbose terminfo
- **tui/input.c**: Remove unused multithreading code (#22342)
- **ui**: Statusbar invalidation to win_set_inner_size()
- **ui**: Devirtualize the ui layer
- **ui**: Cleanup 'redrawdebug', introduce "flush" mode
- **ui**: Don't reimplement redrawing in focus gained handling
- **ui**: Remove some superfluous ui_flush() calls
- **ui**: Ui_log() can now just be a function
- **uncrustify**: Move macros definitions to enable formatting
- **uncrustify**: Improved formatting rules
- **vim.gsplit**: Remove "keepsep"
- **vim.version**: Cleanup
- **vim.version**: Use lazy.nvim semver module
- **vim.version**: Use lazy.nvim semver module
- **win_close**: Remove "force", don't pass on "free_buf" (#21921)
- **win_line**: Rename attr to vi_attr (#21487)
- **win_line**: Move some variables into a struct (#22490)
- **window**: Remove aucmd_win check from one_window() (#21972)
- **window.c**: Reduce scope of locals (#20301)
- **windows**: Move os_icon_xx functions

TESTING
- Introduce skip() #21010
- Remove skip for 32-bit MSVC (#21030)
- Don't skip parser_spec on windows (#20294)
- Add a Lua test for swap file created before boot
- Fix failing tui_spec.lua tests (#21117)
- Use isCI to simplify CI detection (#21134)
- Simplify platform detection (#21020)
- Adding/removing winbar should not cause win_pos events (#21226)
- Use luv.os_uname for fast platform detection (#21157)
- Add more tests for float window bufpos (#21318)
- Convert another test in test_matchadd_conceal.vim to Lua (#21353)
- Remove unused variable (#21552)
- Add test cases for command line issues
- Add more tests for Unicode
- Avoid consecutive mouse input at different positions (#21781)
- Align Test_shell_options, Test_shellslash with Nvim default
- Avoid noise in NVIM_LOG_FILE
- Exepath() returns correct path with cmd.exe, powershell #21928
- Remove unused field ext_float (#22243)
- Make expect_unchanged() less confusing (#22255)
- Make {MATCH:} behave less unexpectedly in screen:expect()
- Don't search entire repo for files
- Move oldtests to test directory (#22536)
- Use a wider screen in the rightleft winhl test (#22641)
- Unskip working Windows tests (#22537)
- Re-bundle cat on windows (#21255)
- Windows not detected in msys shells #22671
- Use exec_capture() in more places (#22787)
- Fix flaky watchfiles tests (#22637)
- Replace lfs with luv and vim.fs
- Improve editor/fold_spec.lua and editor/put_spec.lua (#22916)
- **Windows**: Normalize paths for test summary
- **api**: Migrate screenchar() test in in window API to screen test
- **editorconfig**: Add editorconfig tests
- **exit_spec**: Make sure that autocommands are triggered (#22188)
- **fileio_spec**: Avoid expect_exit() without calling clear() (#21810)
- **float_spec**: Add missing sum_scroll_delta #22648
- **help**: Drop treesitter parse error to 0
- **highlight_spec**: Fix warning in Visual highlight test (#22719)
- **legacy/prompt_buffer_spec**: Align script with oldtest more (#22354)
- **lsp**: Call clear() before willSave tests (#21336)
- **lsp**: Add a screen:expect() between insert() and feed_command() (#21577)
- **lua/diagnostic_spec**: Remove unnecessary after_each()
- **lua/fs_spec**: Fix vim.fs.dir() test (#21503)
- **lua/ui_spec**: Fix Ctrl-C test flakiness (#21039)
- **old**: Test_lambda.vim garbagecollect() -> test_garbagecollect_now()
- **old**: Remove stray test42 files (#20966)
- **old**: Make Test_help_tagjump() test order match upstream
- **old**: Add missing lines from Vim patch 8.2.0522 (#21048)
- **old**: Make ":h local-additions" work properly in test_help.vim
- **old**: Skip Vim9 script with less divergence
- **old**: Change $TMPDIR from Xtest-tmpdir to X-test-tmpdir (#21346)
- **old**: Make test_signs.vim closer to upstream (#21479)
- **old**: Run some part of 'cpoptions' tests
- **old**: Make getting an unused PID work (#22529)
- **old**: Move memfile_test.c to test/old/ (#22567)
- **old**: Unskip working tests on Windows (#22650)
- **shada**: Fix shada syntax definitions test
- **statuscolumn**: Add more tests for wrapped lines (#21718)
- **statuscolumn**: %l should follow default wrap behavior (#21766)
- **statuscolumn_spec**: Remove unnecessary feed('lh')
- **statusline**: UI elements are not redrawn on K_EVENT unnecessarily
- **syn_attr_spec**: Add more information (#21912)
- **termxx_spec**: Fix TermClose bdelete test flakiness (#22463)
- **treesitter/parser_spec**: Correct time unit (#22471)
- **tui_spec**: Don't use nested terminal for resize at startup (#21583)
- **tui_spec**: Avoid race between nvim_paste and nvim_input (#21639)
- **tui_spec**: Improve cursor_address test (#21700)
- **tui_spec**: Doesn't use Unicode in cursor_address test (#21703)
- **tui_spec**: Make rapid resize test test what it wants to test (#21933)
- **tui_spec**: Don't expect exact screen in rapid resize test (#21935)
- **tui_spec**: Remove unnecessary arguments for remote UI
- **tui_spec**: Use RPC request to setup autocommands
- **ui**: Wait for another success with failure after success
- **undo_spec**: Add more tests for writing in Insert mode
- **unit**: Use file:close() properly (#21505)
- **vim.fs.normalize**: Enable test on Windows
2023-04-07 13:26:29 +02:00
cbeedc52eb build(nix): fixed build (#22918)
added missing dependencies libiconv
2023-04-07 10:26:52 +02:00
b395f6069f Merge pull request #22907 from luukvbaal/evalstc
feat(api): set statuscolumn line number in nvim_eval_statusline()
2023-04-07 10:11:48 +02:00
b2d10aa01d test(lua/diagnostic_spec): remove unnecessary after_each()
There is already a call to clear() in before_each(), so after_each() isn't necessary.
2023-04-07 09:38:52 +08:00
73060f00dd test: improve editor/fold_spec.lua and editor/put_spec.lua (#22916)
- Close and open a new window each time so that window options have
  their default values in each test.
- Change feed_command() to command() as the latter is faster.
2023-04-07 09:29:12 +08:00
25dfed6e01 feat(api): set statuscolumn line number in nvim_eval_statusline()
Having the user set `v:lnum` before calling `nvim_eval_statusline()` is
unnecesarily fragile. Redraws inbetween setting `v:lnum` and the
`nvim_eval_statusline()` call will overwrite `v:lnum`.
2023-04-07 03:27:44 +02:00
7190dba017 refactor: remove use of reserved c++ keywords
libnvim couldn't be easily used in C++ due to the use of reserved keywords.

Additionally, add explicit casts to *alloc function calls used in inline
functions, as C++ doesn't allow implicit casts from void pointers.
2023-04-06 22:39:50 +02:00
0bc3238504 test(Windows): normalize paths for test summary
It previously gave a mix of forward and backslashes which was jarring.
2023-04-06 18:13:57 +02:00
824639c7c1 fix(folds): handle visual blockwise indent insertion correctly (#22898)
Previously, the fold information was incorrect because it wasn't
being updated during the blockwise insertion.
(Solution by zeertzjq)
2023-04-07 00:08:46 +08:00
dd80ee0ca9 Merge pull request #22910 from bfredl/nonormal
fix(highlight): use winhl=Foo:Bar even when Bar is empty
2023-04-06 17:38:16 +02:00
0f42aa1f2a fix(highlight): use winhl=Foo:Bar even when Bar is empty
fixes #22906
2023-04-06 17:15:16 +02:00
e29bc03c04 fix(treesitter): do not track ranges of the root tree (#22912)
Fixes #22911
2023-04-06 15:16:44 +01:00
fbee2e4d9c ci(release): promote appimage over tar.gz (#22908) 2023-04-06 11:09:33 +02:00
fd32a98752 test(vim.fs.normalize): enable test on Windows 2023-04-05 23:56:33 +02:00
2dfb51a2be docs: add vim.treesitter.query.get_query() to deprecated.txt 2023-04-05 22:19:30 +02:00
371823d407 refactor: make error message definitions const
message.c functions now take const char * as a format. Error message
definitions can be made const.
2023-04-05 21:13:53 +02:00
2612930a09 build(Windows): allow building without custom md5sum
Follow-up to eb1da498d6. The workaround in
that case only works if md5sum is in users path. We work around this by
adding the directory with the md5sum shipped with luarocks to PATH.

Co-authored-by: erw7 <erw7.github@gmail.com>
2023-04-05 19:49:16 +02:00
34ac75b329 refactor: rename local API alias from a to api
Problem:
  Codebase inconsistently binds vim.api onto a or api.

Solution:
  Use api everywhere. a as an identifier is too short to have at the
  module level.
2023-04-05 17:19:53 +01:00
56e4d79b28 build(deps): switch vim parser to maintained fork (#22896)
Problem: tree-sitter-viml parser was not maintained and missing a
release, making it difficult for distros to package Neovim.

Solution: fork the parser under the neovim org, merge some outstanding
PRs, perform general cleanup, make a release, and use this for the
build.
2023-04-05 16:25:33 +02:00
63bffae9e0 Merge pull request #22859 from luukvbaal/evalstc
feat(api): evaluate 'statuscolumn' with nvim_eval_statusline()
2023-04-05 15:02:22 +02:00
999cb36c2b refactor(lsp): do not parse verbose output when overwriting options (#22810) 2023-04-05 14:02:08 +02:00
f0ac91c58b feat(api): evaluate 'statuscolumn' with nvim_eval_statusline() 2023-04-05 12:36:47 +02:00
9d5cbd1b15 ci!: remove the .deb release (#22773)
Having multiple release artifacts per platform is a maintenance burden.
Furthermore, it is a maintenance burden that doesn't directly improve
the Nvim editor itself. The releases are meant to be a quick way for
users to try out and use neovim on their platform and was never intended
to be a buffet of releases for every conceivable setup.

Users are encouraged to the following replacements:

- Github action `action-setup-vim` to have neovim installed on their
  PATH for their CI jobs. See https://github.com/rhysd/action-setup-vim.
- Use the appimage, either as is or by extracting it
  - To use as is, run `chmod u+x nvim.appimage && ./nvim.appimage`
  - If your system does not have FUSE you can extract the appimage with
    `./nvim.appimage --appimage-extract && ./squashfs-root/usr/bin/nvim`
- Build it manually. See https://github.com/neovim/neovim/wiki/Building-Neovim.

Work on https://github.com/neovim/neovim/issues/22684
2023-04-05 09:22:29 +02:00
9e7426718b feat(vim.diff): allow passing an integer for linematch 2023-04-04 23:59:39 +01:00
e826d09c18 fix(windows): consistent normalization in fs.find
vim.fs.find(".luacheckrc")

```
c:\\projects\\neovim/.luacheckrc # before

c:/projects/neovim/.luacheckrc   # after
```

Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2023-04-04 23:37:46 +02:00
872a534f6e docs: regenerate 2023-04-04 23:10:17 +02:00
b479e3a95d feat(lsp): create default link from @lsp.type.comment to Comment (#22888) 2023-04-04 14:06:58 -06:00
743860de40 test: replace lfs with luv and vim.fs
test: replace lfs with luv

luv already pretty much does everything lfs does, so this duplication
of dependencies isn't needed.
2023-04-04 21:59:06 +02:00
b1de4820b7 refactor(treesitter): move inspect_tree impl 2023-04-04 20:47:15 +01:00
81f2bce775 build: cmake cleanup
- Change libtermkeyCMakeLists.txt to LibtermkeyCMakeLists.txt
- Remove duplicate mark_as_advanced calls in FindLibuv.cmake
- Fix "Enabling Clang sanitizer" messages as it's no longer clang-only
- Simplify parser installation syntax
- Rename tree-sitter to treesitter
2023-04-04 19:27:21 +02:00
a5c572bd44 docs: fix typos
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: himanoa <matsunoappy@gmail.com>
2023-04-04 19:07:33 +02:00
b75acd2f94 fix(treesitter): disable folding in inspect_tree() (#22885) 2023-04-04 14:07:27 +02:00
090ade4af6 refactor(treesitter): delegate region calculation to treesitter (#22576) 2023-04-04 13:58:16 +02:00
469e6bfc56 fix(treesitter): use capture metadata range if exists
use `treesitter.get_range` instead of inline expression
2023-04-04 12:26:21 +01:00
b83f949fd9 build(deps): bump tree-sitter to v0.20.8 (#22882) 2023-04-04 12:16:26 +02:00
7c8c155073 fix(api): avoid double hit-enter prompt with nvim_err_writeln (#22879) 2023-04-04 08:59:11 +08:00
eb1da498d6 build(windows): work around luarocks not finding its own md5sum
Luarocks is unable to find its own md5sum due to these reasons listed in
the comment https://github.com/luarocks/luarocks/issues/1443.

The pull request https://github.com/luarocks/luarocks/pull/1498 resolves
this issue, but in the meantime we can work around it by resetting the
value of MD5sum to "md5sum".
2023-04-03 21:12:42 +02:00
e30cc8be19 vim-patch:9.0.1438: .fs files are falsely recognized as forth files (#22871)
Problem:    .fs files are falsely recognized as forth files.
Solution:   Check 100 lines for something that looks like forth. (Johan
            Kotlinski, closes vim/vim#12219, closes vim/vim#11988)

065088d554

Co-authored-by: Johan Kotlinski <kotlinski@gmail.com>
2023-04-03 16:27:49 +02:00
f34b849a22 Merge pull request #22847 from luukvbaal/redrstatus
fix(ui): ruler is not redrawn in cmdline with redrawstatus
2023-04-03 16:02:44 +02:00
bc96bda5a2 build(deps): bump tree-sitter-vimdoc to v2.0.0 (#22870) 2023-04-03 14:08:00 +02:00
f28da92b46 Merge pull request #22783 from luukvbaal/inspect
refactor(lua): get all extmarks instead of iterating over namespaces
2023-04-03 13:08:28 +02:00
Jay
f4cbe03606 fix(test): fix C imports on macOS arm64
System headers on macOS arm64 contain 128-bit numeric types. These types
are built into clang and GCC as extensions. Unfortunately, they break
the LuaJIT C importer. Define dummy typedefs for the missing numeric
types to satisfy the ffi C importer.
2023-04-03 10:27:14 +01:00
10baf89712 vim-patch:9.0.1439: start Insert mode when accessing a hidden prompt buffer (#22867)
Problem:    Start Insert mode when accessing a hidden prompt buffer.
Solution:   Call leaving_window() in aucmd_restbuf(). (Thorben Tröbst,
            closes vim/vim#12148, closes vim/vim#12147)

cde8de0345

Cherry-pick test_prompt_buffer.vim changes from patch 9.0.0631.

Co-authored-by: orbital <orbital@holgerines.de>
2023-04-03 08:36:14 +08:00
a930245557 refactor(lua): get all marks instead of iterating over namespaces
Inspector now also includes highlights set in anonymous namespaces.

Close #22732
2023-04-02 19:14:23 +02:00
53f36806f1 feat(packaging): add start menu and desktop shortcuts on Windows
- Create start menu and desktop shortcuts
- Set installation context to per-user, allowing non-administrative users to
  install the MSI package
    - <https://learn.microsoft.com/windows/win32/msi/installation-context>
    - <https://learn.microsoft.com/windows/win32/msi/allusers>

Resolves #18119
2023-04-02 18:36:35 +02:00
598ff4f7d1 ci: update reviewers 2023-04-02 17:37:05 +02:00
269dd747b6 refactor(defaults)!: change default 'commentstring' value to empty (#22862) 2023-04-02 23:01:48 +08:00
c8a28b847e fix(ui): ruler is not redrawn in cmdline with redrawstatus 2023-04-02 15:24:55 +02:00
3a4db8154f Merge pull request #22844 from luukvbaal/stlrecording
fix(ui): recording change doesn't trigger statusline redraw
2023-04-02 13:37:24 +02:00
da6a42cdaf Merge pull request #22778 from luukvbaal/getext
feat(extmarks): extend nvim_buf_get_extmarks()
2023-04-02 12:00:32 +02:00
d510bfbc8e refactor: remove char_u (#22829)
Closes https://github.com/neovim/neovim/issues/459
2023-04-02 16:11:42 +08:00
9084948893 Merge pull request #22832 from clason/bump-Luv
build(deps): bump luv to HEAD
docs(luvref): update to version bump
2023-04-01 18:07:11 +02:00
4720f0a662 docs(luvref): update to version bump 2023-04-01 17:26:09 +02:00
2d840b6b77 build(deps): bump Luv to HEAD - 093a977b8 2023-04-01 17:26:04 +02:00
643c0ed571 feat: allow function passed to defaulttable to take an argument (#22839)
Pass the value of the key being accessed to the create function, to
allow users to dynamically generate default values.
2023-04-01 08:02:58 -06:00
6a4ebf894f fix(health): stop using deprecated ts.language.inspect_language() (#22850) 2023-04-01 15:47:20 +02:00
19110eddb9 Merge pull request #22837 from clason/ts-sync
build(deps): bump tree-sitter-viml to HEAD
fix(tests): adapt treesitter/highlight_spec priority test
fix(treesitter): update queries from nvim-treesitter
refactor(treesitter)!: rename help parser to vimdoc
docs(treesitter): add query injections
2023-04-01 15:39:25 +02:00
4f66530af1 vim-patch:9.0.1434: crash when adding package already in 'runtimepath' (#22849)
Problem:    Crash when adding package already in 'runtimepath'.
Solution:   Change order for using 'runtimepath' entries. (closes vim/vim#12215)

39c9ec16ea
2023-04-01 21:34:55 +08:00
438c3419df docs(treesitter): add query injections 2023-04-01 15:07:16 +02:00
d7f7450017 refactor(treesitter)!: rename help parser to vimdoc 2023-04-01 15:07:16 +02:00
2a10f64e25 feat(extmarks): extend nvim_buf_get_extmarks()
Problem:    Can not get all extmarks in a buffer. Properties are missing
            from the details array.
Solution:   Allow getting all extmarks in a buffer by supplying a -1
            "ns_id". Add missing properties to the details array.
2023-04-01 13:59:03 +02:00
2a298f2e48 fix(treesitter): update queries from nvim-treesitter
remove self-injection for C preprocessor macros (can be very slow)
2023-04-01 12:19:15 +02:00
90fdaf55c9 fix(tests): adapt treesitter/highlight_spec priority test
Still relied on the old `@Foo`->`Foo` capture to highlight mechanism;
use capture with default highlight instead.
2023-04-01 12:19:15 +02:00
e3a3d30063 fix(ui): recording change doesn't trigger statusline redraw 2023-04-01 04:23:25 +02:00
75e1b1d5c9 refactor: use bool type for global variables (#22842) 2023-04-01 08:56:44 +08:00
d5f6176e6d refactor: add const and remove unnecessary casts (#22841) 2023-04-01 08:49:51 +08:00
dee559d744 build(deps): bump tree-sitter-viml to HEAD 2023-03-31 15:58:19 +02:00
83bfd94d1d refactor(loader): cache hash information
Whenever we run fs_stat() on a path, save this information in the loader
so it can be re-used.

- Loader.loadfile: Remove arguments `hash` as it is no longer needed.

- Loader.loader: Use _G.loadstring instead of Loader.load
  This allows plugins to wrap loadstring to inspection and profiling

- factor out read file logic
2023-03-31 13:05:22 +01:00
b34097fe6d fix(api): return both link and attributes with nvim_get_hl (#22824)
Problem: No way to get the actual highlight attributes for a linked
group through |nvim_get_hl()| (not the attributes from the link target).
Solution: Return the actual attributes as well as the link target name.
2023-03-31 12:52:53 +02:00
ed10e4ef60 fix(diagnostic): use correct field name for tags (#22835)
LSP tags are added to the diagnostic as "tags" but referred to as "_tags"
in the diagnostic underline handler
2023-03-31 11:23:19 +01:00
4cff3aceea fix(loader): disable profiling by default 2023-03-31 09:43:13 +01:00
5bf2f4b3c2 fix(filetype): make recursive work...again (#22826) 2023-03-30 17:24:50 +01:00
226a6c3eae feat(diagnostic): add support for tags
The LSP spec supports two tags that can be added to diagnostics:
unnecessary and deprecated. Extend vim.diagnostic to be able to handle
these.
2023-03-30 14:49:58 +01:00
8fa7d833cf Merge pull request #22791 from lewis6991/refactor/loadermisc
refactor(loader): changes
2023-03-30 13:57:59 +01:00
e5fa2e3a5d fix(autocmd): handle recursion for force set (#22820) 2023-03-30 11:35:13 +01:00
61e54f2636 feat: add vim.treesitter.language.get_filetypes() (#22643) 2023-03-30 10:26:28 +01:00
8b7fb668e4 fix(filetype): avoid recursive FileType autocmds (#22813) 2023-03-29 19:54:12 +01:00
92005db760 build(deps): switch to Launchpad for libvterm and libtermkey (#22811)
Problem: www.leonerd.org.uk is sometimes unreachable

Solution: switch to Launchpad URLs for libvterm (official page) and
libtermkey (source mirror for Ubuntu package)
2023-03-29 14:39:11 +02:00
196f69909d vim-patch:9.0.1430: Livebook files are not recognized (#22808)
Problem:    Livebook files are not recognized.
Solution:   Add a pattern for Livebook files. (Mathias Jean Johansen,
            closes vim/vim#12203)

6400203517

Co-authored-by: Mathias Jean Johansen <mathias@mjj.io>
2023-03-29 10:23:52 +02:00
b7748662ed fix(api): Use local LastSet structure in nvim_get_option_info (#22741)
fix(api): use local LastSet structure in nvim_get_option_info

* nvim_get_option_info is deprecated.
  It is always using the global LastSet information as reported in #15232.
* nvim_get_option_info2 is added.
  The new function additionally accepts an 'opts' table {scope, buf, win}
  allowing to specify the option scope and query local options from another
  buffer or window.
2023-03-29 09:59:01 +02:00
eac75a971d Merge pull request #22759 from dundargoc/build/wintools 2023-03-28 18:46:58 +02:00
81abd5c5c7 build: download wintools executables separately
The wintools executables are stored in a zip file, making it
inconvenient to bump these during releases. Instead, unpack the
executables in the deps repository and download each executable
separately.
2023-03-28 16:18:13 +02:00
b02ee27e51 build: drop curl.exe on Windows
Curl is already shipped by default on Windows 10 starting from versions
1803. As we already require version 1809 we can safely remove it.
2023-03-28 16:18:13 +02:00
bad218cd64 vim-patch:9.0.1429: invalid memory access when ending insert mode (#22792)
Problem:    Invalid memory access when ending insert mode.
Solution:   Check if the insert_skip value is valid.

1a08a3e2a5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-27 09:37:04 +08:00
fd70a9dca1 refactor(loader): simplify tracking logic 2023-03-26 14:11:43 +01:00
25fa051fa1 feat(vim.fs): improve normalize
- Add options argument with an option to expand env vars
- Resolve '//' -> '/'
- Use in vim.loader
2023-03-26 13:30:11 +01:00
ffd8cd1a96 refactor(loader): add typing for package.loaders 2023-03-26 12:51:56 +01:00
fab8dab6b6 refactor(loader): remove BufWritePost autocmd 2023-03-26 12:47:06 +01:00
3c82ce0d62 refactor(loader): use vim.fs 2023-03-26 12:46:24 +01:00
2257ade3dc feat(lua): add vim.loader
feat: new faster lua loader using byte-compilation
2023-03-26 11:42:15 +01:00
6a6191174a test: fix flaky watchfiles tests (#22637) 2023-03-26 10:41:27 +01:00
4863ca6b89 test: use exec_capture() in more places (#22787)
Problem:
Using `meths.exec2("code", { output = true })` is too verbose.

Solution:
Use exec_capture() in more places.
2023-03-26 10:49:32 +08:00
4eef5ac453 vim-patch:9.0.1428: cursor in wrong position when leaving insert mode (#22786)
Problem:    Cursor in wrong position when leaving insert mode.
Solution:   Update the w_valid flags.  Position the cursor also when not
            redrawing. (closes vim/vim#12137)

c174c2e58c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-26 09:24:04 +08:00
e3dab4b326 fix: snprintf buffer overflow detected by -D_FORTIFY_SOURCE=3 (#22780)
Problem:
Wrong buffer size argument passed to snprintf() in set_cmdarg():
	Thread no. 1 (24 frames)
	 #8 snprintf at /usr/include/bits/stdio2.h:54
	 #9 set_cmdarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7044
	 #10 apply_autocmds_group at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1843
	 #11 apply_autocmds_exarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1549
	 #12 readfile at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:617
	 #13 buf_reload at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:5038
	 #14 buf_check_timestamp at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4952
	 #15 check_timestamps at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4678
	 #16 ex_checktime at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_cmds2.c:765
	 #17 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620
	 #18 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #19 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #20 ex_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7727
	 #21 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620
	 #22 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #23 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #24 do_ucmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/usercmd.c:1661
	 #25 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1612
	 #26 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #27 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #28 nv_colon at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:4058
	 #29 normal_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:1172
	 #30 state_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/state.c:88
	 #31 normal_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:471

Solution:
Subtract the offset from the buffer size.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-26 08:22:14 +08:00
13eb6c2554 Merge pull request #22762 from bfredl/hl2cterm
fix(api): make nvim_get_hl return 'cterm' attrs properly
2023-03-25 19:26:45 +01:00
fe9cbcb3a5 feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem:
The signature of nvim_exec() is not extensible per ":help api-contract".

Solution:
Introduce nvim_exec2() and deprecate nvim_exec().
2023-03-25 09:58:48 -07:00
257d894d75 feat(lsp): render markdown in docs hover #22766
Problem:
LSP docs hover (textDocument/hover) doesn't handle HTML escape seqs in markdown.

Solution:
Convert common HTML escape seqs to a nicer form, to display in the float.
closees #22757

Signed-off-by: Kasama <robertoaall@gmail.com>
2023-03-25 12:46:07 -04:00
74f05a152d docs(test): using cmake directly (without make) #22781 2023-03-25 09:33:42 -07:00
dc5a433025 docs: how to debug TUI using gdb/lldb #22771
docs: Add info to the `Debug: TUI` docs about gdb/lldb usage
2023-03-25 12:25:28 -04:00
36ee10057a fix(lsp): add missing silent check in lsp hover handler (#22763)
Fixup to #21531.
2023-03-25 21:01:39 +08:00
42876ddc7a docs: more details about vim.region (#21116) 2023-03-25 16:28:59 +08:00
063e93864a refactor(PVS/V1048): remove duplicated assignments (#21873) 2023-03-25 12:11:14 +08:00
aab4443bb9 vim-patch:9.0.1426: indent wrong after "export namespace" in C++ (#22777)
Problem:    Indent wrong after "export namespace" in C++.
Solution:   Skip over "inline" and "export" in any order. (Virginia Senioria,
            closes vim/vim#12134, closes vim/vim#12133)

99e4ab2a1e

Co-authored-by: Virginia Senioria <91khr@users.noreply.github.com>
2023-03-25 09:27:42 +08:00
ac7397f4a0 fix(treesitter): add missing deprecate 2023-03-24 16:31:30 +00:00
cbbf8bd666 feat(treesitter)!: deprecate top level indexes to modules (#22761)
The following top level Treesitter functions have been moved:
  - vim.treesitter.inspect_language() -> vim.treesitter.language.inspect()
  - vim.treesitter.get_query_files() -> vim.treesitter.query.get_files()
  - vim.treesitter.set_query() -> vim.treesitter.query.set()
  - vim.treesitter.query.set_query() -> vim.treesitter.query.set()
  - vim.treesitter.get_query() -> vim.treesitter.query.get()
  - vim.treesitter.query.get_query() -> vim.treesitter.query.get()
  - vim.treesitter.parse_query() -> vim.treesitter.query.parse()
  - vim.treesitter.query.parse_query() -> vim.treesitter.query.parse()
  - vim.treesitter.add_predicate() -> vim.treesitter.query.add_predicate()
  - vim.treesitter.add_directive() -> vim.treesitter.query.add_directive()
  - vim.treesitter.list_predicates() -> vim.treesitter.query.list_predicates()
  - vim.treesitter.list_directives() -> vim.treesitter.query.list_directives()
  - vim.treesitter.query.get_range() -> vim.treesitter.get_range()
  - vim.treesitter.query.get_node_text() -> vim.treesitter.get_node_text()
2023-03-24 14:43:14 +00:00
ee5008f878 vim-patch:9.0.1425: "wat" and "wast" files are one filetype (#22774)
Problem:    "wat" and "wast" files are one filetype.
Solution:   Add a separate filetype for "wat" files. (Amaan Qureshi,
            closes vim/vim#12165)

3ea62381c5

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-24 14:06:04 +01:00
b155608bff build: set CMAKE_C_STANDARD to 99 for all dependencies
Older gcc versions (4.x) require passing --std=c99 compiler flag to
prevent warnings from being emitted. Instead of setting it for each
dependency, it's easier to just pass the CMAKE_C_STANDARD flag to all
dependencies. This also prevents the scenario of us forgetting to set it
if we add new dependencies.
2023-03-24 10:22:15 +01:00
a478fd4175 ci: use "ci" as the commit type for dependabot updates 2023-03-24 05:39:18 +01:00
b2253cd000 build(deps): bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)
2023-03-23 23:32:45 +07:00
3875b1fc8d ci(labeler): don't automatically add "lua" label (#22765)
The labeler adds "lua" label to too many files. When there is already
a "treesitter" or "lsp" label, a "lua" label isn't useful. Instead it's
better to add the label manually to PRs for general Lua support.
2023-03-23 21:40:50 +08:00
6d267ad30c fix(api): make nvim_get_hl return 'cterm' attrs properly 2023-03-23 13:42:00 +01:00
b02880593e build(win): export extern symbols for use in FFI #22756
Makes `extern` variables accessible through ffi on Windows.

Follow-up to https://github.com/neovim/neovim/pull/15999
2023-03-23 04:58:50 -07:00
4e4203f71b fix(treesitter): annotations
- Begin using `@package` in place of `@private` for functions
that are accessed internally but outside their defined class.

- Rename Node -> TSP.Node
2023-03-23 11:23:51 +00:00
c0fe6c040e feat(api): add nvim_get_hl (#22693)
Problem: no way of getting all highlight group definitions in a namespace.

Solution: add `nvim_get_hl()`, deprecate `nvim_get_hl_by_name()` and `nvim_get_hl_by_id()`.
2023-03-23 10:31:39 +01:00
ea0b66d208 fix(lsp): Jump to tag locations reliably when :ltag is used (#22750) 2023-03-23 08:27:53 +01:00
410dc3349f Merge #22736 from justinmk/gsplit
feat(vim.gsplit): gain features of vim.split
2023-03-22 20:12:40 -04:00
28cfcf5126 fix(api): vim.filetype.get_option() (#22753)
- Fix a bug in the cache
- Set some buffer options on the dummy buffer
2023-03-22 16:49:04 +00:00
e51139f5c1 refactor(vim.gsplit): remove "keepsep"
string.gmatch() is superior, use that instead.
2023-03-22 17:46:01 +01:00
8a70adbde0 fix(vim.version): prerelease compare
Problem:
semver specifies that digit sequences in a prerelease string should be
compared as numbers, not lexically: https://semver.org/#spec-item-11
> Precedence for two pre-release versions with the same major, minor,
> and patch version MUST be determined by comparing each dot separated
> identifier from left to right until a difference is found as follows:
> 1. Identifiers consisting of only digits are compared numerically.
> 2. Identifiers with letters or hyphens are compared lexically in ASCII sort order.
> 3. Numeric identifiers always have lower precedence than non-numeric identifiers.
> 4. A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.
Example:
1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0.

Solution:
cmp_prerel() treats all digit sequences in a prerelease string as
numbers. This doesn't _exactly_ match the spec, which specifies that
only dot-delimited digit sequences should be treated as numbers...
2023-03-22 17:46:01 +01:00
9c49c10470 feat(vim.gsplit): gain features of vim.split
Problem:
- vim.split has more features than vim.gsplit.
- Cannot inspect the "separator" segments of vim.split or vim.gsplit.

Solution:
- Move common implementation from vim.split into vim.gsplit.
  - TODO: deprecate vim.split in favor of vim.totable(vim.gsplit())?
- Introduce `keepsep` parameter.

Related: 84f66909e4
2023-03-22 17:46:01 +01:00
3285cd6ecc refactor: do more in TRY_WRAP 2023-03-22 10:09:28 +00:00
c45b5e2c5b Merge pull request #22743 from bfredl/luaequals
feat(lua): allow `:=expr` as a shorter version of `:lua =expr`
2023-03-22 10:59:38 +01:00
48ce2ef912 vim-patch:9.0.{1419,1421,1422,1423}: some files are not recognized (#22749)
vim-patch:9.0.1419: Lean files are not recognized

Problem:    Lean files are not recognized.
Solution:   Add a pattern for Lean files. (Amaan Qureshi, closes vim/vim#12177)

4a5c39fc52

vim-patch:9.0.1421: Nu files are not recognized

Problem:    Nu files are not recognized.
Solution:   Add a pattern for Nu files. (Amaan Qureshi, closes vim/vim#12172)

8aa2a37f89

vim-patch:9.0.1422: Sage files are not recognized

Problem:    Sage files are not recognized.
Solution:   Add a pattern for Sage files. (Amaan Qureshi, closes vim/vim#12176)

d0639d717b

vim-patch:9.0.1423: WebAssembly Interface Type files are not recognized

Problem:    WebAssembly Interface Type files are not recognized.
Solution:   Add a pattern for WIT files. (Amaan Qureshi, closes vim/vim#12173)

890c772036
2023-03-22 16:19:56 +08:00
a92b38934a feat(lua): allow :=expr as a shorter version of :lua =expr
existing behavior of
  :=
and
  :[range]=

are unchanged. `|` is still allowed with this usage.

However,
   :=p
and similar are changed in a way which could be construed as a breaking
change. Allowing |ex-flags| for := in the first place was a mistake as
any form of := DOES NOT MOVE THE CURSOR. So it would print one line number
and then print a completely different line contents after that.
2023-03-22 09:10:04 +01:00
a7b537c7a4 ci(lintcommit): allow colon in commit message scope
Close #21464
2023-03-22 09:57:23 +07:00
434f3d6a03 docs: fix g:terminal_color_x terminal colors #22746
Based on this source code:
e789d65297/src/nvim/terminal.c (L271)
it only respects `vim.g.terminal_color_{i}` for i from 0 to 15 inclusive.
2023-03-21 05:43:40 -07:00
e789d65297 Merge pull request #22742 from clason/vim-9.0.1415
vim-patch:9.0.{1415,1417}: more files are not recognized
2023-03-20 22:04:13 +01:00
0c9ed19af3 vim-patch:9.0.1417: ESDL files are not recognized
Problem:    ESDL files are not recognized.
Solution:   Add a pattern for ESDL files. (Amaan Qureshi, closes vim/vim#12174)

a1fa8b3ac2

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-20 21:08:31 +01:00
d11986171b vim-patch:9.0.1415: Crystal files are not recognized
Problem:    Crystal files are not recognized.
Solution:   Add a pattern for Crystal files. (Amaan Qureshi, closes vim/vim#12175)

7c4516fe93

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-20 21:07:46 +01:00
4cba53e09e feat(lua): use vim.empty_dict() for empty return value in new api functions (#22737) 2023-03-20 16:16:15 +01:00
d3ac5a342d Merge #22707 vim.version: range(), lazy.nvim impl 2023-03-20 09:18:25 -04:00
a40eb7cc99 feat(vim.version): more coercion with strict=false
Problem:
"tmux 3.2a" (output from "tmux -V") is not parsed easily.

Solution:
With `strict=false`, discard everything before the first digit.

- rename Semver => Version
- rename vim.version.version() => vim.version._version()
- rename matches() => has()
- remove `opts` from cmp()
2023-03-20 13:40:38 +01:00
a715e6f87e refactor(vim.version): use lazy.nvim semver module
Now the Nvim version string "v0.9.0-dev-1233+g210120dde81e" parses
correctly.
2023-03-20 13:40:38 +01:00
990c481551 refactor(vim.version): use lazy.nvim semver module
Use semver code from https://github.com/folke/lazy.nvim
License: Apache License 2.0

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-03-20 13:36:55 +01:00
d8f9dcd5de Merge pull request #22634 from lewis6991/feat/tscomment
feat: add vim.filetype.get_option()
2023-03-20 10:30:59 +00:00
e5641df6d3 feat: add vim.filetype.get_option() 2023-03-20 10:06:32 +00:00
e1db0e35e4 feat(api): add filetype option nvim_get_option_value
- Also adjust the expr-mapping behaviour so normal commands and text
  changes are allowed in internal dummy buffers.
2023-03-20 10:00:52 +00:00
84027f7515 fix: invalid buffer size argument to snprintf #22729
Problem:
Crash in findtags_add_match with FORTIFY_SOURCE=3.
Note: Fedora 38 packages are now built with -D_FORTIFY_SOURCE=3 by default.
1. Compile with overflow protection.
2. nvim --clean
3. :h <Space> <Tab>
4. `*** overflow detected ***: terminated`

The additional checks for the stated buffer size and the actual bounds
of the buffer do not match. See `___snprintf_chk` in the glibc sources:
https://sourceware.org/git/?p=glibc.git;a=blob;f=debug/snprintf_chk.c;h=59577de076c570b81307dd31c8c73e265808cf4c;hb=HEAD#l28

Solution:
Fix arithmetic error: The length of the previously written data is now
subtracted from the total size of the buffer, instead of added on top.

close #22718
2023-03-19 14:32:37 -07:00
ecc4d0e435 fix(shell): on Windows :make does not echo #22728
Problem:
On Windows, :make does not display the output of the program it runs.
The cause is the default 'shellpipe'.  On Linux, nvim uses `tee` to redirect the
output to both stdout and the error file.  In Windows, for both cmd.exe and
powershell, the output is only redirected to the error file.

Solution:
- On Windows, change the 'shellpipe' default to "2>&1| tee".
    - Nvim includes `tee` in its Windows package.
- Document recommended defaults for powershell.

Fixes #12910
2023-03-19 14:25:12 -07:00
5726f33e8c Merge #22691 build!: sanitizers for gcc 2023-03-19 13:42:25 -04:00
8786b2066d fix: pasting in terminal buffer on windows #22566
Problem:
On Windows, pasting multiple lines on a terminal buffer cause all the
lines to appear on the same line, i.e., the line breaks are lost.

Cause:
Windows shells expect "\r\n" as line break but "terminal_paste" function
uses "\n".

Solution:
Use "\r\n" as line break for pasting in terminal buffer on Windows.

Note:
Although this issue was reported with powershell set as 'shell', it
occurs in cmd too.

Fixes #14621
2023-03-19 10:23:34 -07:00
65046c830e Merge pull request #22673 from Diablo-D3/fixfloatclamp
fix(float): remove -1 in height clamp
2023-03-19 13:48:05 +01:00
3b28fb4cd9 fix(float): remove -1 in height clamp
Problem: Clamp for height in floating windows enforced no more than
editor height - 1, disallowing full editor height floating windows when
using cmdheight=0

Solution: Clamp to full height, removing the -1. Tested to give the
intended results with cmdheight=0, 1, or more than 1. This also
inadvertently fixes a rendering error with cmdheight >1 where the
bottom border would be overlapped by the cmdline.
2023-03-19 08:15:04 -04:00
eeac80de0c fix(column): invalidate statuscolumn width when UPD_NOT_VALID (#22723) 2023-03-19 09:21:49 +00:00
204a8b17c8 fix(column): rebuild status column when sign column is invalidated (#22690)
* fix(column): rebuild status column when sign column is invalidated

Problem:    When implementing a custom sign column through
            `'statuscolumn'`, the status column is not properly rebuilt
            when the sign column width changes.
Solution:   Force a rebuild of the status column when the sign column
            width is invalidated.

* test(column): 'statuscolumn' has correct width when (un)placing signs
2023-03-18 11:44:44 +00:00
8916669d50 test(statuscolumn_spec): remove unnecessary feed('lh')
It is no longer needed after #22706.
2023-03-18 19:06:24 +08:00
66ba81a6f7 vim-patch:9.0.1412: Pony files are not recognized (#22721)
Problem:    Pony files are not recognized.
Solution:   Add a pattern for Pony files. (Amaan Qureshi, closes vim/vim#12155)

6e377eca8d
2023-03-18 17:34:31 +08:00
8bdcc91dc8 test(highlight_spec): fix warning in Visual highlight test (#22719)
Problem:    Warning in Visual highlight test.
Solution:   Don't move cursor back and forth.
2023-03-18 16:50:22 +08:00
c6f8af36e1 fix(spell): properly source spell/LANG.{vim,lua} (#22716)
Using regexp doesn't work here because there are no wildcards.
2023-03-18 09:55:08 +08:00
eb3fcf652b vim-patch:9.0.0194: cursor displayed in wrong position after removing text prop (#22706)
Problem:    Cursor displayed in wrong position after removing text prop. (Ben
            Jackson)
Solution:   Invalidate the cursor position. (closes vim/vim#10898)

326c5d36e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-17 21:19:34 +08:00
86c164d2a1 Merge pull request #22699 from clason/vim-9.0.1406
vim-patch:9.0.{1406,1407,1408,1409}: some files are not recognized
2023-03-17 13:40:15 +01:00
07f59467da refactor(completion): don't add and remove '^' for Lua (#22702) 2023-03-17 20:09:56 +08:00
ba8b564986 build(deps): bump win32yank to v0.1.1 (#22700) 2023-03-17 13:04:37 +01:00
2720d2c793 fix(treesitter): InspectTree does not respect 'splitright' #22692
Problem:
vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'.

Solution:
- Change the default `command` from `topleft 60vnew` to `60vnew`.
- Change :InspectTree to respect command mods (`:vertical`, count, etc.).

Closes #22656
2023-03-17 04:41:57 -07:00
6162269fa3 fix(lsp): avoid switching buffers on lsp attach (#22689) 2023-03-17 12:26:13 +01:00
571b50be16 vim-patch:9.0.1409: racket files are recognized as scheme
Problem:    Racket files are recognized as scheme.
Solution:   Recognize rackets files separately. (Gabriel Kakizaki,
            closes vim/vim#12164, closes vim/vim#12162)

d11ac403db

Co-authored-by: Gabriel Kakizaki <gkakizaki@gmail.com>
2023-03-17 10:06:56 +01:00
f83d8ea279 vim-patch:9.0.1408: QMLdir files are not recognized
Problem:    QMLdir files are not recognized.
Solution:   Add a pattern for QMLdir files. (Amaan Qureshi, closes vim/vim#12161)

1505bef5c4

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-17 10:06:56 +01:00
d7746b6ef1 vim-patch:9.0.1407: TableGen files are not recognized
Problem:    TableGen files are not recognized.
Solution:   Add a pattern for TableGen files. (Amaan Qureshi, closes vim/vim#12156)

b8ef029ee4

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-17 09:41:54 +01:00
43d33c5d1a vim-patch:9.0.1406: ILE RPG files are not recognized
Problem:    ILE RPG files are not recognized.
Solution:   Add patterns for ILE RPG files. (Andreas Louv, issue vim/vim#12152)

e202ec8a0c

Co-authored-by: Andreas Louv <andreas@louv.dk>
2023-03-17 09:41:12 +01:00
17ce634b8f build!: rename sanitizer options from CLANG_* to ENABLE_* 2023-03-17 03:40:57 +01:00
accdb0104e Merge pull request #22680 from clason/bump-luarocks
build(deps): bump luarocks and bundled rocks

* Luarocks: v3.8.0 -> v3.9.2
* coxpcall: 1.16.0-1 -> 1.17.0-1
* luacheck: 0.23.0-1 -> 1.1.0-1
* mpack: 1.0.8-0 -> 1.0.10-0
2023-03-17 01:41:00 +01:00
a5cf62e81c build(deps): bump mpack to 1.0.10 2023-03-17 01:03:56 +01:00
5bad9afed2 build: sanitizers for gcc
GCC also supports sanitizers. GCC doesn't support -fsanitize-blacklist
option though, so replace .asan-blacklist file with no_sanitize_address
function attributes instead.
2023-03-16 18:33:41 +01:00
995196c614 Merge pull request #22687 from bfredl/intermarks
refactor(extmarks): some minor internal API changes
2023-03-16 14:23:09 +01:00
8021300806 refactor(extmarks): some minor internal API changes
extranges and a bunch of other improvements are coming for 0.10
This gets in some minor surrounding API changes to avoid rebase
conflicts until then.

- decorations will be able to be specific to windows
- adjust deletion API to fit with extranges
2023-03-16 13:56:05 +01:00
320cb344c1 docs(api): link to nvim_set_hl_ns from nvim_set_hl (#22678) 2023-03-16 09:31:37 +01:00
8408405cb3 build(deps): bump luacheck to 1.1.0-1
also ignore two new warnings showing false positives
2023-03-15 19:23:27 +01:00
17ff65f59a build(deps): bump coxpcall to 1.17.0-1 2023-03-15 18:37:08 +01:00
46079c3396 build(deps): bump luarocks to v3.9.2
Changes from 3.8.0:
https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-392
2023-03-15 18:10:54 +01:00
5a38e951ec build(deps): bump tree-sitter to HEAD - a318b42c8 2023-03-15 14:25:04 +01:00
210120dde8 fix(lua): vim.deprecate() shows ":help deprecated" #22677
Problem:
vim.deprecate() shows ":help deprecated" for third-party plugins. ":help
deprecated" only describes deprecations in Nvim, and is unrelated to any
3rd party deprecations.

Solution:
If `plugin` is specified, don't show  ":help deprecated".

fix #22235
2023-03-15 05:56:13 -07:00
21eacbfef3 docs(html): render @see items as a list #22675
Needed for "flow" HTML layout.

Flow layout before:
    See also:
    https://github.com/kikito/inspect.lua https://github.com/mpeterv/vinspect
Flow layout after:
    See also:
    - https://github.com/kikito/inspect.lua
    - https://github.com/mpeterv/vinspect
2023-03-15 04:51:44 -07:00
d4e2bfbe9c test: Windows not detected in msys shells #22671
Problem:
The functional tests have `is_os(s)` to determine if the current os is.
E.g. `is_os("win")` returns true if the current os is Windows. This is
done by checking if the sysname as detected by luv contains the
substring 'windows'.  In MSYS shells, the sysname is looks like
MINGWXX_NT, where XX is either 32 or 64.  So if you're using busted or
luv that you built separately, not the nvim-bundled versions, then
`is_os(s)` won't work.

Solution:
Treat sysname containing "mingw" as Windows.
2023-03-15 04:17:30 -07:00
d1e0f7454b Merge pull request #22666 from bfredl/unscreen
refactor(screen): screen.c delenda est
2023-03-14 14:00:56 +01:00
d6ecead364 refactor(screen): screen.c delenda est
drawscreen.c vs screen.c makes absolutely no sense.
The screen exists only to draw upon it, therefore helper functions
are distributed randomly between screen.c and the file that
does the redrawing. In addition screen.c does a lot of drawing on the
screen.

It made more sense for vim/vim as our grid.c is their screen.c

Not sure if we want to dump all the code for option chars into
optionstr.c, so keep these in a optionchar.c for now.
2023-03-14 13:37:43 +01:00
4f7879dff0 fix(lsp): kill buffers after renaming a directory #22618
Problem:

When LSP client renames a directory, opened buffers in the edfitor are not
renamed or closed. Then `:wall` shows errors.

https://github.com/neovim/neovim/blob/master/runtime/lua/vim/lsp/util.lua#L776
works correctly if you try to rename a single file, but doesn't delete old
buffers with `old_fname` is a dir.

Solution:
Update the logic in runtime/lua/vim/lsp/util.lua:rename()

Fixes #22617
2023-03-14 05:08:37 -07:00
8dde7c907c fix(lsp): vim.lsp.util.apply_text_edits cursor validation #22636
Problem
Using wrong variable when checking the cursor position is valid or not in
vim.lsp.util.apply_text_edits.

Solution
Use the correct variable.
2023-03-14 04:59:43 -07:00
06e3ff6671 docs(lsp): opt-out of default LSP "gq" #22615
close #22611
2023-03-14 03:42:27 -07:00
4395b5f93a Merge pull request #22658 from clason/help-marks
fix(help): force tree reparse after local addition insertion
docs(help): consistent headers for local additions
2023-03-14 11:35:05 +01:00
ef31444ccc Merge pull request #22659 from bfredl/floatruler
fix(screen): redraw the ruler for a current floating window
2023-03-14 11:28:48 +01:00
0f1e2b6686 fix(screen): redraw the ruler for a current floating window
Semi-regression. The "ruler" behavior for a floating window
was never really specified but in practice followed the users
cursor movements in normal mode in a focused float, which seems
like a reasonable behavior to now specify.
2023-03-14 11:01:45 +01:00
27b467bad2 build(deps): bump tree-sitter to v0.20.8 (#22663) 2023-03-14 09:29:56 +01:00
3e8955094a test: re-bundle cat on windows (#21255)
The builtin cat was removed in 4bc9229ecb
as it is not used during runtime but only for tests. However, it is a
very small and useful utility program that we need for a lot of our
tests, so there's no harm in bundling it, and it helps us avoid
complicating our build system by having two versions of neovim (neovim
for users and neovim for testing).

Also skip tests if "grep" or "sleep" isn't available.
2023-03-14 09:12:26 +08:00
9ab814eafa docs(help): consistent headers for local additions 2023-03-13 20:17:31 +01:00
95ab5a0da3 fix(help): force tree reparse after local addition insertion
Problem: *local-additions* in `help.txt` are inserted via `ml_append`,
which messes up treesitter highlighting of this file as the buffer
becomes desynced from the tree.

Solution: Add hack on top of hack by explicitly calling `mark_adjust`
and `changed_lines_buf` after each insertion.
2023-03-13 20:17:31 +01:00
f01f18cdf4 fix(lsp): remove_workspace_folders fails if client has no workspace_folders #22633
When a client has no workspace_folders, (e.g., copilot), `pairs`
code would crash.
2023-03-13 06:01:34 -07:00
4e99cc1217 Merge pull request #22627 from nullchilly/highlight-cleanup
refactor!: remove deprecated functions
2023-03-13 13:59:38 +01:00
35799a6629 fix(treesitter): foldexpr (#22652)
The ranges passed to foldinfo.remove_range were in the wrong order.
2023-03-13 10:44:43 +00:00
773febc460 test(old): unskip working tests on Windows (#22650) 2023-03-13 12:44:44 +08:00
b466e1d289 test: unskip working Windows tests (#22537)
Some tests that were previously not working have started to work again
for unspecified reasons, so let's enable them.
2023-03-13 11:15:24 +08:00
2daf0b37db feat(options)!: deprecate paste, remove pastetoggle (#22647)
we cannot remove 'paste'. It is very common in plugins and configs.

'pastetoggle' can and should be removed though, it's a total waste of everyone's time because it generates bug reports and doesn't work well, and is useless because bracketed-paste works better.
2023-03-13 10:29:11 +08:00
673d2b52fa refactor!: rename vim.pretty_print => vim.print
Problem:
The function name `vim.pretty_print`:
1. is verbose, which partially defeats its purpose as sugar
2. does not draw from existing precedent or any sort of convention
   (except external projects like penlight or python?), which reduces
   discoverability, and degrades signaling about best practices.

Solution:
- Rename to `vim.print`.
- Change the behavior so that
  1. strings are printed without quotes
  2. each arg is printed on its own line
  3. tables are indented with 2 instead of 4 spaces
- Example:
  :lua ='a', 'b', 42, {a=3}
  a
  b
  42
  {
    a = 3
  }

Comparison of alternatives:
- `vim.print`:
  - pro: consistent with Lua's `print()`
  - pro: aligns with potential `nvim_print` API function which will
    replace nvim_echo, nvim_notify, etc.
  - con: behaves differently than Lua's `print()`, slightly misleading?
- `vim.echo`:
  - pro: `:echo` has similar "pretty print" behavior.
  - con: inconsistent with Lua idioms.
- `vim.p`:
  - pro: very short, fits with `vim.o`, etc.
  - con: not as discoverable as "echo"
  - con: less opportunity for `local p = vim.p` because of potential shadowing.
2023-03-13 01:25:09 +01:00
5aec611469 test(float_spec): add missing sum_scroll_delta #22648 2023-03-12 17:14:02 -07:00
fd2ece278b feat(ui): add scroll_delta to win_viewport event #19270
scroll_delta contains how much the top line of a window moved since the
last time win_viewport was emitted. It is expected to be used to
implement smooth scrolling. For this purpose it only counts "virtual" or
"displayed" so folds should count as one line. Because of this it
adds extra information that cannot be computed from the topline
parameter.

Fixes #19227
2023-03-12 15:58:46 -07:00
e5f4394eb7 Merge pull request #22590 from bfredl/status2
refactor(redraw): make cursor position use the "redraw later" pattern
2023-03-12 13:47:39 +01:00
846a056744 refactor(redraw): make cursor position redraw use the "redraw later" pattern 2023-03-12 10:18:57 +01:00
d15abd1be4 fix(lsp): use line start/end for visual line selection (#22632)
Fixes https://github.com/neovim/neovim/issues/22629
2023-03-12 09:45:28 +01:00
314f20a44f test: use a wider screen in the rightleft winhl test (#22641)
With a wide screen this actually previously caused an overflow.
2023-03-12 15:41:39 +08:00
172227a446 fix(screen): correctly draw background and eob with 'rightleft' (#22640) 2023-03-12 12:10:27 +08:00
2ae54cef6e docs: add removed features in news.txt 2023-03-12 10:30:46 +07:00
1c4b3d41b5 fix(sleep): correct cursor placement (#22639)
Just setcursor_mayforce(true) is enough as Nvim uses msg_grid.
2023-03-12 10:40:27 +08:00
714f6bf249 vim-patch:9.0.1401: condition is always true (#22638)
Problem:    Condition is always true.
Solution:   Remove the condition. (closes vim/vim#12139)

c481ad38f0
2023-03-12 08:02:58 +08:00
9d574f8dd7 ci: bump to windows 2022
Skip failing funcitonaltests. Use jobstart() instead termopen() for
oldtests to prevent CI freezing.
2023-03-11 22:56:16 +01:00
829d92eca3 revert: "build: enable cmake workflow presets (#21860)"
This reverts commit 00a976129b.

Visual Studio fails the build if the CMakePresets.json version is too
high and the CMakePresets.json integration is enabled.

Closes https://github.com/neovim/neovim/issues/22608.
2023-03-11 19:21:54 +01:00
b55b8ddf81 Merge pull request #22613 from lewis6991/feat/tsqueryutil 2023-03-11 17:13:20 +00:00
58bbc2ea0b refactor(treesitter): add Range type aliase for Range4|Range6 2023-03-11 16:38:18 +00:00
0ce626b783 docs(lsp): more precise type annotations (#22621) 2023-03-11 14:50:53 +01:00
23dc2a59b6 fix(lsp): send didClose on buffer rename (#22623)
Subset of https://github.com/neovim/neovim/pull/22407 that was reverted
in https://github.com/neovim/neovim/pull/22604

If a buffer is renamed sending `didClose` for the old buffer helps
ensure the language server doesn't keep a stale document in memory.
2023-03-11 14:50:14 +01:00
865d8d4720 refactor(lsp): remove _resolve_capabilities_compat (#22628) 2023-03-11 14:49:53 +01:00
7dc9182cf0 vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)
Problem:    Autoload script sourced twice if sourced directly.
Solution:   Do not source an autoload script again. (issue vim/vim#6644)

daa2f36573

Cherry-pick ret_sid changes from patch 8.2.0149.
Use do_in_runtimepath() as that's what source_runtime() calls in Nvim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-11 21:29:25 +08:00
6d0c61d90d fix(api): set script context when setting usercmd or option (#22624) 2023-03-11 21:09:11 +08:00
8065fc9aae fix(edit): don't subtract msg_scrolled when removing double quote (#22630)
With msg_grid there is no need to subtract msg_scrolled.
2023-03-11 20:12:58 +08:00
f3efcd0348 Merge pull request #22625 from tomtomjhj/diff-on_bytes-once
fix(diff): trigger on_bytes only once after diffget/diffput
2023-03-11 12:33:01 +01:00
36ca082a11 refactor(health)!: remove deprecated health.lua 2023-03-11 17:59:26 +07:00
71eebd28d1 refactor(treesitter)!: remove deprecated show_tree func 2023-03-11 17:59:26 +07:00
c2f7f8d61c refactor(highlight)!: remove deprecated functions
vim.highlight.create/link
2023-03-11 17:59:06 +07:00
402c31a82d refactor: move ga_loaded to runtime.c (#22626) 2023-03-11 17:58:05 +08:00
2748202e0e fix(diff): trigger on_bytes only once after diffget/diffput
Problem: The fix from b50ee4a8dc may
adjust extmark twice, triggering on_bytes callback twice.

Solution: Don't let mark_adjust adjust extmark.
2023-03-11 18:22:00 +09:00
a1edbd3564 ci: skip ruby provider tests on Windows
Installing the ruby provider takes anything between 1 and 1.5 minutes on
Windows, which is a big drain on our CI. Remove it until we find a more
sustainable solution.
2023-03-11 09:41:58 +01:00
d8ef6770bd Merge pull request #22577 from dundargoc/ci/external-deps
ci: test build with external dependencies on every pull request
2023-03-11 09:39:20 +01:00
1a71e5c362 ci: don't install unused packages
The lua client is no longer needed after
d6279f9392. One of its dependencies,
mpack, is still needed however. Remove lua-nvim and replace it with
lua-mpack.

The other packages are most likely not needed as we no longer run tests
for external dependencies.
2023-03-11 09:38:29 +01:00
5aaed9cbfc ci: test build with external dependencies on every pull request
Only testing the build with external dependencies on build system
changes is too naive, as demonstrated by
b9f19d3e28.
2023-03-11 09:38:29 +01:00
6cd7b5eeef ci: remove environment variable DEPS_BUILD_DIR from CI
If one uses .deps when DEPS_BUILD_DIR is defined in another location it
leads to very surprising behaviors, as it looks for libraries in other
places other than .deps.
2023-03-11 09:38:29 +01:00
236c20795e revert: "fix(lsp): use buffer scheme for files not stored on disk" (#22604)
Although using `buffer://` for unsaved file buffers fixes issues with
language servers like eclipse.jdt.ls or ansible-language-server, it
breaks completion and signature help for clangd.

A regression is worse than a fix for something else, so this reverts
commit 896d672736.

The spec change is also still in dicussion, see
https://github.com/microsoft/language-server-protocol/pull/1679#discussion_r1130704886
2023-03-11 07:35:23 +01:00
a7cd79349c refactor(runtime.c): factor out find_script_by_name() (#22620)
This the refactoring done in Vim patch 8.2.4050.
2023-03-11 12:47:27 +08:00
674e23f19c vim-patch:9.0.0244: cannot easily get the list of sourced scripts (#22596)
Problem:    Cannot easily get the list of sourced scripts.
Solution:   Add the getscriptinfo() function. (Yegappan Lakshmanan,
            closes vim/vim#10957)

f768c3d19c

Cherry-pick usr_41.txt change from a later runtime update.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-11 11:22:22 +08:00
8cb5b995b6 vim-patch:9.0.1397: highlight for popupmenu kind and extra cannot be set (#22619)
Problem:    Highlight for popupmenu kind and extra cannot be set.
Solution:   Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
            highlight groups and use them. (Gianmaria Bajo, closes vim/vim#12114)

6a7c774920

Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-03-11 10:05:47 +08:00
29a43ef8af build: explicitly add dependency include dir for header generation
Neovim and the generated headers needs to use the same include
directories to build correctly. However, we need to generate headers
before all target dependencies has been resolved, meaning that we cannot
rely on any target to determine the final list of include directories.
This may lead to a problems when bundling some, but not all or none,
dependencies as the dependency include directory won't be included.

Also remove the dependency path options as this assumes a specific
structure on the dependency build directory.
2023-03-10 22:40:41 +01:00
9d70fe062c feat(treesitter)!: consolidate query util functions
- And address more type errors.
- Removed the `concat` option from `get_node_text` since it was applied
  inconsistently and made typing awkward.
2023-03-10 16:35:06 +00:00
d3c8d104bc fix(lsp): prevent lsp tests from picking up local user config (#22606)
Sets `NVIM_APPNAME` for the lsp server instances and also for the
`exec_lua` environment to ensure local user config doesn't interfere
with the test cases.

My local `ftplugin/xml.lua` broke the LSP test cases about setting
`omnifunc` defaults.
2023-03-10 17:30:40 +01:00
762a06c6bc feat!(treesitter): do not return changes from LanguageTree:parse()
Never return the changes an only notify them using the `on_changedtree`
callback.

It is not guaranteed for a plugin that it'll be the first one to call
`tree:parse()` and thus get the changes.

Closes #19915
2023-03-10 16:16:49 +00:00
845efb8e12 Merge pull request #22594 from lewis6991/perf/treefold 2023-03-10 13:35:07 +00:00
75537768ef perf(lsp): better binary search mid calculation in semantic token (#22607)
This commit replaces the usage of math.floor((lo + hi) / 2) with the faster and equivalent bit.rshift(lo + hi, 1) for calculating the midpoint in binary search.
2023-03-10 14:10:38 +01:00
46b73bf22c perf(treesitter): more efficient foldexpr 2023-03-10 11:51:33 +00:00
c5b9643bf1 fix(treesitter): better lang handling of get_parser() 2023-03-10 10:43:35 +00:00
adfa9de8eb fix(treesitter): do not error on empty filetype
Ignore instead
2023-03-10 10:41:19 +00:00
4f75960660 fix(treesitter): correct include_bytes arg for parse() 2023-03-10 10:08:32 +00:00
8a3220ba49 build(deps): set query parser to release (#22603) 2023-03-10 10:05:47 +01:00
0ecb4d725e docs(lsp): type annotation for lsp.client (#22509)
* Also fix newly found type mismatch.
* Note that it generates new warnings about using @private client
  methods. A proper fix would be to revamp the lsp client documentation
  altogether.
2023-03-09 21:17:08 +00:00
68aa2857dd vim-patch:9.0.1393: Cairo files are not recognized (#22578)
Problem:    Cairo files are not recognized.
Solution:   Add a pattern for Cairo files. (Amaan Qureshi, closes vim/vim#12118)

ff226d49fe
2023-03-09 18:13:44 +01:00
ae263aff95 refactor(treesitter): use byte ranges from treesitter (#22589) 2023-03-09 16:09:39 +00:00
red
64d3f68c07 build: fix build warning when using gcc 4.9.2
Problem:
When building with gcc 4.9.2, tree-sitter throws warning: "for loop initial
declarations are only allowed in C99 or C11 mode"

Solution:
set CMAKE_C_STANDARD option to 99
2023-03-09 16:46:34 +01:00
9ef7297ef1 feat(lsp): overwrite omnifunc/tagfunc set by ftplugin #22267
Problem:
Some built-in ftplugins set omnifunc/tagfunc/formatexpr which causes
lsp.lua:set_defaults() to skip setup of defaults for those filetypes.
For example the C++ ftplugin has:
    omnifunc=ccomplete#Complete
          Last set from /usr/share/nvim/runtime/ftplugin/c.vim line 30
so the changes done in #95c65a6b221fe6e1cf91e8322e7d7571dc511a71
will always be skipped for C++ files.

Solution:
Overwrite omnifunc/tagfunc/formatexpr options that were set by stock
ftplugin.

Fixes #21001
2023-03-09 06:12:56 -08:00
ce0fddf5ae feat: try to recover from missing tempdir #22573
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432 #9833 https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
    mkdir foo
    TMPDIR=./foo nvim
    :echo tempname()
    !rm -r foo
    :echo tempname()
    tempname() still uses the foo path even though it was deleted.

Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.

Rejected in Vim for performance reasons:
  https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0J
  https://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.

Fixes #1432
Fixes #9833
Fixes #11250
Related: stdpath("run") f50135a32e
2023-03-09 05:07:36 -08:00
46d4d420e5 Merge pull request #22547 from luukvbaal/statusline
perf(statusline): UI elements are always redrawn on K_EVENT
2023-03-09 11:06:47 +01:00
e17581fa53 docs: add missing highlight groups for floats 2023-03-09 10:54:39 +01:00
3ad8458824 vim-patch:8.2.1067: expression "!expr->func()" does not work (#22585)
Problem:    Expression "!expr->func()" does not work.
Solution:   Apply plus and minus earlier. (closes vim/vim#6348)

0b1cd52ff6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-09 13:47:01 +08:00
89a525de9f fix(buffer_updates): save and restore current window cursor (#16732)
When a buffer update callback is called, textlock is active so buffer
text cannot be changed, but cursor can still be moved. This can cause
problems when the buffer update is in the middle of an operator, like
the one mentioned in #16729. The solution is to save cursor position and
restore it afterwards, like how cursor is saved and restored when
evaluating an <expr> mapping.
2023-03-09 10:19:00 +08:00
eaccd0decd vim-patch:9.0.1392: using NULL pointer with nested :open command (#22583)
Problem:    Using NULL pointer with nested :open command.
Solution:   Check that ccline.cmdbuff is not NULL.

7ac5023a5f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-09 08:15:06 +08:00
be0461e3c2 fix(treesitter): is_in_node_range (#22582)
TS ranges are end column exclusive, so fix is_in_node_range
to account for that.
2023-03-08 23:45:43 +00:00
ae70e946ee vim-patch:9.0.1395: Odin files are not recognized (#22580)
Problem:    Odin files are not recognized.
Solution:   Add a pattern for Odin files. (Amaan Qureshi, closes vim/vim#12122)

638388b8ef
2023-03-09 00:19:18 +01:00
6dd9770baf vim-patch:9.0.1394: Unx Tal files are not recognized (#22579)
Problem:    Unx Tal files are not recognized.
Solution:   Add a pattern for Unx Tal files. (Amaan Qureshi, closes vim/vim#12117)

cde1f8714e
2023-03-09 00:19:10 +01:00
b9f19d3e28 Revert "refactor(treesitter): delegate region calculation to treesitter" (#22575)
Revert "refactor(treesitter): delegate region calculation to treesitter (#22553)"

This reverts commit 276b647fdb.
2023-03-08 17:59:45 +00:00
276b647fdb refactor(treesitter): delegate region calculation to treesitter (#22553) 2023-03-08 17:22:28 +00:00
898f902e00 ci(news): don't run on draft (#22574) 2023-03-08 18:18:03 +01:00
fe11079721 perf(statusline): UI elements are always redrawn on K_EVENT
Problem:    'statusline'-format UI elements are redrawn on each K_EVENT.
Solution:   Only redraw UI elements when something relevant has changed.
2023-03-08 12:36:03 +01:00
1fb585a9db test(statusline): UI elements are not redrawn on K_EVENT unnecessarily 2023-03-08 12:35:33 +01:00
ddd257f753 feat(treesitter): use upstream format for injection queries 2023-03-08 11:03:11 +00:00
06aed7c177 vim-patch:8.2.3741: using freed memory in open command (#22568)
Problem:    Using freed memory in open command.
Solution:   Make a copy of the current line.

e031fe90cf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-08 11:17:49 +08:00
0e7edd70a9 test(old): move memfile_test.c to test/old/ (#22567) 2023-03-08 10:46:09 +08:00
e0e474a4bb Merge pull request #22561 from bfredl/cmakeinstall
refactor(build): make installation of runtime/ more effective
2023-03-07 21:15:20 +01:00
30632dd21a refactor(build): make installation of runtime/ more effective
Currently files to install in runtime/ is detected by recursive glob
pattern which has two problems:

- cmake needs to do a of work at config time and
  build/runtime/cmake_install.cmake becomes HUGE (2.5MB, biggest config file)
- we need to explicitly specify each file suffix used in the entire
  runtime, which is duplication of information.

These globs specify every single file in a subdirectory.
Thus, we can just install every runtime/ subdirectory as a single
install command. Furthermore, at the top-level, only .vim and .lua files
need to be installed.

Further possible refactor: we could move files which does not belong
in $PREFIX/runtime out of $REPO/runtime. Then runtime could be installed
with a single install_helper(DIRECTORY ...) command.
2023-03-07 20:16:52 +01:00
4385f8a743 fix(lsp): change LspTokenUpdate to use buffer instead of pattern (#22559) 2023-03-07 17:35:12 +01:00
32ef36cb87 Merge #22503 from eriks47/man-spaces
feat(man.lua): support spaces in manpage names
2023-03-07 09:38:35 -05:00
04e8e1f9ea refactor(runtime): use vim.version to compare versions #22550
TODO:
Unfortunately, cannot (yet) use vim.version for tmux version comparison,
because `vim.version.parse(…,{strict=false})` does not coerce tmux's
funny "tmux 3.3a" version string.
6969d3d749/runtime/autoload/provider/clipboard.vim (L148)
2023-03-07 06:28:53 -08:00
304477ff35 fix(man.lua): tests, naming 2023-03-07 15:23:06 +01:00
160a019ffa feat(man.lua): support spaces in manpage names
Problem:
:Man command errors if given more than two arguments. Thus, it is
impossible to open man pages that contain spaces in their names.

Solution:
Adjust :Man so that it tries variants with spaces and underscores, and
uses the first found.
2023-03-07 15:19:24 +01:00
7a462c10d5 Merge pull request #22558 from zeertzjq/vim-8.2.3969 2023-03-07 21:23:40 +08:00
1637bcce7b build!: make libintl a required dependency
Libintl being an optional dependency is not by design, but a workaround
as it didn't use work on all platforms. That should be fixed by now.
2023-03-07 09:39:08 +01:00
706bcab75e docs(lsp): change type annotations from number → integer (#22510) 2023-03-07 07:17:52 +01:00
08d0f99ae1 vim-patch:partial:944697ae196
Update runtime files

944697ae19

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-07 11:41:35 +08:00
2882b1543a vim-patch:8.2.3969: value of MAXCOL not available in Vim script
Problem:    Value of MAXCOL not available in Vim script.
Solution:   Add v:maxcol. (Naohiro Ono, closes vim/vim#9451)

56200eed62

The variable is always 2147483647, but introducing it makes functions
easier to document.

Co-authored-by: naohiro ono <obcat@icloud.com>
2023-03-07 11:33:23 +08:00
7a44231832 docs(gitignore): correct oldtest path 2023-03-07 11:16:55 +08:00
af23d17388 test: move oldtests to test directory (#22536)
The new oldtest directory is in test/old/testdir. The reason for this is
that many tests have hardcoded the parent directory name to be
'testdir'.
2023-03-07 11:13:04 +08:00
bf4eada2c8 fix(column): issues with 'statuscolumn' width (#22542)
Problem:    'statuscolumn' width can be incorrect when toggling 'number'
            or setting 'statuscolumn'.
Solution:   Make sure the width is reset and re-estimated when
            'statuscolumn' and 'number' are set. (When 'relativenumber'
            is set this already happens because it always changes
            "nrwidth_line_count".)
2023-03-07 08:45:08 +08:00
39096f48f0 Merge pull request #13834 from bfredl/omnilua
omnifunc for builtin lua
2023-03-07 00:28:53 +01:00
79571b92ce feat(lua): omnifunc for builting lua interpreter
also make implicit submodules "uri" and "_inspector" work with completion

this is needed for `:lua=vim.uri_<tab>` wildmenu completion
to work even before uri or _inspector functions are used.
2023-03-06 23:12:21 +01:00
6aa5346b04 build: enable unit testing on release builds (#22554)
Unittests not working on release builds can lead to confusing
situations, such as contributors wondering why their tests aren't
working if they forgot they've built with a release build. This only
increased the Release executable size by 8 kB on my personal machine,
which is an acceptable tradeoff.
2023-03-06 22:36:04 +01:00
1cc23e1109 feat(lsp)!: add rule-based sem token highlighting (#22022)
feat(lsp)!: change semantic token highlighting

Change the default highlights used, and add more highlights per token.

Add an LspTokenUpdate event and a highlight_token function.

:Inspect now shows any highlights applied by token highlighting rules,
default or user-defined.

BREAKING CHANGE: change the default highlight groups used by semantic
token highlighting.
2023-03-06 19:03:13 +01:00
98f2df931a fix(diff): add NULL check 2023-03-06 16:10:04 +00:00
6969d3d749 Merge #22325 vim.version semver parser 2023-03-06 10:04:13 -05:00
74ffebf8ec fix(vim.version): incorrect version.cmp()
Problem:
If major<major but minor>minor, cmp_version_core returns 1

Solution:
- Fix logic in cmp_version_core
- Delete most eq()/gt()/lt() tests, they are redundant.
2023-03-06 15:36:25 +01:00
e31e49a8e3 refactor(vim.version): cleanup
- version.cmp(): assert valid version
- add test for loading vim.version (the other tests use shared.lua in
  the test runner)
- reduce test scopes, reword test descriptions
2023-03-06 14:51:56 +01:00
0e7196438d feat(lua): add semver api 2023-03-06 13:45:59 +01:00
f9a46391ab refactor(treesitter): simplify some range functions 2023-03-06 10:57:14 +00:00
b0620ffe5a vim-patch:9.0.1386: options test fails with some window width (#22548)
Problem:    Options test fails with some window width.
Solution:   Adjust what text the test checks with. (closes vim/vim#12111)

30585e03a7
2023-03-06 16:45:57 +08:00
e389b18902 vim-patch:9.0.1385: g'Esc is considered an error (#22544)
Problem:    g'Esc is considered an error.
Solution:   Make g'Esc silently abandon the command. (closes vim/vim#12110)

f86dea8119
2023-03-06 07:52:11 +08:00
533d671271 docs: module-level docstrings (@defgroup) #22498
Problem:
gen_vimdoc.py / lua2dox.lua does not support @defgroup or \defgroup
except for "api-foo" modules.

Solution:
Modify `gen_vimdoc.py` to look for section names based on `helptag_fmt`.

TODO:
- Support @module ?
  https://github.com/LuaLS/lua-language-server/wiki/Annotations#module
2023-03-05 15:15:29 -08:00
1b49841969 Merge pull request #22539 from dundargoc/build/luv
build: remove workaround for incorrectly packaged libluv
2023-03-06 00:05:42 +01:00
da0c66bcdd build: remove workaround for incorrectly packaged libluv
This removes a workaround for incorrectly packaged libluv in
90e44ecf11 as it should not be needed
anymore.
2023-03-05 21:13:28 +01:00
ca3bc56a3b build: silence git describe error output
This change will silence the warning from git describe command when the project
is built using source tarball. The warning is
fatal: not a git repository: 'neovim/.git'
2023-03-05 18:50:25 +01:00
5dcf544f8a build: fix USE_EXISTING_SRC_DIR option
Since 0007aa50bd the build unsets all URL
variable immediately when USE_EXISTING_SRC_DIR is TRUE, which is
correct. However, this causes the function BuildTSParser to break down
as cmake functions aren't traditionally equipped to deal with empty
variables. Using cmake_parse_arguments fixes this issue.
2023-03-05 18:45:34 +01:00
f636619d9e Merge pull request #22486 from dundargoc/ci/cache 2023-03-05 16:25:37 +01:00
f4d83ac1e2 build: consistently use the provided option paths
We provide options such as "DEPS_BIN_DIR" for the user to set, but only
sometimes use them. This makes binaries and other files to be spread out
if the user defines a custom DEPS_BIN_DIR location.
2023-03-05 15:21:46 +01:00
0775858703 build: fix unknown pragma warning with mingw (#22533)
This checks MSVC toolchain with _MSC_VER macro before adding
pragma warning directive. It is specific to MSVC and shows
compiler warning with mingw gcc as following:

main.c:187: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
  187 | # pragma warning(suppress : 4996)
2023-03-05 21:52:32 +08:00
2ddb50fa1b ci: skip core dump check
The core dump check interferes with CI as it interprets any file with
"core" in it to be a core dump, which is incorrect.
2023-03-05 14:52:05 +01:00
d877aa32f2 ci: remove core dump checking from test.yml
There is already a superior core dump check in test/helpers.lua, which
makes this obsolete.
2023-03-05 14:52:05 +01:00
98876db155 ci: use the same deps directory location for all jobs
Having separate directory location causes failures to be inconsistent
and ultimately confusing. A common problem is a file with a particular
name is searched for the entire repository, which gives different
results if the dependency directory is inside the neovim directory or
outside of it.
2023-03-05 14:52:05 +01:00
ba38f35d3e test: don't search entire repo for files
Searching the entire repo for a directory named "contrib" causes failure
if there happens to be another subdirectory with the name "contrib".
Instead, point directly to the correct contrib directory.
2023-03-05 11:21:37 +01:00
836733dad8 Merge pull request #22532 from zeertzjq/vim-9.0.0736
vim-patch:9.0.{0736,0749,0770,0870}: quickfix listing does not handle very long messages
2023-03-05 17:30:04 +08:00
e0bbe8ccf8 vim-patch:9.0.0870: get E967 when using text property in quickfix window
Problem:    Get E967 when using text property in quickfix window. (Sergey
            Vlasov)
Solution:   Do not add an extra NUL and compute the text length correctly.
            (closes vim/vim#11513)

2f7bfe66a1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-05 17:05:33 +08:00
749fe2c383 vim-patch:9.0.0770: quickfix commands may keep memory allocated
Problem:    Quickfix commands may keep memory allocated.
Solution:   Free memory when it's a bit much. (Yegappan Lakshmanan,
            closes vim/vim#11379)

d8cd6f7427

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-05 17:04:43 +08:00
1adad44b7c vim-patch:9.0.0749: alloc/free of buffer for each quickfix entry is inefficient
Problem:    Alloc/free of buffer for each quickfix entry is inefficient.
Solution:   Use a shared grow array. (Yegappan Lakshmanan, closes vim/vim#11365)

975a665d48

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-05 17:02:24 +08:00
1cfe83c2a2 vim-patch:9.0.0736: quickfix listing does not handle very long messages
Problem:    Quickfix listing does not handle very long messages.
Solution:   Use a growarray instead of a fixed size buffer. (Yegappan
            Lakshmanan, closes vim/vim#11357)

f8412c9d7c

Override Test_very_long_error_line() with a rewrite that doesn't use
deferred delete and string interpolation.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-03-05 16:51:22 +08:00
ed05d38d9f fix(lsp): don't monitor files if workspace_folders is nil (#22531)
Fixes:

    Error SERVER_REQUEST_HANDLER_ERROR: "...di/dev/neovim/neovim/runtime/lua/vim/lsp/_watchfiles.lua
    :200: bad argument #1 to 'ipairs' (table expected, got nil)"

Language servers can be started without root_dir or workspace_folders.
2023-03-05 08:42:15 +01:00
ac69ba5fa0 feat(lsp): implement workspace/didChangeWatchedFiles (#22405) 2023-03-05 07:52:27 +01:00
419819b624 vim-patch:9.0.1380: CTRL-X on 2**64 subtracts two (#22530)
Problem:    CTRL-X on 2**64 subtracts two. (James McCoy)
Solution:   Correct computation for large number. (closes vim/vim#12103)

5fb78c3fa5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-05 09:18:42 +08:00
b44b8e7687 test(old): make getting an unused PID work (#22529) 2023-03-05 08:34:58 +08:00
089f962d6a vim-patch:9.0.1378: illegal memory access when using virtual editing (#22527)
Problem:    Illegal memory access when using virtual editing.
Solution:   Make sure "startspaces" is not negative.

c99cbf8f28

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-05 08:08:04 +08:00
39842be8cd fix(extmarks): don't leak memory on error (#22507) 2023-03-05 07:09:28 +08:00
7100a80253 build: show build type specific compiler flags when using --version
The build type specific flags are defined in the variables
CMAKE_C_FLAGS_<CONFIG>, where <CONFIG> can be DEBUG, RELEASE,
RELWITHDEBINFO and MINSIZEREL.
2023-03-04 20:04:01 +01:00
3683d6b7a8 ci: move configuring cmake to the build part of the CI
If the configuration fails then lints shouldn't be run, as most lint
steps depends on a successful configuration.
2023-03-04 17:55:42 +01:00
59542504b4 docs(highlight): fix type annotations (#22272) 2023-03-04 17:47:30 +01:00
46c4cbced5 build(deps): bump msgpack-c to v6.0.0 (#22522)
* Remove C++ requirement if test is disabled
* Change CMake package name of C library to msgpack-c
* Unified all C package, library, cmake, tarball name become msgpack-c.
2023-03-04 17:26:24 +01:00
bc26f23e5a Merge pull request #22415 from bfredl/log_debug
refactor(log): reduce compile time LOG_LEVEL granularity
2023-03-04 17:18:32 +01:00
2ba224e152 refactor(log): reduce compile time LOG_LEVEL granularity 2023-03-04 15:26:17 +01:00
dde5ce46b2 refactor(spell): use uint8_t for "byts" variables (#22519)
Avoid casting back and forth.
2023-03-04 21:09:50 +08:00
aa16590999 docs(lua): number → integer (#22517) 2023-03-04 13:07:39 +00:00
82b77900d7 docs(diagnostic): number → integer (#22512) 2023-03-04 13:06:20 +00:00
65e2feabeb docs(editorconfig): number → integer (#22514) 2023-03-04 13:05:57 +00:00
1f07307aeb docs(inspect): number → integer (#22511) 2023-03-04 13:05:46 +00:00
ccd2cc1abd docs(uri): number → integer (#22515) 2023-03-04 13:05:16 +00:00
6a20c29dcd docs(filetype): number → integer (#22516) 2023-03-04 13:05:01 +00:00
128b82103b docs(treesitter): number → integer (#22513) 2023-03-04 13:04:05 +00:00
6cab36e5b7 refactor: replace char_u with char or uint8_t (#22400)
Work on https://github.com/neovim/neovim/issues/459
2023-03-04 20:10:00 +08:00
a4f443994b docs(luvref): update to version bump (#22508) 2023-03-04 10:45:20 +01:00
de14f2c928 Merge pull request #22506 from zeertzjq/vim-9.0.0013
vim-patch:9.0.{partial:0013,0016}: fix memory access errors
2023-03-04 14:19:53 +08:00
b7d59649ac fix(redraw): get the line again after evaluating something 2023-03-04 13:53:09 +08:00
808691e399 fix(luado): get old_line length before executing Lua code 2023-03-04 13:53:09 +08:00
98e8464319 vim-patch:9.0.0016: comparing line pointer for 'breakindent' is not reliable
Problem:    Comparing line pointer for 'breakindent' is not reliable.
Solution:   Make a copy of the line.

c2a79b87fc

Test changes have been squashed into the previous commit.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-04 13:53:09 +08:00
0a897f89c5 vim-patch:partial:9.0.0013: reproducing memory access errors can be difficult
Problem:    Reproducing memory access errors can be difficult.
Solution:   When testing, copy each line to allocated memory, so that valgrind
            can detect accessing memory before and/or after it.  Fix uncovered
            problems.

fa4873ccfc

Since test_override() is N/A, enable ml_get_alloc_lines when ASAN is
enabled instead, so it also applies to functional tests.

Use xstrdup() to copy the line as ml_line_len looks hard to port.

Squash the test changes from patch 9.0.0016.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-04 13:53:09 +08:00
446c353a50 vim-patch:9.0.1376: accessing invalid memory with put in Visual block mode (#22505)
Problem:    Accessing invalid memory with put in Visual block mode.
Solution:   Adjust the cursor column if needed.

1c73b65229

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-04 08:39:54 +08:00
b48ad28a3e build(deps): bump Luv to HEAD - e5da6417d (#22502) 2023-03-04 00:32:00 +01:00
0007aa50bd build: unset variables ending with "URL" if USE_EXISTING_SRC_DIR is ON
This will reduce required boilerplate, but more importantly it will
automatically unset variables ending on URL. This will help people
needing to avoid to unset the URL variable each time a new dependency is
added.

It is possible that this may remove a non-download variable ending on
"URL" in the future, however, the risk of this is likely much lower than
the risk of someone forgetting to unset the variable.
2023-03-04 00:30:07 +01:00
7e90f247e7 fix(treesitter): raise ts_match_limit to 256 (#22497)
Problem: Some complex queries may not return all matches.

Solution: Raise `ts_match_limit` from current 64 (twice the original
default) to 256 (which Helix uses, and seems to be enough for the reported
problematic cases).

If this leads performance regressions in other queries, we should add a
generic querying timeout instead of relying on a low value here.
2023-03-03 16:16:17 +01:00
bf90ceb548 fix(treesitter): break early from loop when match is found (#22499)
Fixup to #22484.
2023-03-03 07:52:57 -07:00
a88c18c24e vim-patch:9.0.0527: long sign text may overflow buffer (#22496)
Problem:    Long sign text may overflow buffer.
Solution:   Use a larger buffer.  Prevent for overflow.

2b1ddf19f8

Don't change the size of extra[] as it's already large enough.

N/A patches for version.c:

vim-patch:9.0.0523: more compiler warnings for arguments in small version

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 22:24:12 +08:00
ef52592cf8 Merge #22493 lua2dox.lua, vim.treesitter tags 2023-03-03 09:19:29 -05:00
57f26e0903 docs: lua2dox.lua debugging 2023-03-03 15:07:23 +01:00
8414cfe7f4 docs: fix vim.treesitter tags
Problem:
Help tags like vim.treesitter.language.add() are confusing because
`vim.treesitter.language` is (thankfully) not a user-facing module.

Solution:
Ignore the "fstem" when generating "treesitter" tags.
2023-03-03 15:07:23 +01:00
506ffde1a7 Merge pull request #22442 from bfredl/quickmake
refactor(build): spring cleaning of compile time checks
2023-03-03 14:53:37 +01:00
98e051783c feat(treesitter): bundle query parser and queries (#22483)
skip injections for now
2023-03-03 14:27:30 +01:00
2cffd04833 refactor(build): graduate -Wvla, -fno-common and -Og "features"
These are in gcc 4.9+ which we require anyway.
-Og is safe on clang as well (reserved for a future debug-optimize mode,
and currently does the same as -O1 which is reasonable)
2023-03-03 14:26:29 +01:00
848dac0aaa refactor(build): graduate unibilium VAR_FROM feature from 2017 2023-03-03 14:26:11 +01:00
c9b6db4541 refactor(build): graduate msgpack-c FLOAT32 "feature" since forever 2023-03-03 14:26:10 +01:00
c002fd421e refactor(build): graduate libtreesitter features which are 1+ years old 2023-03-03 14:25:20 +01:00
1b3c1f6c06 refactor(build): graduate HAVE_LOCALE_H feature
Merge locale.h into os/lang.h
Having a source file with the same name as a system header we use is
considered an anti-pattern.
2023-03-03 14:19:46 +01:00
166b149d5b refactor(build): remove unused stdlib function and include checks
In addition: merge some checks for the same feature into one
test_compile. This reduces the total number of test compiles
which speeds up the cmake configure stage.
2023-03-03 14:19:46 +01:00
74c9c413e7 Merge pull request #22484 from gpanders/inspect-tree-fix-cursor
fix(treesitter): maintain cursor position when toggling anonymous nodes
2023-03-03 14:19:09 +01:00
fbaf5bde55 Merge pull request #22494 from zeertzjq/vim-9.0.0531
vim-patch:9.0.{partial:0531,0533}: the win_line() function is much too long
2023-03-03 19:48:53 +08:00
bdde07f60e vim-patch:9.0.0533: the win_line() function is much too long
Problem:    The win_line() function is much too long.
Solution:   Move code to separate functions.

e49f9acecc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 19:28:56 +08:00
a7dbfec9f3 vim-patch:partial:9.0.0531: the win_line() function is much too long
Problem:    The win_line() function is much too long.
Solution:   Move code to separate functions.

c20a41972c

Partial port as this depends on patch 9.0.0148.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 19:28:56 +08:00
bf44556906 refactor(drawline.c): move number column helpers function together 2023-03-03 19:09:53 +08:00
f0a2ffab29 fix(treesitter): typos in _range.lua
fix(treesitter): typos _range.lua
2023-03-03 11:05:59 +00:00
6d4f481821 fix(treesitter): disallow empty filetypes
Fixes #22473
2023-03-03 09:44:02 +00:00
89cccea167 vim-patch:9.0.0519: the win_line() function is much too long (#22491)
Problem:    The win_line() function is much too long.
Solution:   Move the code to draw the line number to a separate function.

d7657e95b2

N/A patches for version.c:

vim-patch:9.0.0521: compiler warns for unused argument in small version

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 17:24:14 +08:00
5311c9048a refactor(win_line): move some variables into a struct (#22490)
This reduces the number of arguments to helpers functions.

N/A patches for version.c:

vim-patch:9.0.0152: warning for unused argument in small build

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 14:50:37 +08:00
1dd2424b12 Merge pull request #22488 from zeertzjq/vim-9.0.1373
vim-patch:9.0.{0690,0691,0991,1373}: listchars fixes
2023-03-03 11:26:22 +08:00
bcf077414c vim-patch:9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Problem:    Wrong text displayed when using both 'linebreak' and 'list'.
Solution:   Only set "c_extra" to NUL when "p_extra" is not empty. (Hirohito
            Higashi, closes vim/vim#12065)

194555c001

Cherry-pick a change from patch 9.0.0153.

Co-authored-by: h-east <h.east.727@gmail.com>
2023-03-03 11:00:47 +08:00
4a3594f60e vim-patch:9.0.0991: crash when reading help index with various options set
Problem:    Crash when reading help index with various options set. (Marius
            Gedminas)
Solution:   Do not set wlv.c_extra to NUL when wlv.p_extra is NULL.
            (closes vim/vim#11651)

c67c89c758

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 07:54:26 +08:00
c2e602b9d0 vim-patch:9.0.0691: lalloc(0) error in listchars test
Problem:    lalloc(0) error in listchars test.
Solution:   Skip generating text for tab if tab_len is zero.

2b7b4f7670

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 07:54:25 +08:00
a974d1511e vim-patch:9.0.0690: buffer size for expanding tab not correctly computed
Problem:    Buffer size for expanding tab not correctly computed.
Solution:   Correctly use size of end character.

a0789478f6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-03 07:54:01 +08:00
361de6d54d vim-patch:9.0.1371: ballooneval interferes with Insert completion (#22487)
Problem:    Ballooneval interferes with Insert completion.
Solution:   Ignore mouse-move events when completing. (closes vim/vim#12094,
            closes vim/vim#12092)

440d4cb55b
2023-03-03 07:44:16 +08:00
fdb6b4d2e7 vim-patch:9.0.1368: Bass files are not recognized (#22485)
Problem:    Bass files are not recognized.
Solution:   Add patterns for Bass files. (Amaan Qureshi, closes vim/vim#12088)

4ed914b18a
2023-03-02 23:29:03 +01:00
4cf4ae93df build: cmake cleanup (#22251)
- Remove unused code
- Use consistent casing. Variable names such as LibLuV_LIBRARIES is
  needlessly jarring, even if the name might be technically correct.
- Use title casing for packages. find_package(unibilium) requires the
  find_module to be named "Findunibilium.cmake", which makes it harder
  to spot when scanning the files. Instead, use "Unibilium".
2023-03-02 22:50:43 +01:00
86ff239240 refactor(treesitter): use string.format to create lines 2023-03-02 14:15:18 -07:00
2eeafc43c4 fix(treesitter): maintain cursor position when toggling anonymous nodes
When toggling anonymous nodes in the :InspectTree window, keep the
cursor fixed relative to the node within the tree. This prevents the
cursor from jumping.
2023-03-02 14:11:15 -07:00
f449121764 feat(treesitter): add :InspectTree command (#22477) 2023-03-02 18:03:11 +01:00
b0b4c31097 refactor: rename show_tree => inspect_tree #22474
Problem:
"show" is potentially a new verb that we can avoid (there is already
"open" and "echo"). Even if we can't avoid it, the behavior of
`show_tree` fits well in the "inspect" family of functions: a way for
users to introspect/reflect on the state of Nvim.

Existing "inspect" functions:
    vim.inspect()
    vim.inspect_pos()
    vim.treesitter.inspect_language()
    nvim__inspect_cell

Solution:
Rename `show_tree` to `inspect_tree`.
2023-03-02 07:01:42 -08:00
a0292b4e5f build: remove libfindmacros library (#22423)
Large parts the library weren't being used, and the parts that were was overly
abstracted for our use case. Additionally, part of its use case was to abstract
pkgconfig boilerplate, which is no longer needed as pkgconfig has been removed
in favor of relying on cmake alone in 09118052ce.
2023-03-02 10:22:41 +01:00
fb1db80f5a test(treesitter/parser_spec): correct time unit (#22471) 2023-03-02 14:42:15 +08:00
bc15b075d1 feat(vim.fs): pass path to find() predicate, lazy evaluate #22378
Problem:
No easy way to find files under certain directories (ex: grab all files under
`test/`) or exclude the content of certain paths (ex. `build/`, `.git/`)

Solution:
Pass the full `path` as an arg to the predicate.
2023-03-01 08:51:22 -08:00
014981c900 fix(lsp): only fire LspDetach for attached buffers (#22468)
If the LSP server fails to start then the client never initializes and
thus never calls its on_attach function and an LspAttach event is
never fired. However, the on_exit function still fires a LspDetach
event, so user autocommands that attempt to "clean up" in LspDetach may
run into problems if they assume that the buffer was already attached.

The solution is to only fire an LspDetach event if the buffer was
already attached in the first place.
2023-03-01 17:47:56 +01:00
f25d126b18 vim-patch:8.2.{1949,2781} (#22451)
vim-patch:8.2.2781: add() silently skips when adding to null list or blob

Problem:    Add() silently skips when adding to null list or blob.
Solution:   Give an error in Vim9 script.  Allocate blob when it is NULL like
            with list and dict.

b7c21afef1

Do not implicitly change a NULL blob/dict/list to an empty one.

N/A patches for version.c:

vim-patch:8.2.1949: Vim9: using extend() on null dict is silently ignored

Problem:    Vim9: using extend() on null dict is silently ignored.
Solution:   Give an error message.  Initialize a dict variable with an empty
            dictionary. (closes vim/vim#7251)

348be7ed07

N/A because Nvim's current behavior is an error message as a locked
list/dict, which is more consistent. Ref #4615.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-01 23:23:39 +08:00
896d672736 fix(lsp): use buffer scheme for files not stored on disk (#22407)
Sending `didOpen` with a `file` scheme causes problems with some
language servers because they expect the file to exist on disk.

See https://github.com/microsoft/language-server-protocol/pull/1679
2023-03-01 15:33:13 +01:00
d66832c76d test(ui): wait for another success with failure after success
Problem:
In a success-failure-success situation, if minimal timeout is reached
between the failure and the second success, the session is stopped
without waiting for the second success, causing the test to fail.

Solution:
Wait for another success if a failure is seen after a success.

Ref #22155 #22464
2023-03-01 20:16:57 +08:00
96d3616a53 fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427) 2023-03-01 11:35:16 +01:00
aa840ab566 test(termxx_spec): fix TermClose bdelete test flakiness (#22463)
Problem:
If shell-test finishes before the next RPC call, TermClose has already
been triggered, so the test fails.

Solution:
Add INTERACT argument so that shell-test keeps running.
2023-03-01 09:56:25 +08:00
999fe94688 vim-patch:9.0.1365: dead test code (#22461)
Problem:    Dead test code.
Solution:   Remove code that depends on Farsi, which has been removed.
            (closes vim/vim#12084)

f0300fc7b8
2023-03-01 08:17:09 +08:00
8bd0a9c360 Merge pull request #22429 from bfredl/hkmap
feat(edit)!: remove old c implementation of hebrew keymap
2023-02-28 19:38:38 +01:00
cf07f2baab feat(edit)!: remove old c implementation of hebrew keymap
This feature has long been obsolete. The 'keymap' option can be used
to support language keymaps, including hebrew and hebrewp (phonetic
mapping). There is no need to keep the old c code with hardcoded
keymaps for some languages.
2023-02-28 15:14:03 +01:00
f289fc4abb Merge pull request #22456 from zeertzjq/vim-9.0.0430
vim-patch:8.2.{4668,4670},9.0.0430: cannot use repeat() with a blob
2023-02-28 21:55:55 +08:00
278aeee3ae vim-patch:9.0.0430: cannot use repeat() with a blob
Problem:    Cannot use repeat() with a blob.
Solution:   Implement blob repeat. (closes vim/vim#11090)

375141e1f8

Co-authored-by: Bakudankun <bakudankun@gmail.com>
2023-02-28 21:27:43 +08:00
1e513fd112 vim-patch:8.2.4670: memory allocation failures for new tab page not tested
Problem:    Memory allocation failures for new tab page not tested.
Solution:   Add tests with failing memory allocation. (Yegappan Lakshmanan,
            closes vim/vim#10067)

72bb47e38f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 21:17:42 +08:00
65af424199 vim-patch:8.2.4668: buffer allocation failures insufficiently tested
Problem:    Buffer allocation failures insufficiently tested.
Solution:   Add tests for memory allocation failures. (Yegappan Lakshmanan,
            closes vim/vim#10064)

0dac1ab579

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 21:17:42 +08:00
faa5d5be4b Merge pull request #22455 from zeertzjq/vim-8.2.3438
vim-patch:8.2.{3438,3446}: blob2list(), list2blob()
2023-02-28 21:13:41 +08:00
011b4c5c62 Merge pull request #22452 from folke/master
fix(inspect): always resolve full treesitter lang hl groups
2023-02-28 14:13:01 +01:00
df1d15a255 Merge pull request #22454 from bfredl/lspredraw
perf(lsp): only redraw the windows containing LSP tokens
2023-02-28 14:11:27 +01:00
ccac34af76 vim-patch:8.2.3446: not enough tests for empty string arguments
Problem:    Not enough tests for empty string arguments.
Solution:   Add tests, fix type check. (Yegappan Lakshmanan, closes vim/vim#8881)

820d5525ca

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 20:46:06 +08:00
f6b9791212 vim-patch:8.2.3438: cannot manipulate blobs
Problem:    Cannot manipulate blobs.
Solution:   Add blob2list() and list2blob(). (Yegappan Lakshmanan,
            closes vim/vim#8868)

5dfe467432

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 20:46:06 +08:00
3f381f4d04 Merge pull request #22453 from zeertzjq/vim-9.0.0795
vim-patch:9.0.{0795,0803,0810}: readblob() offset and size
2023-02-28 20:12:50 +08:00
7e19cabeb1 perf(lsp): only redraw the windows containing LSP tokens
redraw! redraws the entire screen instead of just the windows with
the buffer which were actually changed.

I considered trying to calculating the range for the delta
but it looks tricky. Could a follow-up.
2023-02-28 13:11:36 +01:00
7aad75e293 vim-patch:9.0.0810: readblob() returns empty when trying to read too much
Problem:    readblob() returns empty when trying to read too much.
Solution:   Return what is available.

5b2a3d77d3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 19:52:45 +08:00
4bd0611d7b vim-patch:9.0.0803: readblob() cannot read from character device
Problem:    readblob() cannot read from character device.
Solution:   Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407)

43625762a9

S_ISCHR is always defined in Nvim.

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
bfa0bc7df0 vim-patch:9.0.0795: readblob() always reads the whole file
Problem:    readblob() always reads the whole file.
Solution:   Add arguments to read part of the file. (Ken Takata,
            closes vim/vim#11402)

11df3aeee5

Remove trailing whitespace in test as done in patch 9.0.1257.
Move the help for rand() before range().

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
3b92776226 Merge #22382 has('gui_running') 2023-02-28 06:24:23 -05:00
7574d58304 fix(inspect): alwasy resolve full treesitter lang hl groups 2023-02-28 12:12:08 +01:00
a87b52d328 Merge pull request #22448 from zeertzjq/vim-8.2.2780
vim-patch:8.2.{2780,2782,2783}
2023-02-28 17:13:24 +08:00
55d30c459c vim-patch:8.2.2783: duplicate code for setting byte in blob, blob test may fail
Problem:    Duplicate code for setting byte in blob, blob test may fail.
Solution:   Call blob_set_append().  Test sort failure with "N".

e8209b91b9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 16:51:31 +08:00
88b70e7d46 vim-patch:8.2.2782: Vim9: blob operations not fully tested
Problem:    Vim9: blob operations not fully tested.
Solution:   Make more blob tests run in Vim9 script.  Fix filter().  Make
            insert() give an error for a null blob, like add().

39211cba72

vim-patch:8.2.3284: no error for insert() or remove() changing a locked blob

Problem:    No error for insert() or remove() changing a locked blob.
Solution:   Check a blob is not locked before changing it. (Sean Dewar,
            closes vim/vim#8696)

80d7395dcf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-02-28 16:51:31 +08:00
0ded757c31 vim-patch:8.2.2780: Vim9: for loop over blob doesn't work
Problem:    Vim9: for loop over blob doesn't work.
Solution:   Make it work.

d551d6c268

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 16:51:31 +08:00
66c384d4e8 vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

dd60c365cd

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
8acb3d742c Merge pull request #22447 from zeertzjq/vim-8.2.2777
vim-patch:8.2.{1890,2777}
2023-02-28 15:45:56 +08:00
761a559dbf vim-patch:8.2.2777: Vim9: blob operations not tested in all ways
Problem:    Vim9: blob operations not tested in all ways.
Solution:   Run tests with CheckLegacyAndVim9Success().  Make blob assign with
            index work.

51e933261b

Cherry-pick related changes from patches 8.2.{0633,0634}.

N/A patches for version.c:

vim-patch:8.2.2779: memory access error in remove() for blob

Problem:    Memory access error in remove() for blob.
Solution:   Adjust length for memmove().

f7e92aae15

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 15:21:30 +08:00
99faac8644 vim-patch:8.2.1890: Vim9: strange error for subtracting from a list
Problem:    Vim9: strange error for subtracting from a list.
Solution:   Check getting a number, not a string. (closes vim/vim#7167)

081db1a66d

Cherry-pick eval_addblob() and eval_addlist() from patch 8.2.0149.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 15:21:14 +08:00
befb47f2e1 Merge pull request #22446 from zeertzjq/vim-8.2.2757
vim-patch:8.2.{2757,2765,2767}
2023-02-28 14:12:58 +08:00
1f1227f12b vim-patch:8.2.2767: compiler warning for unused argument
Problem:    Compiler warning for unused argument.
Solution:   Remove the argument.

bd6406f15d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 13:42:33 +08:00
c554e98978 vim-patch:8.2.2765: Vim9: not all blob operations work
Problem:    Vim9: not all blob operations work.
Solution:   Run more tests also with Vim9 script and :def functions.  Fix what
            doesn't work.

0e3ff19196

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 13:42:04 +08:00
adfa55ba99 vim-patch:8.2.2757: Vim9: blob tests for legacy and Vim9 script are separate
Problem:    Vim9: blob tests for legacy and Vim9 script are separate.
Solution:   Add CheckLegacyAndVim9Success().  Make blob index assign work.

68452177ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 13:28:24 +08:00
9a271f6afd fix(column): cmdwin cursor is offset with 'statuscolumn' (#22445) 2023-02-28 10:19:58 +08:00
f113cba3ec refactor(getchar.c): change most char_u to uint8_t (#22444) 2023-02-28 08:49:02 +08:00
1b632e99f2 vim-patch:9.0.1362: ml_get error when going to another tab (#22443)
Problem:    ml_get error when going to another tab. (Daniel J. Perry)
Solution:   Do not call update_topline() if "curwin" is invalid.
            (closes vim/vim#11907)

99ad3a8bb9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 08:26:00 +08:00
2630341db6 fix(tui): avoid stack-use-after-scope with cursor color (#22435) 2023-02-28 07:19:03 +08:00
fb2ead6cf3 docs(usr): make usr_05.txt more coherent with Nvim changes (#22428)
- Make section 05.2 more coherent.
- Remove explanation of options that are already default.
2023-02-27 22:17:12 +00:00
8ecd129f1e fix: address -Wmaybe-uninitialized warnings (#22436) 2023-02-27 22:16:12 +00:00
b50ee4a8dc fix(diff): adjust extmarks after diffput/diffget (#22440)
Problem: on_bytes is not triggered by diffput/diffget if the line count
does not change.
2023-02-27 22:09:12 +00:00
521034edef ci: build all build types on each PR (#22441)
Building with Release and RelWithDebInfo build types only on build
system changes is too optimistic, as shown by
https://github.com/neovim/neovim/pull/22436 and
659234c95a.
2023-02-27 22:47:34 +01:00
f89e3497c8 docs(lsp): update cmd_env description (#22438) 2023-02-27 21:19:41 +01:00
2a8e6a2f1a vim-patch:9.0.1360: Cue files are not recognized (#22439)
Problem:    Cue files are not recognized.
Solution:   Add patterns for Cue files. (Amaan Qureshi, closes vim/vim#12067)

80c5b2c0f7
2023-02-27 21:08:31 +01:00
ce597235a2 feat(ui): restore has('gui_running')
Problem:
has('gui_running') is still common in the wild and our answer has
changed over time, causing frustration.
95a6ccbe9f

Solution:
Use stdin_tty/stdout_tty to decide if a UI is (not) a GUI.
2023-02-27 19:50:59 +01:00
7f424e2b65 feat(api): more fields in nvim_list_uis
Problem:
nvim_list_uis does not report all ":help ui-option" fields.

Solution:
Store ":help ui-option" fields on the `UI` object and update ui_array.
2023-02-27 19:50:59 +01:00
f64098a2df fix(treesitter): fixup for health 2023-02-27 15:33:18 +00:00
3f042854c8 vim-patch:9.0.1361: extendnew() not sufficiently tested (#22434)
Problem:    extendnew() not sufficiently tested.
Solution:   Add a few more test cases for extendnew(). (closes vim/vim#12075)

341f3876b3
2023-02-27 23:27:09 +08:00
5aa37e20e0 fix(treesitter): ipairs -> pairs
Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
2023-02-27 15:01:09 +00:00
da56f06037 fix(treesitter): remove virtual text from playground
Implement the range and lang annotations as comments instead
2023-02-27 10:49:19 +00:00
2c9fbe34b2 vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different type (#22425)
Problem:    Vim9: it is not possible to extend a dictionary with different
            item types.
Solution:   Add extendnew(). (closes vim/vim#7666)

b0e6b51364

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-27 10:10:42 +08:00
d52a3f7c71 Merge pull request #22419 from zeertzjq/vim-9.0.0196
vim-patch:9.0.{0196,partial:0202,0204}: indexof()
2023-02-27 08:14:10 +08:00
1f8cef53de vim-patch:9.0.0204: indexof() may leak memory
Problem:    indexof() may leak memory.
Solution:   Free allocated values. (Yegappan Lakshmanan, closes vim/vim#10916)

63acae13f5

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:53:17 +08:00
13da3d469a vim-patch:partial:9.0.0202: code and help for indexof() is not ideal
Problem:    Code and help for indexof() is not ideal.
Solution:   Refactor the code, improve the help. (Yegappan Lakshmanan,
            closes vim/vim#10908)

3fbf6cd355

Skip CHECK_LIST_MATERIALIZE and set_vim_var_type().
Use tv_list_uidx() instead of lv_idx.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:53:17 +08:00
0972d7a124 vim-patch:9.0.0196: finding value in list may require a for loop
Problem:    Finding value in list may require a for loop.
Solution:   Add indexof(). (Yegappan Lakshmanan, closes vim/vim#10903)

b218655d5a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-27 07:34:59 +08:00
1e37703a74 build: remove pkgconfig-related code (#22422)
Cmake should already be able to find everything on its own.
2023-02-26 22:32:08 +01:00
774e59f3f9 feat(treesitter): expand the API 2023-02-26 16:53:33 +00:00
ed58580dfe Merge pull request #22411 from zeertzjq/vim-9.0.1354
vim-patch:9.0.{1354,1356}: "gr CTRL-G" stays in virtual replace mode
2023-02-26 23:25:37 +08:00
6644742c26 vim-patch:9.0.1356: cannot cancel "gr" with Esc
Problem:    Cannot cancel "gr" with Esc.
Solution:   Make "gr<Esc>" do nothing. (closes vim/vim#12064)

4f026ea9f1

N/A patches for version.c:

vim-patch:9.0.1347: "gr CTRL-O" stays in Insert mode

Problem:    "gr CTRL-O" stays in Insert mode. (Pierre Ganty)
Solution:   Do not set restart_edit when "cmdchar" is 'v'. (closes vim/vim#12045)

2824d1ee32

vim-patch:9.0.1349: "gr" with a count fails

Problem:    "gr" with a count fails.
Solution:   Break out of the loop only after using the count.

3ddb1182b7
2023-02-26 23:04:54 +08:00
5e846978e3 vim-patch:9.0.1354: "gr CTRL-G" stays in virtual replace mode
Problem:    "gr CTRL-G" stays in virtual replace mode. (Pierre Ganty)
Solution:   Prepend CTRL-V before control characters. (closes vim/vim#12045)

d6a4ea3aa0

Cherry-pick Test_edit_gr_special() from patch 9.0.1347.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-26 23:01:50 +08:00
48990a7077 Merge pull request #22417 from bfredl/antifree
fix(build): fix invalid use of EXITFREE
2023-02-26 14:20:26 +01:00
659234c95a fix(build): fix invalid use of EXITFREE
fixup 6942528 refactor(ui): ui_log() can now just be a function
2023-02-26 13:55:29 +01:00
aaea48aac6 build: set libtermkey project language to C (#22410)
This will prevent cmake from failing the build if a C++ compiler isn't
found.
2023-02-26 13:32:37 +01:00
f3476f2f99 Merge pull request #22408 from bfredl/ui_log
refactor(ui): ui_log() can now just be a function
2023-02-26 11:32:01 +01:00
1d8b77da6b fix(MSVC): set the active code page to utf-8 (#22384)
Neovim expects character encoding to be UTF-8, and deviation from this
causes bugs such as lua files not being recognized for non-ascii paths.
This changes the behavior of fopen, which defaults to using the
currently active codepage.

Closes: https://github.com/neovim/neovim/issues/18122
2023-02-26 08:12:41 +08:00
6942528a54 refactor(ui): ui_log() can now just be a function 2023-02-25 23:29:00 +01:00
c1514d7e67 fix(lsp): fix some type annotations (#22397) 2023-02-25 18:47:05 +01:00
db32d312ac ci(fix): repair regen-api-docs (#22403)
https://github.com/neovim/neovim/pull/22398 broke the job because there
is no `build/bin/nvim`

This keeps the preference for `build/bin/nvim` but adds back `nvim` as
fallback if it doesn't exist.
2023-02-25 17:24:43 +01:00
2708507e87 docs: use build/bin/nvim instead of nvim in gen_vimdoc (#22398)
Problem:

`nvim` could point to stable release missing the `nvim -l`
functionality.

Solution:

Require to build nvim first and use `build/bin/nvim`
2023-02-25 16:35:45 +01:00
f0f27e9aef Revert "feat(lsp): implement workspace/didChangeWatchedFiles (#21293)"
This reverts commit 5732aa706c.

Causes editor to freeze in projects with many watcher registrations
2023-02-25 11:17:28 +01:00
5732aa706c feat(lsp): implement workspace/didChangeWatchedFiles (#21293) 2023-02-25 10:07:18 +01:00
a601d03112 build: build luajit in parallel (#22327)
Add -j flag to the make command for luajit. Cuts down dependency build time by 40% when using the Ninja generator.
2023-02-24 21:17:23 +01:00
15cce77b38 vim-patch:9.0.1351: Dhall files are not recognized (#22393)
Problem:    Dhall files are not recognized.
Solution:   Add patterns for Dhall files. (Amaan Qureshi, closes vim/vim#12052)

def5521752

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 17:50:37 +01:00
4297127f14 vim-patch:9.0.1350: CPON files are not recognized (#22392)
Problem:    CPON files are not recognized.
Solution:   Add patterns for CPON files. (Amaan Qureshi, closes vim/vim#12053)

c2254764bc

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 15:34:52 +01:00
1803dadb20 refactor(lsp): remove deprecated code (#22389) 2023-02-24 12:55:50 +01:00
04a6369da5 refactor(PVS/V581): merge identical if statements (#22390) 2023-02-24 19:05:39 +08:00
c57af5d41c feat(treesitter)!: remove silent option from language.add()
Simply use `pcall` if you want to silence an error.
2023-02-24 09:50:59 +00:00
306e673583 Merge pull request #22386 from zeertzjq/vim-8.2.2449
vim-patch:8.2.{2449,4627,4629,4632}: flattennew(), flatten() fixes
2023-02-24 16:01:47 +08:00
c76dfe14b1 vim-patch:8.2.4632: using freed memory in flatten()
Problem:    Using freed memory in flatten().
Solution:   Clear typval after recursing into list.

f3980dc5d0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
ec25572367 vim-patch:8.2.4629: flattennew() makes a deep copy unnecessarily
Problem:    flattennew() makes a deep copy unnecessarily.
Solution:   Use a shallow copy. (issue vim/vim#10012)

c6c1ec4da5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
d9263688bf vim-patch:8.2.4627: flatten() does not use maxdepth correctly
Problem:    flatten() does not use maxdepth correctly.
Solution:   Use a recursive implementation. (closes vim/vim#10020)

acf7d73a7f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
904d099583 vim-patch:8.2.2449: Vim9: flatten() always changes the list type
Problem:    Vim9: flatten() always changes the list type.
Solution:   Disallow using flatten() and add flattennew().

3b69006973

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 15:36:08 +08:00
47bc297d81 vim-patch:8.2.4318: various comment and indent mistakes, returning wrong zero (#22385)
Problem:    Various comment and indent mistakes, returning wrong zero.
Solution:   Fix the mistakes.  Return NULL instead of FAIL.

54969f4ef5

N/A patches for version.c:

vim-patch:8.2.3781: the option window script is outdated

Problem:    The option window script is outdated.
Solution:   Add several changes.

a416861c64

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-24 12:35:06 +08:00
5e1308b7ca vim-patch:9.0.1348: Un-grammar files are not recognized (#22383)
Problem:    Un-grammar files are not recognized.
Solution:   Add patterns for Un-grammar files. (Amaan Qureshi, closes vim/vim#12034)

44e08c1cf8
2023-02-23 22:12:01 +01:00
3f35ebb14d fix(treesitter): fixup language invalidation (#22381) 2023-02-23 18:09:44 +00:00
1df3f5ec6a feat(treesitter): upstream foldexpr from nvim-treesitter 2023-02-23 17:05:20 +00:00
8c339aa04b vim-patch:9.0.1346: Starlark files are not recognized (#22380)
Problem:    Starlark files are not recognized.
Solution:   Add patterns for Starlark files. (Amaan Qureshi, closes vim/vim#12049)

ca06b30073

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-23 17:52:33 +01:00
75e53341f3 perf(treesitter): smarter languagetree invalidation
Problem:
  Treesitter injections are slow because all injected trees are invalidated on every change.

Solution:
    Implement smarter invalidation to avoid reparsing injected regions.

    - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change.
    - Add valid flags for each region in self._regions.
    - Call on_bytes recursively for all children.
       - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children.

This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.
2023-02-23 15:19:52 +00:00
8680715743 fix: resolve error from -Werror=maybe-uninitialized 2023-02-23 15:08:39 +00:00
f140175564 refactor(lsp): remove workaround for missing bit module (#22373) 2023-02-23 13:35:46 +01:00
0cd0fdf478 Merge pull request #22357 from clason/docs-ts
* Work around tree-sitter-vimdoc parsing errors introduced in a recent PR.
* Drop the tolerance of the test to 0 to make sure this doesn't happen again.
2023-02-23 13:02:15 +01:00
6dfbeb0d99 docs: fix more treesitter parsing errors 2023-02-23 10:25:22 +01:00
1c37553476 test(help): drop treesitter parse error to 0
All parser errors have been fixed; make sure we don't introduce new
ones.
2023-02-23 10:24:15 +01:00
05de0f4fea docs(treesitter): fix parse errors 2023-02-23 10:24:15 +01:00
524e1a0643 fix(highlight): avoid ORing underline flags (#22372)
When combining attributes use the one that takes priority.
For :highlight command use the last one specified.
For API use a hard-coded order same as the order in docs.
2023-02-23 16:15:04 +08:00
d422fc8274 Merge pull request #21222 from bfredl/bitband
feat(lua): make sure require'bit' always works, even on PUC LUA 5.1
2023-02-22 22:38:21 +01:00
799edca18a feat(lua): make sure require'bit' always works, even with PUC lua 5.1 2023-02-22 22:15:19 +01:00
09b6a68c37 Merge #21428 docs: naming conventions, guidelines 2023-02-22 10:40:01 -05:00
6752f1005d docs: naming conventions, guidelines
close #21063
2023-02-22 16:23:49 +01:00
0b36145c69 docs: mention getmousepos() for click execute function label
close #18741
close #11312
2023-02-22 16:23:49 +01:00
b496605fea docs: vim_diff.txt 2023-02-22 16:23:49 +01:00
675826da63 refactor(treesitter): Add vim.treesitter.get_node() (#22360)
This function replaces both vim.treesitter.get_node_at_pos() and
vim.treesitter.get_node_at_cursor(). These two functions are similar
enough that they don't need separate interfaces. Even worse,
get_node_at_pos() returns a TSNode while get_node_at_cursor() returns a
string, so the two functions behave slightly differently.

vim.treesitter.get_node() combines these two into a more streamlined
interface. With no arguments, it returns the node under the cursor in
the current buffer. Optionally, it can accept a buffer number or a
position to get the node at a given position in a given buffer.
2023-02-22 08:01:08 -07:00
2281669470 build(deps): bump LuaJIT to HEAD - 505e2c03d (#22362) 2023-02-22 14:44:11 +01:00
d1b34b7458 vim-patch:9.0.1337: yuck files are not recognized (#22358)
Problem:    Yuck files are not recognized.
Solution:   Add a filetype pattern for yuck files. (Amaan Qureshi,
            closes vim/vim#12033)

cfce5cf542

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-22 10:58:15 +01:00
649742821a docs: remove the test badge from the README (#22350)
Tests are flaky, and a failure doesn't necessarily impart useful
information. Furthermore, we don't need to link to the tests as it's
just as easy to reach it from the Actions tab.
2023-02-21 22:21:35 +01:00
8714a4009c feat(treesitter): add filetype -> lang API
Problem:

  vim.treesitter does not know how to map a specific filetype to a parser.

  This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang.

Solution:

  Add an API to enable this:

  - Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language().
    - Optional arguments are now passed via an opts table.
    - Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs.
    - Deprecated vim.treesitter.language.require_language().
  - Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype.
  - Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
2023-02-21 17:09:18 +00:00
344a1ee8e6 docs: fix typos (#22353) 2023-02-22 00:07:26 +08:00
ee26b227e1 vim-patch:partial:938ae280c79b (#22356)
Update runtime files.

938ae280c7

Partially skip autocmd.txt: needs patch 8.2.5011.
Partially skip builtin.txt: needs patch 9.0.0411.
Partially skip eval.txt: needs patch 8.2.3783.
Cherry-pick :map-meta-keys from patch 9.0.1276.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-21 23:50:29 +08:00
d18f8d5c2d ci: use multi-config generator on the multi-config test (#22352) 2023-02-21 14:01:49 +01:00
2d99830706 refactor(man): add type annotations 2023-02-21 12:19:09 +00:00
fec1181ecd test(legacy/prompt_buffer_spec): align script with oldtest more (#22354) 2023-02-21 17:43:53 +08:00
f0ee548137 ci(backport): bump zeebe-io/backport-action from 0 to 1 (#22348)
Notable changes are performance increases for fetching repositories and
simpler workflow file.
2023-02-21 07:43:17 +01:00
bdf6d8733e fix(lsp): wrong format of bufnr and client order in error message (#22336) 2023-02-21 07:24:47 +01:00
286777c333 refactor(tui/input.c): remove unused multithreading code (#22342) 2023-02-21 08:01:16 +08:00
96b6b27f74 ci: add dependabot to auto-update github actions (#22341)
This will ensure we don't accidentally have outdated actions.
2023-02-20 22:24:27 +01:00
3264cb294e fix(ci/release/winget): bump action version 2023-02-20 21:23:08 +01:00
3507474611 vim-patch:9.0.1332: crash when using buffer-local user command in cmdline window (#22346)
Problem:    Crash when using buffer-local user command in cmdline window.
            (Karl Yngve Lervåg)
Solution:   Use the right buffer to find the user command. (closes vim/vim#12030,
            closes vim/vim#12029)

b444ee761a
2023-02-20 23:55:42 +08:00
93c627b90b vim-patch:9.0.1331: illegal memory access when using :ball in Visual mode (#22343)
Problem:    Illegal memory access when using :ball in Visual mode.
Solution:   Stop Visual mode when using :ball. (Pavel Mayorov, closes vim/vim#11923)

e1121b1394

Co-authored-by: Pavel Mayorov <pmayorov@cloudlinux.com>
2023-02-20 23:02:05 +08:00
f1816f9ee2 refactor(main.c): remove unreachable use_builtin_ui conditions (#22338)
When use_builtin_ui is true, Nvim will exit before line 385 is reached.
2023-02-20 15:13:55 +08:00
b62c0c8d9c docs: fix typos (#21961)
Co-authored-by: Ben Morgan <cassava@iexu.de>
2023-02-20 15:12:59 +08:00
8784f064f1 vim-patch:9.0.1329: completion of map includes simplified ones (#22335)
Problem:    Completion of map includes simplified ones.
Solution:   Do not complete simplified mappings. (closes vim/vim#12013)

997b8a015c
2023-02-20 08:24:49 +08:00
020d3e355e build: remove unused dependency penlight (#22334) 2023-02-19 22:27:12 +01:00
5ffd3d035d build: build all dependencies in parallel (#22329)
Previously, all targets were connected in one main target called
third-party in order to remove any potentially conflicting shared
library. We can make each dependency target independent of each other by
only removing shared libraries from luajit and msgpack in their own
targets, as only these has unwanted shared libraries.
2023-02-19 21:11:27 +01:00
bfe6b49447 build(MSVC): enable assertions on RelWithDebInfo build type (#22326) 2023-02-19 15:06:53 +01:00
4028731900 fix(tui): properly check if stdin is a tty (#22321)
After #21831 `in_fd` is no longer set to stderr when starting TUI, so
check for `stdin_isatty` instead.

Fix #22259.
2023-02-19 20:56:15 +08:00
c726585ce1 fix: windows assertion failure due to incorrect path length (#22324)
This commit fixes an assertion failure on windows debug builds that was
introduced in https://github.com/neovim/neovim/pull/22128 .
2023-02-19 20:25:29 +08:00
cbd4480f97 vim-patch:9.0.1324: "gj" and "gk" do not move correctly over a closed fold (#22320)
Problem:    "gj" and "gk" do not move correctly over a closed fold.
Solution:   Use the same code as used for "j"/"k" to go to the next/previous
            line. (Luuk van Baal, closes vim/vim#12007)

441a7a9448
2023-02-19 08:33:02 +08:00
2f64137974 vim-patch:9.0.1319: PRQL files are not recognized (#22319)
Problem:    PRQL files are not recognized.
Solution:   Add a filetype pattern for PRQL files. (Matthias Queitsch,
            closes vim/vim#12018)

9de960ace0

Co-authored-by: Matthias Queitsch <matthias.queitsch@mailbox.org>
2023-02-19 01:27:32 +01:00
53841df58d fix: Add missing void as function argument (#22317) 2023-02-18 21:35:27 +01:00
458299df79 fix: remove "Compiled by:" from :version/--version (#22316)
The :version output is already crowded as is, the last thing we need is
extraneous messages about who compiled it.
2023-02-18 20:10:00 +01:00
db849517c6 fix: remove "Features" section from --version/:version (#22315)
Neovim doesn not have any optional features.
2023-02-18 19:06:38 +01:00
9301abdf74 ci: enable CI_BUILD automatically if environment variable CI is true (#22312)
Having to specify CI_BUILD for every CI job requires boilerplate. More
importantly, it's easy to forget to enable CI_BUILD, as seen by
8a20f9f98a. It's simpler to remember to
turn CI_BUILD off when a job errors instead of remembering that every
new job should have CI_BUILD on.
2023-02-18 17:43:39 +01:00
6ed5a9ab8c build: test multi-config generator (#22310)
Multi-config generators can be tricky so testing them would be good.
Also test GCC release and MinSizeRel build types as they're prone to
unusual warnings. Remove release testing from test.yml as this is a
sufficient replacement.
2023-02-18 16:54:19 +01:00
e8540c31a9 docs(README): fix CI status badge (#22308)
Use test.yml and link to that workflow, as build.yml is mostly
only for checking CMake files.
2023-02-18 18:38:47 +08:00
fc8c77a69f ci: split ci.yml into a test workflow and a build test workflow (#22302)
Having a workflow that only builds neovim without running all of the
tests is a cheap way to test the build still works without burning too
much CI time.
2023-02-18 10:47:22 +01:00
f43fa301c1 fix(lsp): check if the buffer is a directory before w! it (#22289) 2023-02-18 07:43:59 +01:00
44da6a56ba Merge pull request #22304 from zeertzjq/test-fix
Fix some mistakes and warnings in tests
2023-02-18 11:07:31 +08:00
9381d08e29 test(tui_spec): use RPC request to setup autocommands
This avoids changing cmdline and fixes a warning.
2023-02-18 10:44:35 +08:00
9b9f8dfcc4 test: make {MATCH:} behave less unexpectedly in screen:expect()
Include the rest of the line and allow multiple {MATCH:} patterns.
2023-02-18 10:44:35 +08:00
bb369a14f3 Merge pull request #22303 from zeertzjq/vim-9.0.1315
vim-patch:9.0.1315: escaping for completion of map command not properly tested
2023-02-18 07:29:41 +08:00
fbb27a101f ci: remove former dependencies that are no longer needed (#22301)
libtool, autoconf, automake and perl are no longer dependencies of
neovim and doesn't need to be installed in CI anymore. The dependencies
and the commit that removed them as dependencies are the following:

libtool: b05100a9ea
perl: 20a932cb72
autoconf+automake: e23c5fda0a
2023-02-18 00:09:51 +01:00
afe34d92a7 vim-patch:9.0.1315: escaping for completion of map command not properly tested
Problem:    Escaping for completion of map command not properly tested.
Solution:   Add a few test cases. (closes vim/vim#12009)

c3a26c6bff
2023-02-18 07:05:48 +08:00
75dab3cf07 fix(mappings): make "<" escaping in completion match Vim 2023-02-18 07:05:48 +08:00
f905ab0450 build(deps): bump tree-sitter to HEAD - c51896d32 (#22296) 2023-02-17 12:53:09 +01:00
371a74e4e1 fix(tui): only forward stdin_fd on first attach (#22293) 2023-02-17 11:19:40 +08:00
d079c8cc5d ci: change functionaltest timeout to 20 minutes (#22294)
15 minutes is too short for TSAN.
2023-02-17 11:06:56 +08:00
477bbb5f5f Merge pull request #22291 from zeertzjq/vim-8.2.0148
vim-patch:8.2.0148
2023-02-17 09:35:34 +08:00
f6a6db3e24 vim-patch:8.2.0148: mapping related function in wrong source file
Problem:    Mapping related function in wrong source file.
Solution:   Move the function.  Add a few more test cases. (Yegappan
            Lakshmanan, closes vim/vim#5528)

7f51bbe0d1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-17 08:47:44 +08:00
df666521ac fix(mappings): fix check for cpo-B inverted in completion 2023-02-17 08:47:44 +08:00
dea311b33d test(old): run some part of 'cpoptions' tests 2023-02-17 08:34:19 +08:00
0326ef2f41 vim-patch:9.0.1314: :messages behavior depends on 'fileformat' of current buffer (#22286)
Problem:    :messages behavior depends on 'fileformat' of current buffer.
Solution:   Pass the buffer pointer to where it is used. (Mirko Ceroni,
            closes vim/vim#11995)

1d87e11a1e

Co-authored-by: cero1988 <mirkoceroni@mirkoceroni.it>
2023-02-17 07:15:24 +08:00
6dfabd0145 build: use libuv config file (#22209)
Libuv's recent changes in their pc file breaks cmake; they are using
-l:libuv.a for the linker, and it seems cmake can't resolve that.

Prefer using their cmake config file instead instead, and use the find
module as a fall-back in case it fails.

Closes https://github.com/neovim/neovim/issues/22271.
2023-02-16 22:09:05 +01:00
bb377afd32 build: use custom command to create single versiondef (#22290)
When using a multi config generator, CMake generates an output file for
each configuration when using file(GENERATE). When the contents of the
file for each configuration are different, CMake fails. Instead, create
separate files for each configuration and add a build time step to copy
the configuration specific file to the generic path "auto/versiondef.h"
which is included at build time.
2023-02-16 21:52:41 +01:00
ced0cd12d0 build: only use HOSTNAME_PRG if HOSTNAME is undefined (#22288)
Allow specifying the HOSTNAME variable by defining it with -D when
invoking CMake, instead of overriding it with the output of
HOSTNAME_RPG.
2023-02-16 12:36:55 -07:00
5688a9fb34 fix: lsp github issue template example (#22285) 2023-02-16 19:54:52 +01:00
b5922bc6e6 refactor(drawline.c): leadcol/trailcol 2023-02-16 15:47:50 +00:00
09b3432eaf fix(api): allow empty Lua table for nested dicts #22268
Problem:
The Lua-API bridge allows Dict params to be empty Lua (list) tables at
the function-signature level. But not for _nested_ Dicts, because they
are not modeled:
fae7540732/src/nvim/api/keysets.lua (L184)
Some API functions like nvim_cmd check for kObjectTypeDictionary and
don't handle the case of empty Lua tables (treated as "Array").

Solution:
Introduce VALIDATE_T_DICT and use it in places where
kObjectTypeDictionary was being checked directly.

fixes #21005
2023-02-16 07:07:18 -08:00
bcae4af374 docs: remove mentions of 'balloonexpr' #22049
'balloonexpr' option was removed in Nvim.
2023-02-16 06:54:25 -08:00
5420bf9998 fix(lintcommit): capitalized description #22282
Problem:
The "Capitalized" check should only check the first word of a description.

Solution:
Specify "^".
2023-02-16 06:43:05 -08:00
d34c64e342 feat: $NVIM_APPNAME #22128
This commit implements the ability to control all of the XDG paths
Neovim should use. This is done by setting an environment variable named
NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for
its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of
$XDG_CONFIG_HOME/nvim.

If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as
default.

The usecase for this feature is to enable an easy way to switch from
configuration to configuration. One might argue that the various $XDG
environment variables can already be used for this usecase. However,
setting $XDG environment variables also affects tools spawned by Neovim.
For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a
different configuration directory, it will also prevent Git from finding
its "default" configuration.

Closes https://github.com/neovim/neovim/issues/21691
2023-02-16 04:15:02 -08:00
631775c05d Merge pull request #22277 from zeertzjq/vim-8.2.0114
vim-patch:8.2.{0114,0154}: info about sourced scripts is scattered
2023-02-16 12:40:46 +08:00
0cbbe27e93 vim-patch:8.2.0154: reallocating the list of scripts is inefficient
Problem:    Reallocating the list of scripts is inefficient.
Solution:   Instead of using a growarray of scriptitem_T, store pointers and
            allocate each scriptitem_T separately.  Also avoids that the
            growarray pointers change when sourcing a new script.

21b9e9773d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-16 11:50:28 +08:00
e619fb1660 vim-patch:8.2.0114: info about sourced scripts is scattered
Problem:    Info about sourced scripts is scattered.
Solution:   Use scriptitem_T for info about a script, including s: variables.
            Drop ga_scripts.

7ebcba61b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-16 11:50:28 +08:00
5dc4eaf386 Merge pull request #22275 from zeertzjq/vim-9.0.1309
vim-patch:9.0.{1309,1310,1312}: scrolling two lines with even line count and 'scrolloff'
2023-02-16 08:37:42 +08:00
0bb3a373d3 vim-patch:9.0.1312: Cursor position wrong when splitting window in insert mode
Problem:    Cursor position wrong when splitting window in insert mode.
Solution:   Pass the actual mode to win_fix_cursor(). (Luuk van Baal,
            closes vim/vim#11999,

bc3dc298b3

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-02-16 08:09:41 +08:00
a2dd7fa97b vim-patch:9.0.1310: 'splitkeep' test has failures
Problem:    'splitkeep' test has failures.
Solution:   Adjust expected cursor line position.

fdbd14e892

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-16 08:09:41 +08:00
968cd1ed93 vim-patch:9.0.1309: scrolling two lines with even line count and 'scrolloff' set
Problem:    Scrolling two lines with even line count and 'scrolloff' set.
Solution:   Adjust how the topline is computed. (closes vim/vim#10545)

1d6539cf36

Cherry-pick test_scroll_opt.vim changes from patch 8.2.1432.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-16 08:09:41 +08:00
f1c5887377 ci: add GCC Release testing (#22274)
ci: add GCC release testing

We currently have no release testing, so it's good to check for any
unwanted behavior on release builds as well. Prefer GCC over clang, as
GCC release builds seem to create more warnings on release compared to
debug.
2023-02-16 00:15:09 +01:00
da3cb6ebe4 dist: use valid application id in nvim.appdata.xml #22046
According to [AppStream spec](https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-id-generic),
the <id> element should contain a reverse-DNS scheme:

    {tld}.{vendor}.{product}

Since the flathub requires that, the flatpak build replaces `<id>nvim</id>` with
`<id>io.neovim.nvim</id>`. That results in ID mismatch between flatpak version
and version from distribution's repositories. Because of that, software stores
are displaying two different neovims, instead of one neovim with options to
download it either from flatpak or from distribution's repos. We can use the
`<provides><id>nvim</id></provides>`, for everyone who was expecting the id to
be `nvim`.
2023-02-15 15:11:49 -08:00
f006313e95 Merge pull request #22056 from lewis6991/refactor/fileio_more
refactor `fileio.c`
2023-02-15 16:45:20 +00:00
ec782211f2 fix(tui): set taskbar, icon in Windows #22270
Problem: After TUI refactor commit, code for setting Windows taskbar
icon wasn't being executed because of a backdated conditional.

Solution: Update the conditional to take TUI refactor into account.

Ref: https://github.com/neovim/neovim/pull/20634#discussion_r1088993820
2023-02-15 07:39:23 -08:00
a289e82142 fix(treesitter): make params optional 2023-02-15 12:26:07 +00:00
2e450efb95 feat(treesitter)!: remove g:ts_highlight_lua (#22257)
This variable was only meant for easy testing during the development
cycle for treesitter highlighting while Lua was the only parser useable
for daily driving. Now that we have a good vimdoc parser, this approach
simply doesn't scale and should be removed sooner rather than later.

Instead of setting this variable, people for now should add the autocommand
directly to their config:
```lua
vim.api.nvim_create_autocmd('FileType', {
  pattern = 'lua', -- or { 'lua', 'help' }
  callback = function() vim.treesitter.start() end,
})
```
(or put `vim.treesitter.start()` in an `ftplugin`).
2023-02-15 09:55:23 +01:00
ae7653b74c fix(win_update): don't use unintialized memory in edge case (#22266)
This fixes two clang warnings.

Using an unintialized "cursorline_fi" without assigning to it is not
something that should normally happen, and in case it happens it will
likely cause another redraw, but still don't use unintialized memory.
2023-02-15 16:53:53 +08:00
8307ed3a19 revert: "build: remove ENABLE_COMPILER_SUGGESTIONS option" (#22265)
This reverts commit 1d6bb0892b.

See: https://github.com/neovim/neovim/pull/22249#issuecomment-1430548550
2023-02-15 08:51:40 +01:00
1539f71363 Merge #22214 move init_default_autocmds to lua 2023-02-14 19:13:12 -05:00
05faa8f30a test: make expect_unchanged() less confusing (#22255)
Problem:
The sleep before collecting the initial screen state is confusing and
may lead to unexpected success if it comes after a blocking RPC call.

Solution:
Remove that sleep and add an "intermediate" argument.
2023-02-15 07:26:55 +08:00
556f8646c0 refactor(api): consistent VALIDATE messages #22262
Problem:
Validation messages are not consistently formatted.
- Parameter names sometimes are NOT quoted.
- Descriptive names (non-parameters) sometimes ARE quoted.

Solution:
Always quote the `name` value passed to a VALIDATE macro _unless_ the
value has whitespace.
2023-02-14 11:19:28 -08:00
e03ecb7d31 fix: uv_tty_set_mode failed in Windows #22264
Problem:  uv_tty_set_mode on stdout in Windows exits with error.
Cause:    Windows cannot set the properties of the output of a tty.
Solution: Remove call to uv_tty_set_mode.

Ref: #21445
Ref: 88634c1405 (r100598822)
2023-02-14 11:15:28 -08:00
b4a92309f8 ci: print DLL copy messages only in CI environment (#22260)
In Windows, library DLL's are copied in the building process, and a message for each copy is printed. This is useful to have in the log of CI, but annoying to see when you're building and rebuilding nvim constantly. Work around this issue by only enabling the messages on CI.
2023-02-14 18:58:38 +01:00
9a9a4d38a8 Merge pull request #11756 from bfredl/crashfix
custom statusline crash containing unprintable unicode
2023-02-14 18:51:56 +01:00
39f8aaeb81 fix(status): handle unprintable chars in the statusline 2023-02-14 15:56:14 +01:00
264fb6945b Merge pull request #22113 from luukvbaal/nrwidth
fix(column): no longer reset nrwidth_line_count for 'statuscolumn'
2023-02-14 14:37:01 +00:00
00c0a52f94 Merge pull request #22108 from luukvbaal/statuscolumn
perf(column): only build fold/sign column when present in 'statuscolumn'
2023-02-14 14:36:12 +00:00
ff3d04b75b refactor(api): VALIDATE macros #22256
- VALIDATE() takes a format string
- deduplicate check_string_array
- VALIDATE_RANGE
- validate UI args
2023-02-14 05:07:38 -08:00
3a6a7add57 test: remove unused field ext_float (#22243) 2023-02-14 18:26:22 +08:00
46a87a5d2b refactor(api): VALIDATE macros #22187
Problem:
- API validation involves too much boilerplate.
- API validation errors are not consistently worded.

Solution:
Introduce some macros. Currently these are clumsy, but they at least
help with consistency and avoid some nesting.
2023-02-14 02:19:04 -08:00
5396808267 fix(folds): cursorline highlight is not always applied on closed folds (#22242)
Problem:    The cursorline highlight logic checks for `w_cursor.lnum`
            which may be different from the line number passed to
            `win_line()` even when the cursor is actually on that line.
Solution:   Update cursor line highlight logic to check for the line
            number of the start of a closed fold if necessary.
2023-02-14 15:52:22 +08:00
20c9f4b352 vim-patch:9.0.1307: setting 'formatoptions' with :let doesn't check for errors (#22252)
Problem:    Setting 'formatoptions' with :let doesn't check for errors.
Solution:   Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan,
            closes vim/vim#11974, closes vim/vim#11972)

32ff96ef01

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-14 08:29:05 +08:00
fc9ece617b Merge pull request #22244 from zeertzjq/tui-eof
fix(tui): exit on input eof
2023-02-14 08:12:32 +08:00
820430dc0b fix(tui): exit on input eof 2023-02-14 07:49:31 +08:00
5a8039a0cb test(tui_spec): remove unnecessary arguments for remote UI 2023-02-14 07:49:31 +08:00
b518aceaa8 feat(filetype): fall back to file extension when matching from hashbang (#22140)
If nothing matched in match_from_hashbang, also check the file extension table.
For a hashbang like '#!/bin/env foo', this will set the filetype to 'fooscript'
assuming the filetype for the 'foo' extension is 'fooscript' in the extension
table.
2023-02-13 16:04:16 -07:00
1d6bb0892b build: remove ENABLE_COMPILER_SUGGESTIONS option (#22249)
We need higher level and more meaningful cmake options. Having a cmake
option for only controlling compiler flags is probably not worth it as
the same can be achieved with:

cmake -B build -D CMAKE_C_FLAGS=<compiler option>
2023-02-13 20:55:49 +01:00
bb9c673d2c ci: automatically maximize MIN_LOG_LEVEL if CI detected (#22248)
Detect if on CI by checking that the CI environment variable is set to "true".
This is a common pattern among CI providers, including github actions and
cirrus.
2023-02-13 20:04:54 +01:00
84cf6a0a7e ci(lintcommit): allow UPPER_CASE first word (#22245) 2023-02-13 18:26:27 +01:00
9de9bd4bed ci: replace cmake script with bash script (#22246)
Bash has better error handling than cmake, and seem overall slightly
more suited to scripting than cmake.
2023-02-13 18:26:01 +01:00
d359f7a533 Merge pull request #22191 from lewis6991/feat/playground_imp
feat(treesitter): playground improvements
2023-02-13 10:54:03 +00:00
89722ddfac Merge pull request #22233 from zeertzjq/resize-screenclear
fix(ui): make sure screen is valid after resizing
2023-02-13 09:46:16 +08:00
41ebe41b62 fix(ui-ext): force cursor update after resize in char-based UI
Neither ui/screen.lua nor Neovim Qt keep cursor position after resizing.
2023-02-13 08:50:54 +08:00
c2375efe56 fix(ui): make sure screen is valid after resizing
Problem:
When not inside an Ex command, screen_resize() calls update_screen(),
which calls screenclear() and set the screen as valid. However, when
inside an Ex command, redrawing is postponed so update_screen() screen
doesn't do anything, and the screen is still invalid after the resize,
causing ui_comp_raw_line() to be no-op until update_screen() is called
on the main loop.

Solution:
Restore the call to screenclear() inside screen_resize() so that the
screen is invalid after screen_resize(). Since screenclear() changes
redraw type from UPD_CLEAR to UPD_NOT_VALID, it is called at most once
for each resize, so this shouldn't change how much code is run in the
common (not inside an Ex command) case.
2023-02-13 08:50:54 +08:00
5d3769ea23 ci: install dependencies with a single script (#22241)
It's easier if the os-specific installations are done by the script itself
2023-02-12 22:09:10 +01:00
5f72ab77bf refactor: reduce scope of locals as per the style guide 3 (#22221)
refactor: reduce scope of locals as per the style guide
2023-02-12 18:48:49 +01:00
2b1c07a1d4 ci: remove unnecessary matrix from codeql workflow (#22239) 2023-02-12 18:12:17 +01:00
477d4bbf5f ci: inline external environment scripts (#22237)
Scripts that define the build itself shouldn't be external as they lead
to hard to find bugs.
2023-02-12 18:08:37 +01:00
47638706a3 build: treat clang-tidy warnings as errors (#22238) 2023-02-12 17:41:54 +01:00
f573fcbc0d build: don't check environment variable to detect CI (#22234)
Instead use the cmake option, which should act as the definitive source
to determine whether we use CI or not.
2023-02-12 14:42:00 +01:00
c099836168 ci: convert environment variables to matrix variables (#22224)
Having as few indirections as possible makes it easier to understand the
code.
2023-02-12 13:09:46 +01:00
e81b4274fc ci: delete ci/ (#22227)
Having CI scripts that is separate from the build system causes
tremendous amounts of problems, headaches and bugs. Testing the validity
of the scripts locally become near impossible as time goes on as they're
only vetted if it works on whatever CI provider we happened to have at
the time, with their own quirks and behavior.

The extra indirection between "cmake <-> general CI scripts <-> GHA" is
also a frequent source of problems, as the orchestration needs to be
done with environment variables, cmake flags and github actions matrix
strategy. This combination has turned out to be exceptionally fragile.

Examples:
15394b6855
13aa23b62a
https://github.com/neovim/neovim/pull/22072#discussion_r1094390713

A lot of the code was inlined to .github/workflows/ci.yml without
further modifications. While this in itself doesn't integrate with our
build system any more than the current situation, it does
1. remove a level of indirection, and more importantly
2. allow us to slowly start integrating the CI into our build system now
   that all the relevant code is in one place.
2023-02-12 11:50:08 +01:00
3a5dddf24f ci: show all logs at the end of a run (#22226)
* ci: show all logs at the end of a run

The current CI won't show the logs on error due to early exit. This will
at least show the logs, although for all tests at once.
2023-02-11 18:16:04 +01:00
9668c166e8 fix(filetype): make vim.filetype.match() work with contents only (#22181)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-02-11 08:08:33 -07:00
24ec0aaa7a ci: don't delete core dumps at the start of the run (#22223)
There shouldn't be any core dumps before we have started testing.
2023-02-11 14:51:41 +01:00
27177e5819 refactor: reduce scope of locals as per the style guide (#22211) 2023-02-11 14:14:24 +01:00
c5b34fa554 refactor: move init_default_autocmds to lua
The original motivation for this change came from developping
https://github.com/neovim/neovim/pull/22159, which will require adding
more autocommand creation to Neovim's startup sequence.

This change requires lightly editing a test that expected no autocommand
to have been created from lua.
2023-02-11 14:02:17 +01:00
5ca6cf55f9 fix(helpers): restore channel id after a call to WITH_SCRIPT_CONTEXT
In https://github.com/neovim/neovim/pull/22214, init_default_autocmds
has been turned into a lua function call to nvim_create_augroup and
nvim_create_autocmd.

This introduced a strange regression: a test in vim_spec.lua started
failing with its last_set_chan value switching from 0 to
-9223372036854775808.

It turns out that -9223372036854775808 is the value of LUA_INTERNAL_CALL
and would be inherited as last_set_chan by options set from the command
line due to the WITH_SCRIPT_CONTEXT macro not restoring the channel id
(WITH_SCRIPT_CONTEXT is used by nvim_create_augroup).
2023-02-11 14:02:17 +01:00
224a3c77ca vim-patch:9.0.1295: the option initialization function is too long (#22222)
Problem:    The option initialization function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#11966)

6c41bedeed

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-11 20:56:42 +08:00
883ec20d9f ci: inline build commands and remove before_script.sh (#22202)
Abstracting the build commands to a separate script makes it more
difficult to reason about it and more error-prone.
2023-02-11 13:27:43 +01:00
b0d156c00b ci: run lintcommit file from PR branch (#22219)
As the trigger type is no longer pull_request_target there is no longer
any risk of using the lintcommit script directly from the user PR.
2023-02-11 13:22:54 +01:00
374955bcc5 vim-patch:9.0.1300: 'statusline' only supports one "%=" item (#22218)
Problem:    'statusline' only supports one "%=" item.
Solution:   Add support for multiple "%=" items. (TJ DeVries, Yegappan
            Lakshmanan, closes vim/vim#11970, closes vim/vim#11965)

3ec78f973f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-11 20:00:31 +08:00
414ff7742f Merge pull request #22217 from zeertzjq/vim-9.0.1298
vim-patch:9.0.{1298,1299}: c_CTRL-R_CTRL-R doesn't trigger incsearch
2023-02-11 19:28:26 +08:00
f1fcdcc2c4 vim-patch:9.0.1299: change for triggering incsearch not sufficiently tested
Problem:    Change for triggering incsearch not sufficiently tested.
Solution:   Add a test case.  Simplify the code. (closes vim/vim#11971)

412e0e4ed9
2023-02-11 19:04:28 +08:00
9437800d28 vim-patch:9.0.1298: inserting register on the cmdline does not trigger incsearch
Problem:    Inserting a register on the command line does not trigger
            incsearch or update hlsearch.
Solution:   Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
            and handle it correctly. (Ken Takata, closes vim/vim#11960)

c4b7dec382

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-11 19:04:27 +08:00
7d58de11f4 fix(rpc)!: preseve files when stdio channel is closed (#22137)
BREAKING CHANGE: Unsaved changes are now preserved rather than discarded
when stdio channel is closed.
2023-02-11 18:25:01 +08:00
4be6c6cf0d refactor: replace char_u with char (#21901)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-02-11 11:05:57 +01:00
ee87b848a2 ci: remove reviewers from the refactor label (#22216)
Anyone can review a refactor depending on what's being refactored.
2023-02-11 10:47:10 +01:00
165b07b269 docs: reword news.txt to ensure a consistent style (#22215) 2023-02-11 10:34:20 +01:00
7224c889e0 build: enable MSVC level 3 warnings (#21934)
MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3
(production quality) and 4 (informational). Enabling level 3 warnings
mostly revealed conversion problems, similar to GCC/clang -Wconversion
flag.
2023-02-11 10:25:24 +01:00
c8c930ea78 refactor: reduce scope of locals as per the style guide (#22206) 2023-02-11 10:24:46 +01:00
c9b0fe1f41 vim-patch:9.0.1297: wrong value for $LC_CTYPE makes the environ test fail (#22210)
Problem:    Wrong value for $LC_CTYPE makes the environ test fail.
Solution:   Unset $LC_CTYPE when running tests. (closes vim/vim#11963)

962d916435

Co-authored-by: WuerfelDev <dev@wuerfeldev.de>
2023-02-11 08:20:31 +08:00
24aebbb3de Merge pull request #21887 from bfredl/asanterror
build(ci): let ASAN print tracebacks for more errors (SIGABORT, SIGILL)
2023-02-10 22:32:44 +01:00
87d0809545 build(ci): let ASAN print tracebacks for more errors (SIGABORT, SIGILL) 2023-02-10 22:14:45 +01:00
b8ad1bfe8b Merge pull request #22077 from bfredl/neolua_client
refactor(tests): integrate lua-client into core and use core for functionaltests
2023-02-10 20:51:36 +01:00
4c64cbe99f build: mark uninteresting variables as advanced (#22208)
Only the most important variables should be shown by default.
2023-02-10 20:20:18 +01:00
0837980db4 fix(client): wait for session to exit
This replicates the old native.pid_wait(self._pid)
call, except using the proper libuv pattern (run loop unitil exit
callback)
2023-02-10 20:19:04 +01:00
f8f82901cd fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
d6279f9392 refactor(tests): move lua-client into core and use it for functionaltests
Eliminates lua-client and non-static libluv as test time dependencies

Note: the API for a public lua-client is not yet finished.
The interface needs to be adjusted to work in the embedded loop
of a nvim instance (to use it to talk between instances)
2023-02-10 20:19:04 +01:00
84328bae08 Merge pull request #22194 from bfredl/noflush
refactor(ui): remove some superfluous redraw and ui_flush() calls
2023-02-10 20:09:14 +01:00
8a985d12dd fix(treesitter): don't trample parsers when filetype!=lang
This allows vim.treesitter.show_tree() to work on buffers where the
filetype does not match the parser language name e.g, bash/sh.
2023-02-10 16:15:56 +00:00
f5bad01869 feat(treesitter): playground improvements
- Render node ranges as virtual text
- Set filettype=query. The virtual text is to avoid parsing errors.
- Make sure highlights text is always in view.
2023-02-10 16:15:55 +00:00
e5d8220179 ci: simplify lintcommit output (#22204)
- Suggest reading CONTRIBUTING.md once, not for each commit failure
- Suggest using "fix" type if none of the provided types are appropriate
- Remove "dist" type. It's rarely used and can be replaced by using the
  "build" type
2023-02-10 17:03:01 +01:00
d5b1712dc4 ci: remove unnecessary environment variables (#22175) 2023-02-10 13:56:07 +01:00
827947447e ci: split functionaltest-lua into two separate jobs (#22201)
More specifically, move the job testing the oldest supported cmake into
its own job. This opens the way for other jobs to use powerful and
advanced cmake features such as choosing which files to use with the -S
flag.

Removed testing from this job as this probably won't reveal anything
that other jobs already doesn't already show, since the only difference
is the cmake version.
2023-02-10 12:04:00 +01:00
fe1e6b82f4 ci: inline test.sh to run_tests.sh (#22198)
This will get rid of the common/ directory.
2023-02-10 00:42:37 +01:00
eb3f8989a0 ci(lintcommit): turn off debug tracing (#22196)
The default output is too verbose and messy for someone not already
familiar with lintcommit, which defeats it purpose.
2023-02-09 23:23:48 +01:00
2b09b39aec ci: remove base branch from cache key (#22195)
Using the base branch as cache means that pull requests won't be able to
use the cache from the master branch, since the master branch cache
doesn't have a base_ref as it's generated from a push. Removing base_ref
makes the cache key from master and PR branch the same, provided the any
build files don't change.
2023-02-09 22:25:44 +01:00
30b29a36e8 refactor(ui): remove some superfluous ui_flush() calls
- <expr> mapping has no business saving and restoring the
  low-level UI cursor. The cursor will be put in a reasonable
  position after input is processed, chill out.
- TUI handles output needed for suspend
- vgetc() family of function does flushing
2023-02-09 21:39:56 +01:00
ec932961cc ci: inline internal caching script to Github actions (#22192)
I don't think it's possible to meaningfully abstract away caching on
multiple providers, as each provider has different mechanisms
on how they work.
2023-02-09 21:13:03 +01:00
257765d9e0 refactor(ui): don't reimplement redrawing in focus gained handling
These are just ordinary boring events now. Modes already redraw events
themselves.
2023-02-09 20:55:35 +01:00
05d3bef836 ci: add individual timeout limits for all tests (#22193)
The CI somtimes freezes on a specific test, wasting 45 minutes for the
entire job. Adding a timeout of 15 minutes to functionaltest and 5
minutes to unittests will mitigate the problem.
2023-02-09 20:13:05 +01:00
2af31fc50a Merge pull request #22186 from clason/maintain
* docs(maintain): add note on updating `luvref.txt`
* docs(luvref): update version info
2023-02-09 13:15:29 +01:00
1b379ce430 test(exit_spec): make sure that autocommands are triggered (#22188)
Previously, if the autocommands are not triggered, the tests may still
pass because no assertion is done. Add an assertion so that the tests
will fail if the autocommands aren't triggered.
2023-02-09 19:48:17 +08:00
1aa128b0ea docs(luvref): update version info 2023-02-09 11:54:37 +01:00
27edc64709 docs(maintain): add note on updating luvref.txt 2023-02-09 11:45:54 +01:00
ad00b03426 build: remove codecov related files (#20859)
These aren't needed as we don't use codecov anymore.
2023-02-09 11:04:02 +01:00
b2b82ff142 fix(rpc): ignore redraw events when exiting (#22184)
When a TUI client has already stopped, handling UI events will cause a
heap-use-after-free, so ignore them.
2023-02-09 14:36:17 +08:00
ecc40660d1 fix(rpc): ignore redraw events when not in UI client (#21892)
Otherwise it will crash.
2023-02-09 10:53:47 +08:00
ffd216e869 build: create test/CMakeLists.txt and move test-related code (#22179)
Having a clear separation between build code and test code makes it
easier to get a higher-level understanding of how the neovim build
works.
2023-02-08 23:46:39 +01:00
5638813066 build: reuse source files with interface library (#22177)
This will minimize duplication by only needing to specify required files for nvim and libnvim once.
2023-02-08 19:31:10 +01:00
7404f481ba Merge pull request #22172 from bfredl/cells
perf(ui): mitigate redraw latency regression from TUI refactor
2023-02-08 18:36:36 +01:00
2294210660 ci: remove fail summary (#22174)
The tests already have a summary at the end, there's no need for an
additional fail summary wrapper.
2023-02-08 18:32:17 +01:00
eebed91d11 build: remove unused function get_test_target (#22176) 2023-02-08 18:20:45 +01:00
d6d3a92013 build: replace check-single-includes with clang-tidy (#22061)
Clang-tidy already does what check-single-includes does automatically on
top of its regular linting. It is also generator independent, so it
doesn't take an eternity to run on slower generators such as Visual
Studio.
2023-02-08 18:16:48 +01:00
28e26e05bc perf(ui): mitigate redraw latency regression from TUI refactor
While the new RPC encoder/decoder implementation in general should have
less overhead than the deleted UIBridge serializer previously used for
the TUI, it regresses on redraw latency in one important aspect.

The old bridge implementation allowed the TUI to process a
previous screen line internally in parallel with the main thread
rendering the next one in win_line etc. As printing the escape
sequences in highlighted cells has a considerable hit in profiles,
this has a substantial effect on redraw latency. The RPC implementation,
however, waits with sending any data until either a flush, or the buffer is full.

This change lowers the granularity of communication again, using an
adjustable threshold counted in number of cell events (discounting
long repeats and clearing as maximum a single extra event).

The current value is guesstimated to something simple on a reasonable
scale, which should be bigger than a single line, but multiple events
for a big multi-window screen.
2023-02-08 18:02:55 +01:00
625e990976 refactor(ui): cleanup 'redrawdebug', introduce "flush" mode 2023-02-08 18:02:55 +01:00
f4c836ad70 build(windows): specify Windows 8 as the minimum version (#22173)
This will allow MSVC to use newer features not available in Vista and
Windows 7.
2023-02-08 17:37:15 +01:00
0fc9a232e0 ci: remove unnecessary END_MARKER variable (#22171) 2023-02-08 16:21:50 +01:00
3074ae6971 ci(oldtest): make a copy of scripts of ci/common in testdir (#22170)
Having separate copies makes it easier to not accidentally break
something when modifying the scripts.
2023-02-08 16:21:05 +01:00
464b7b1e77 Merge pull request #22165 from clason/bump-Luv
build(deps): bump Luv to HEAD - e8e7b7e13
docs(luvref): update to latest version
2023-02-08 14:37:50 +01:00
07a6bc2be3 build(deps): bump libuv to HEAD - 62c2374a8 (#22166) 2023-02-08 14:37:04 +01:00
d0008bd626 docs(luvref): update to version bump 2023-02-08 11:28:32 +01:00
4d2c1004e9 build: prefer -D <variable>=<value> over -D<variable>=<value> (#22164)
This makes it easier to see that -D is referring to the entire
"<variable>=<value>", rather than only <variable>. It also help syntax
highlighters highlight built-in variables.
2023-02-08 11:00:16 +01:00
893c7b9bb1 build(deps): bump Luv to HEAD - e8e7b7e13 2023-02-08 10:58:39 +01:00
645daaf5e9 build(Windows): make bundling nvim-qt optional (#21866)
Closes https://github.com/neovim/neovim/issues/14552.
2023-02-08 10:08:18 +01:00
1ca4a8b1dd vim-patch:9.0.1291: Move language files are not recognized (#22162)
Problem:    Move language files are not recognized.
Solution:   Recognize Move language files. (Amaan Qureshi, closes vim/vim#11947)

6642982bea

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-08 09:47:55 +01:00
81c5483dcb ci: add universal macos job (#22156)
The universal macos release is particularly sensitive to build system
changes. Adding a job that builds a universal binary whenever a cmake
file is changed will help prevent future release breaks.
2023-02-07 23:09:08 +01:00
d38dfdca58 build: remove duplicate INTERFACE keyword (#22106) 2023-02-07 21:37:16 +01:00
c1d76363ac ci: simplify how environment variables are used (#22067)
Having a clear separation between when we manipulate variables and when
we export them to GITHUB_ENV makes it less error-prone.
2023-02-07 14:43:45 +01:00
8fbe75b3dd vim-patch:9.0.1288: FunC files are not recognized (#22153)
Problem:    FunC files are not recognized.
Solution:   Recognize FunC files. (Amaan Qureshi, closes vim/vim#11949)

91deac4539

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-07 10:29:37 +01:00
adae075fcf ci: remove unnecessary variables and functions (#22150) 2023-02-07 09:27:51 +01:00
1391385ba9 vim-patch:9.0.1290: CTRL-N and -P on cmdline don't trigger CmdlineChanged (#22151)
Problem:    CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution:   Jump to cmdline_changed instead of cmdline_not_changed.
            (closes vim/vim#11956)

af9e28a5b8

Cherry-pick Test_Cmdline() change from patch 9.0.1039.
2023-02-07 07:54:33 +08:00
3170e05d57 build: don't build libnvim when running the CI (#22149)
It shouldn't be sneakily run alongside the nvim build. If it's to
be used it should be done in a separate step.
2023-02-06 23:42:03 +01:00
aa04efcf57 ci: remove unhelpful helper functions for make (#22148) 2023-02-06 23:14:41 +01:00
e1f03c481a feat(spell): also source spell/LANG.lua when setting spelllang (#22111)
Problem: only Vimscript files are sourced when setting spelling language
Solution: also source Lua files after sourcing Vimscript files

Closes #22110
2023-02-06 10:01:38 +01:00
1675f0e270 vim-patch:9.0.1282: Ron files are not recognized (#22132)
Problem:    Ron files are not recognized.
Solution:   Recognize Ron files. (Amaan Qureshi, closes vim/vim#11948)

c8ef30bc2e
2023-02-06 10:01:17 +01:00
6c39edaa7e fix(health): iterate using ipairs correctly (#22119)
In a few places ipairs was used to iterate over elements of the array.
However, the first return value of ipairs was erronously used, which is
not the value, but rather the index. This would result in errors, for
instance when trying to retrieve a field from the value.
2023-02-06 12:24:00 +08:00
228684d2fb fix(decoration): don't show signcolumn for non-sign_text extmark (#22135)
Fixes: #22127
2023-02-05 23:49:43 +00:00
7963a160e9 Merge pull request #21548 from figsoda/transform-capture
feat(treesitter): allow capture text to be transformed
2023-02-05 21:31:30 +00:00
23e34fe534 vim-patch:9.0.1281: Cadence files are not recognized (#22130)
Problem:    Cadence files are not recognized.
Solution:   Recognize Cadence files. (Janez Podhostnik, closes vim/vim#11951)

cb626a4692

Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com>
2023-02-05 17:59:18 +01:00
4c66f5ff97 feat(treesitter): respect metadata[id].range for offset! 2023-02-04 21:15:03 -05:00
e1d5ad1cb8 feat(treesitter): add metadata option for get_node_text 2023-02-04 21:15:03 -05:00
bb8845340b feat(treesitter): allow capture text to be transformed
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-02-04 21:04:45 -05:00
5c4b503d3c vim-patch:9.0.1279: display shows lines scrolled down erroneously (#22126)
Problem:    Display shows lines scrolled down erroneously. (Yishai Lerner)
Solution:   Do not change "wl_lnum" at index zero. (closes vim/vim#11938)

61fdbfa1e3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-05 09:37:12 +08:00
4b9bb3a184 vim-patch:9.0.1278: go.work.sum files are not recognized (#22121)
Problem:    go.work.sum files are not recognized.
Solution:   Recognize go.work.sum files as the gosum filetype. (Amaan Qureshi,
            closes vim/vim#11940)

4ad8ae8465

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-04 16:05:45 +01:00
9a5678463c fix(treesitter): fix most diagnostics 2023-02-04 14:58:38 +00:00
69bb145cea refactor(exit): pass error message to preserve_exit() (#22097)
Problem:
1. Some calls to preserve_exit() don't put a message in IObuff, so the
   IObuff printed by preserve_exit() contains unrelated information.
2. If a TUI client runs out of memory or receives a deadly signal, the
   error message is shown on alternate screen and cannot be easily seen
   because the TUI exits alternate screen soon afterwards.

Solution:
Pass error message to preserve_exit() and exit alternate screen before
printing it.

Note that this doesn't fix the problem that server error messages cannot
be easily seen on exit. This is tracked in #21608 and #21843.
2023-02-04 20:14:31 +08:00
90333b24c3 vim-patch:9.0.1277: cursor may move with autocmd in Visual mode (#22116)
Problem:    Cursor may move with autocmd in Visual mode.
Solution:   Restore "VIsual_active" before calling check_cursor().
            (closes vim/vim#11939)

49f0524fb5
2023-02-04 19:35:31 +08:00
a4e376f09b refactor(statusline): move statusline defs to statusline_defs.h 2023-02-04 11:05:24 +01:00
08fb3b5309 perf(column): only build fold/sign column when present in 'statuscolumn'
Problem:    The fold and sign column is built and stored regardless of
            whether the corresponding item is present in 'statuscolumn'.
Solution:   Since the 'statuscolumn' parses itself, we can defer
            building the columns until the corresponding item is
            actually encountered.
2023-02-04 11:04:43 +01:00
60ab22dfa6 refactor(column): remove unused build_statuscol_str() arguments
Problem:    `build_statuscol_str()` still has arguments that were
            necessary for building a status column string in
            `number_width()`, which was abandoned in #22094.
Solution:   Remove unused arguments.
2023-02-04 10:43:20 +01:00
7a710f5f08 fix(column): no longer reset nrwidth_line_count for 'statuscolumn'
Problem:    We still explicitly reset `nrwidth_line_count` when changing
            `'number'` or `'relativenumber'` but this is no longer
            needed since the introduction of a `statuscol_line_count`.
Solution:   Remove reset of `nrwidth_line_count`. Resolve
            https://github.com/neovim/neovim/pull/22094#issuecomment-1416168926.
2023-02-04 00:17:04 +01:00
964ae205a5 build: unbreak building neovim with multi-config generators (#22104)
file(GENERATE) has surprising behavior as it doesn't allow different
file contents for configurations with the same file name. This results
in an error when building neovim with a multi-config generator. Use a
workaround for now where we set the build type for multi-config
generators to "Unknown".
2023-02-03 10:53:57 +01:00
144279ef30 vim-patch:be4e01637e71 (#22103)
Update runtime files.

be4e01637e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-03 09:18:18 +01:00
f9826e1dff build: stop relying on CMAKE_BUILD_TYPE to determine the build type (#22051)
Any logic involving CMAKE_BUILD_TYPE is automatically broken as it won't
work with multi-config generators. The only exception is if we
explicitly check whether the current generator is single-config as well.
Instead, use generator expressions or cmake variables that allows to set
options for certain build types only such as
INTERPROCEDURAL_OPTIMIZATION_<CONFIG>.

Opt to generate all headers with optimization level O2 with no debug
information for all build types as that is the simplest way to make it
behave the same for all generators.
2023-02-03 00:00:15 +01:00
ebd2372f92 refactor: use flexible arrays instead of the length-of-one trick (#22072)
The "length-of-one" trick, where the last element of a struct is an
array of size 1, but extra size is allocated when calling malloc where
it uses more than 1 element in the array, cause problems with some
compilers. Some compilers set _FORTIFY_SOURCE=2 by default which
incorrectly considers it as an overflow. More information:
https://github.com/neovim/neovim/issues/223#issuecomment-1413828554

Using flexible array members allows us to to properly convey to the
compiler that its size may be larger than 1. This also enables us to
remove lengthy workarounds that are unreliable, as they depend on
CMAKE_BUILD_TYPE which isn't defined for multi-config generators.

Closes: https://github.com/neovim/neovim/issues/223
2023-02-02 23:56:25 +01:00
0ea4156464 Merge pull request #22098 from tmccombs/sockopen-docs
docs: clarify "pipe" mode for sockconnect
2023-02-02 19:09:02 +01:00
c05b3c3bbd vim-patch:9.0.1274: FIRRTL files are not recognized (#22102)
Problem:    FIRRTL files are not recognized.
Solution:   Add a pattern for FIRRTL files. (Amaan Qureshi, closes vim/vim#11931)

685bf83b73

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-02 17:26:22 +01:00
d3355ad01c fix(tui): detach/attach on suspend/resume (#22040)
Problem:
When a TUI client is suspended it still receives UI events from the
server, and has to process these accumulated events when it is resumed.
With mulitple TUI clients this is a bigger problem, considering the
following steps:
1. A TUI client is attached.
2. CTRL-Z is pressed and the first client is suspended.
3. Another TUI client is attached.
4. CTRL-Z is pressed and a "suspend" event is sent to both clients. The
   second client is suspended, while the first client isn't able to
   process the event because it has already been suspended.
5. The first client is resumed. It processes the accumulated "suspend"
   event and suspends immediately.

Solution:
Make a TUI client detach on suspend and re-attach on resume.
2023-02-02 22:42:15 +08:00
cbf9199d65 Merge pull request #21331 from LiadOz/LiadOz/prompt-insert-extmark
fix(extmarks): adjust extmarks when inserting prompt prefix
2023-02-02 15:23:09 +01:00
405f0a8c3f build: update release data 2023-02-02 14:37:44 +01:00
b02eeb6a72 fix(lua): mark some eval functions that can run in API-fast 2023-02-02 13:21:44 +00:00
533bdcb25e build: remove unnecessary file generation (#22099)
paths.lua.in doesn't rely on any generator expressions, so it's safe to
remove file(GENERATE).
2023-02-02 12:27:48 +01:00
64fa75a86a fix(column): estimate 'statuscolumn' width appropriately
Problem:    The 'statuscolumn' width is being estimated without the
            proper context. In particular, this resulted in the fact
            that a custom fold column could be included in the estimated
            `number_width()`, and doubly added when actually drawing the
            statuscolumn due to `win_col_off()` also adding the
            `'foldcolumn'` width. Resulting in a status column that is
            `'foldcolumn'` cells wider than necessary.
Solution:   Estimate 'statuscolumn' width in `get_statuscol_str()` when
            a buffer's line count has changed.
2023-02-02 09:35:51 +00:00
cb97d5425a docs: clarify "pipe" mode for sockconnect
Make it more clear that on unix the "pipe" mode of sockconnect uses unix
local domain sockets, not named pipes (FIFOs) which are not currently
supported.

See discussion in #22080.

Signed-off-by: Thayne McCombs
2023-02-02 01:00:17 -07:00
2c5906b55b fix(exit): skip unnecessary steps in TUI preserve_exit() (#21897)
This prevents the TUI from doing unexpected things when receiving a
deadly signal or running out of memory.
2023-02-02 10:05:03 +08:00
ecc1595c7b version.c: update [skip ci] (#21306)
Co-authored-by: marvim <marvim@users.noreply.github.com>

N/A patches:
vim-patch:9.0.1272: typo in pattern for filetype detection
2023-02-02 08:07:11 +08:00
fa35d3c33a vim-patch:9.0.1273: "1v" may select block with wrong size (#22092)
Problem:    "1v" may select block with wrong size. (Evgeni Chasnovski)
Solution:   Compute "curswant" in the right line. (closes vim/vim#11925)

8f531662e2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-02 08:05:15 +08:00
9ce44a750c fix(man): use italics for <bs>_ (#22086)
fix(man): use italics for <bs>_

Even though underline is strictly what this should be. <bs>_ was used by
nroff to indicate italics which wasn't possible on old typewriters so
underline was used. Modern terminals now support italics so lets use
that now.

See:
- https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795
- https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm
2023-02-01 17:21:42 +00:00
4cc0d6b854 vim-patch:9.0.1271: using sizeof() and subtract array size is tricky (#22087)
Problem:    Using sizeof() and subtract array size is tricky.
Solution:   Use offsetof() instead. (closes vim/vim#11926)

1b438a8228
2023-02-01 21:53:32 +08:00
6aee2336ca refactor(fileio.c): normalize ifdefs
As well as improving readbability, this also avoids all Treesitter
parsing errors which cannot handle elaborate use of the preprocessor.
2023-02-01 11:14:21 +00:00
b3d304df93 refactor(fileio.c): remove HAVE_ACL ifdefs 2023-02-01 11:14:20 +00:00
a26c0ecab6 Merge pull request #22082 from clason/bump-vimdoc
build(deps): bump tree-sitter-vimdoc to v1.3.0
2023-02-01 12:08:54 +01:00
37da48cabd build(deps): bump tree-sitter-vimdoc to v1.3.0 2023-02-01 11:34:51 +01:00
01d3a64e28 vim-patch:8.1.1827: allocating more memory than needed for extended structs (#22081)
Problem:    Allocating more memory than needed for extended structs.
Solution:   Use offsetof() instead of sizeof(). (Dominique Pelle,
            closes vim/vim#4786)

47ed553fd5
2023-02-01 18:07:09 +08:00
d63ad600e0 vim-patch:9.0.1268: .clangd and .stylelintrc files don't get a filetype (#22079)
Problem:    .clangd and .stylelintrc files don't get a filetype.
Solution:   Use yaml for .clangd and json for .stylelintrc files. (Mark
            Skelton, closes vim/vim#11916)

9c51798a1f

Co-authored-by: Mark Skelton <mdskelton99@gmail.com>
2023-02-01 10:08:50 +01:00
7880eeb2ee vim-patch:9.0.1270: crash when using search stat in narrow screen (#22078)
Problem:    Crash when using search stat in narrow screen.
Solution:   Check length of message. (closes vim/vim#11921)

a7d36b7320
2023-02-01 08:21:32 +08:00
249b9de405 refactor(optionstr.c): align comments (#22070)
Align comments in did_set_string_option_for() at column 57.
2023-02-01 08:17:18 +08:00
8376486e8f Merge pull request #17537 from bfredl/neolua
refactor(tests): run unittests using main nvim binary - delete separate nvim-test build
2023-01-31 19:58:33 +01:00
13aa23b62a refactor(tests): run unittests using main nvim binary in interpreter mode
This allows us to get rid of the separate "nvim-test" target
2023-01-31 19:28:26 +01:00
42999a8d64 fix(test): fix issues detected by running unittests in ASAN/UBSAN 2023-01-31 18:28:29 +01:00
c1a3865c47 refactor(fileio.c): factor out backup creation 2023-01-31 17:20:12 +00:00
33a183e898 refactor(fileio.c): make unreadable expression readable 2023-01-31 17:18:57 +00:00
eacdece354 refactor(fileio.c): factor out file info calc 2023-01-31 17:18:54 +00:00
cb3be2c766 refactor(fileio.c): factor out buf_write post autocmds 2023-01-31 17:16:41 +00:00
842cf780a6 refactor(fileio.c): do not use macros for error handling 2023-01-31 17:15:51 +00:00
8b11cf5092 Merge pull request #22005 from clason/sanitize-lang
fix(treesitter): validate language name
2023-01-31 17:28:32 +01:00
9417a3d98a refactor(fileio.c): reduce scope of locals 2023-01-31 14:00:08 +00:00
d6d6ab3f8e feat(lua): low-level interpreter mode (nvim -ll) 2023-01-31 13:53:22 +01:00
facbb11e05 Merge pull request #22068 from bfredl/lsptest
fix(tests): use -l mode for lsp tests
2023-01-31 13:49:51 +01:00
50b256d515 fix(tests): use -l mode for lsp tests
This fixes "fake server" from leaking memory, which makes ASAN very
upset, except on current ASAN CI for some reason.
2023-01-31 13:15:23 +01:00
253a4d7074 refactor(fileio.c): more bools 2023-01-31 11:20:35 +00:00
b001f25204 refactor(fileio.c): factor out autocmd handling from buf_write() 2023-01-31 11:20:35 +00:00
f4b1f0d042 refactor(fileio.c): remove HAS_BW_FLAGS 2023-01-31 11:20:35 +00:00
740f6ae168 refactor(fileio.c): refactor buf_write_bytes (2) 2023-01-31 11:20:34 +00:00
f770e05c87 refactor(fileio.c): refactor buf_write_bytes 2023-01-31 11:20:34 +00:00
99149153c4 refactor(fileio.c): refactor vim_rename() 2023-01-31 11:20:34 +00:00
b7d09695c4 refactor(fileio.c): refactor match_file_path() 2023-01-31 11:20:34 +00:00
b649a96fc0 vim-patch:9.0.1263: KDL files are not recognized (#22058)
Problem:    KDL files are not recognized.
Solution:   Add a pattern for KDL files. (Amaan Qureshi, closes vim/vim#11898)

907349a743

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-01-31 08:12:10 +01:00
860fea1a3f fix(highlight): properly deal with underline mask when listing (#22057) 2023-01-31 07:08:23 +08:00
27b81af19c refactor!: remove has("debug") (#22060)
This value can not be relied on as it doesn't work for
multi-configuration generators. I don't think this undocumented option
is used much, if at all, so I think we should remove it.
2023-01-30 19:06:32 +01:00
979b7b0c49 build: add uninstall make target (#22059)
We already have a "make install", it makes sense to also have a "make
uninstall".
2023-01-30 18:45:07 +01:00
21257d8580 build(luarocks): update busted version to v2.1.1 (#22029) 2023-01-30 17:01:06 +08:00
3ac55fe083 build(bump_deps.lua): run command -v in shell (#22030)
When I run ./scripts/bump_deps.lua I get an error:

  Vim:E475: Invalid value for argument cmd: 'command' is not executable

Running command -v in shell fixes this.
2023-01-30 07:15:38 +08:00
c9ac4e4877 vim-patch:9.0.1261: Elsa files are not recognized (#22047)
Problem: Elsa files are not recognized.
Solution: Add the name of Elsa files. (Amaan Qureshi)

2a99fe6c41
2023-01-29 20:19:07 +01:00
9cb3b276bd ci(news): mention that ignoring news.txt is fine (#22043)
news.txt is only meant as a reminder, but contributors have no way of
knowing this automatically without such a message.
2023-01-29 17:03:53 +01:00
930125647f build: enable ccache project-wide (#22045)
Currently, only the nvim target uses ccache but not libnvim or
unittests. It is generally a good idea to operate on targets rather than
globally, but this is an exception as there isn't a target where we
don't want to use ccache on.
2023-01-29 17:02:34 +01:00
8144deb098 vim-patch:9.0.1256: NetworkManager connection files are not recognized (#22038)
Problem:    NetworkManager connection files are not recognized.
Solution:   Add a pattern for NetworkManager connection files. (closes vim/vim#11893)

04e4f1d985

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-01-29 10:39:20 +01:00
4c90a84c61 vim-patch:9.0.1255: changing 'virtualedit' does not have immediate effect (#22039)
Problem:    Changing 'virtualedit' does not have immediate effect.
Solution:   Correct how is checked for a changed value. (closes vim/vim#11878)

8fe5b9c8c1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-29 07:42:22 +08:00
c032e83b22 fix(treesitter): validate language name
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.

Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
2023-01-28 11:28:52 +01:00
b4c4c232ba fix(fileio.c): don't use uninitialized memory (#22031) 2023-01-28 13:06:45 +08:00
881d4adb59 build: enable ccache by default if available (#22020)
Initial benchmarks show that this gives a nice 50% compile time
reduction for neovim. This shouldn't affect users or CI, but it's a nice
speedup for local development. The C_COMPILER_LAUNCHER target property
is only supported by Makefiles and Ninja generators only, so this won't
give a speedup when using the Xcode and Visual Studio generators even if
ccache is available.
2023-01-28 00:42:13 +01:00
2cde6a18b5 build(deps): bump unibilium to d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628 (#22019)
actually use build system improvements
2023-01-27 14:53:53 +01:00
38365fa2ef build: fix dependencies in find modules (#22017)
Find modules should only link to libraries defined in the find module,
and not the main project. This helps the find modules be more self-contained and easier to understand.
2023-01-27 14:16:31 +01:00
aec4b476c5 docs(api): tweak data arg for nvim_create_autocmd (#22008)
Fixes #21964
2023-01-27 11:24:20 +00:00
82fb6ce487 Merge pull request #21994 from lewis6991/refactor/option_set 2023-01-27 11:23:44 +00:00
d85ed00a8c build: find unibilium without relying on libfindmacros (#22015)
This will remove the warning about the find module not providing a
version.
2023-01-27 11:53:32 +01:00
77a0ce1d9b refactor(option.c): factor out string option special case handling 2023-01-27 10:43:42 +00:00
068151f5c6 refactor(option.c): factor out some nextchar checks 2023-01-27 10:43:41 +00:00
9b43dcdbff fix(test): unset XDG_CONFIG_HOME when running oldtest
- also fix test_taglist.vim for users running with a tags file created
  in runtime/doc
2023-01-27 09:48:00 +00:00
843c9025ae build: check if libvterm version meets requirement (#22010)
The vterm.h file only specifies major and minor version, but not patch,
meaning that requiring a specific patch number isn't currently possible.
2023-01-26 21:35:06 +01:00
3c2bb1b2be refactor(fileio.c): reduce scope of locals 2023-01-26 15:17:23 +00:00
41aa5ce3eb vim-patch:9.0.1246: code is indented more than necessary (#22006)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11887)

142ed77898

Omit function_using_block_scopes(): only affects Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-26 21:05:34 +08:00
e02df23b4e docs: clarify :runtime behavior without [where] again (#22003)
The behavior changed again after #15867, change the docs to describe
latest behavior.
2023-01-26 19:35:06 +08:00
3544082f46 test: exepath() returns correct path with cmd.exe, powershell #21928
test(exepath): test if exepath returns correct path with multiple
Windows shells

This test covers the changes from #21175 where exepath() is set to
prefer file extensions in powershell.exe aswell as in cmd.exe.

In both shells, the file with a valid extension should be returned
instead of the extensionless file.
2023-01-26 03:06:29 -08:00
8f2d3537b4 refactor(option.c): add do_set_option_value 2023-01-26 10:42:26 +00:00
0170219e92 refactor(option.c): move bool prefix check 2023-01-26 10:26:07 +00:00
c6907ea895 refactor(option.c): de-nest code in do_set_option 2023-01-26 10:02:01 +00:00
e49ae04caf refactor(option.c): factor out opt_idx validation 2023-01-26 10:02:00 +00:00
2c601787ab refactor(option.c): factor out option name parsing 2023-01-26 10:02:00 +00:00
9a9129c60b refactor(option.c): factor out option prefix parsing 2023-01-26 10:02:00 +00:00
0f3fa5a30a refactor(option.c): factor out set op parsing 2023-01-26 10:02:00 +00:00
25310af060 refactor(option.c): use skiptowhite_esc 2023-01-26 10:02:00 +00:00
334f538267 refactor(option.c): change nextchar to uint8_t 2023-01-26 10:02:00 +00:00
ef85238fde refactor(option.c): remove goto 2023-01-26 10:02:00 +00:00
a13e97ece5 refactor(option.c): int -> bool 2023-01-26 10:01:59 +00:00
bb1efa85aa refactor(option.c): reduce scope or startarg 2023-01-26 09:53:15 +00:00
b93bec68bc refactor(option.c): reduce scope or errbuf 2023-01-26 09:53:15 +00:00
3ae3e47d54 refactor(option.c): reduce scope or errmsg 2023-01-26 09:53:14 +00:00
e368560c80 refactor(option.c): factor out loop code from do_set() 2023-01-26 09:53:13 +00:00
18c37c616e refactor(option.c): factor out common skip check 2023-01-26 09:52:22 +00:00
9679d058d4 refactor(option.c): simplify do_set_string 2023-01-26 09:51:45 +00:00
ca1ad8977c refactor(option.c): add do_set_bool 2023-01-26 09:51:45 +00:00
37b44d1772 refactor(option.c): add do_set_num 2023-01-26 09:51:43 +00:00
a0a1125159 Merge pull request #22002 from zeertzjq/vim-9.0.1227
vim-patch:9.0.{1227,1231,1238,1242}: cmdline completion for :runtime
2023-01-26 12:17:51 +08:00
62f09017e0 test: add test for :runtime completion for .lua 2023-01-26 11:55:34 +08:00
ebc80dcded vim-patch:9.0.1242: code for :runtime completion is not consistent
Problem:    Code for :runtime completion is not consistent.
Solution:   Make code for cmdline expansion more consistent. (closes vim/vim#11875)

b0d45ec67f
2023-01-26 11:55:34 +08:00
f03f6263bb vim-patch:9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes vim/vim#11874)

5c8771bc5a
2023-01-26 11:55:34 +08:00
6320c91c50 vim-patch:9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes vim/vim#11863)

3770f4c9cd
2023-01-26 11:55:34 +08:00
6644786db0 vim-patch:9.0.1227: no cmdline completion for :runtime
Problem:    No cmdline completion for :runtime.
Solution:   Add completion for :runtime. (closes vim/vim#11853, closes vim/vim#11447)
            Improve the resulting matches.

a6759381a5
2023-01-26 11:55:32 +08:00
5ac34cf55d refactor(intro): avoid Coverity warning (#22000)
refactor(intro): avoid coverity warning

Problem:    Coverity warns about overwriting "mesg" leaking memory.
Solution:   Make it clear that "mesg" will not be overwritten.
2023-01-26 09:30:26 +08:00
116766f243 refactor(options): don't pass negative number to illegal_char() (#21999)
This only changes the error messages for an unexpected Unicode char in
an option to show its first byte instead of some special keycode.

The second argument of vim_strchr() usually doesn't matter, but it may
be better to consistently cast to uint8_t.
2023-01-26 09:12:33 +08:00
88e906d165 vim-patch:9.0.1245: code is indented more than necessary (#21998)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11879)

032713f829

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-26 08:52:21 +08:00
f15947866c vim-patch:9.0.1243: :setglobal cannot use script-local function for "expr" option (#21997)
Problem:    :setglobal cannot use script-local function for "expr" option.
Solution:   Use the pointer to the option value properly. (closes vim/vim#11883)

01d4efe2e8
2023-01-26 07:46:51 +08:00
c94d8e7f13 vim-patch:9.0.1244: cursor displayed in wrong position when leaving Insert mode (#21996)
Problem:    Cursor briefly displayed in a wrong position when pressing Esc in
            Insert mode after autoindent was used.
Solution:   Do not adjust the cursor position for assumed deleted white space
            if text is following.  (closes vim/vim#11877)

0f843ef091

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-26 07:31:32 +08:00
b05100a9ea build: use cmake to build libvterm on all platform (#21986)
Also remove Libvterm-tbl2inc_c.cmake as it's not required. It's used to
generate files that are already provided by the Libvterm project by
default. It's also not really something we need to concern ourselves
with as it's more of an authoring tool for the Libvterm creator as
mentioned in
https://github.com/neovim/neovim/pull/21986#issuecomment-1403733054.
2023-01-26 00:06:52 +01:00
15394b6855 ci: fix lintc to use external dependencies instead of bundled (#21995)
Use the bundled libvterm dependency as the external package is outdated,
with the hopes of being able to use the external package once its
version meets our required version.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-01-25 20:33:18 +01:00
3c48d3c83f fix(man.lua): open in current window if it's already a man page (#21987)
This matters when there are multiple man page windows open.
2023-01-25 22:39:25 +08:00
e2a9d71521 Merge pull request #21885 from lewis6991/refactor/options
Problems:
    - Scope of local variables in options code is too large.
    - did_set_string_option() is too large (>1000LOC).
    - Setting options for a particular window or buffer requires a changing context (assigning curwin/curbuf).

Solutions:
    - Reduce the scope of local variables.
    - Break up did_set_string_option so it doesn't contain specific logic about each individual option (1038 LOC -> 310 LOC).
    - Begin work on making functions not depend on curbuf or curwin and pass window or buffer handles explicitly.
2023-01-25 13:46:23 +00:00
b8288df99b build: introduce default build variables (#21991)
There are a number of cmake variables and cache variables that need to
be passed to all dependencies. This is not only cumbersome, but also
fragile as it's easy to miss adding or removing a flag from a dependency
by accident. Introducing a global variable that controls all builds
makes it much easier to handle our dependencies.

Also fixes the currently broken release workflow as we need to pass the
CMAKE_OSX_ARCHITECTURES variable to all dependencies built with cmake.
2023-01-25 14:36:17 +01:00
7bee622fdc refactor(optionstr.c): move handling of formatlistpat 2023-01-25 12:17:38 +00:00
15499fa856 refactor(optionstr.c): break up did_set_expropt 2023-01-25 12:13:06 +00:00
f37ec6026f refactor(optionstr.c): remove some redundant parens 2023-01-25 11:48:55 +00:00
b278e0740e refactor(optionstr.c): break up did_option_listflags 2023-01-25 11:48:55 +00:00
38ed432164 refactor(optionstr.c): add did_set_string_option_for 2023-01-25 11:48:55 +00:00
414e71fa4f refactor(optionstr.c): break up did_set_string_option 52 2023-01-25 11:48:53 +00:00
0012ed2bc7 refactor(optionstr.c): break up did_set_string_option 51 2023-01-25 11:48:53 +00:00
2654a9e9d8 refactor(optionstr.c): remove some simple did_set_* functions 2 2023-01-25 11:48:53 +00:00
e5234d48ed refactor(optionstr.c): remove some simple did_set_* functions 2023-01-25 11:48:53 +00:00
c6e7abb583 refactor(optionstr.c): break up did_set_string_option 50 2023-01-25 11:48:53 +00:00
6dac70bbfe refactor(optionstr.c): break up did_set_string_option 49 2023-01-25 11:48:53 +00:00
01e51d3bd1 refactor(optionstr.c): break up did_set_string_option 48 2023-01-25 11:48:53 +00:00
f1ac5aec23 refactor(optionstr.c): break up did_set_string_option 47 2023-01-25 11:48:53 +00:00
cb1e5ddbfb refactor(optionstr.c): break up did_set_string_option 46 2023-01-25 11:48:52 +00:00
e0954f676a refactor(optionstr.c): break up did_set_string_option 45 2023-01-25 11:48:52 +00:00
a026cf0d94 refactor(optionstr.c): break up did_set_string_option 44 2023-01-25 11:48:52 +00:00
d59349de7b refactor(optionstr.c): break up did_set_string_option 43 2023-01-25 11:48:52 +00:00
99910c7382 refactor(optionstr.c): break up did_set_string_option 42 2023-01-25 11:48:52 +00:00
2a83a5077d refactor(optionstr.c): break up did_set_string_option 41 2023-01-25 11:48:52 +00:00
a84bc3817a refactor(optionstr.c): break up did_set_string_option 40 2023-01-25 11:48:52 +00:00
902b89ad4b refactor(optionstr.c): break up did_set_string_option 39 2023-01-25 11:48:52 +00:00
4c365548a2 refactor(optionstr.c): break up did_set_string_option 38 2023-01-25 11:48:52 +00:00
3ea6a45a12 refactor(optionstr.c): break up did_set_string_option 37 2023-01-25 11:48:52 +00:00
bc2c9b1a08 refactor(optionstr.c): break up did_set_string_option 36 2023-01-25 11:48:52 +00:00
6d701cf772 refactor(optionstr.c): break up did_set_string_option 35 2023-01-25 11:48:52 +00:00
47544b6255 refactor(optionstr.c): break up did_set_string_option 34 2023-01-25 11:48:52 +00:00
b693d65171 refactor(optionstr.c): break up did_set_string_option 33 2023-01-25 11:48:52 +00:00
8ef464aeb4 refactor(optionstr.c): break up did_set_string_option 32 2023-01-25 11:48:52 +00:00
0522dc35af refactor(optionstr.c): break up did_set_string_option 31 2023-01-25 11:48:52 +00:00
59746d228e refactor(optionstr.c): break up did_set_string_option 30 2023-01-25 11:48:52 +00:00
5024ac8eb5 refactor(optionstr.c): break up did_set_string_option 29 2023-01-25 11:48:52 +00:00
655292586a refactor(optionstr.c): break up did_set_string_option 28 2023-01-25 11:48:52 +00:00
f9e15db27d refactor(optionstr.c): break up did_set_string_option 27 2023-01-25 11:48:52 +00:00
700a02bd83 refactor(optionstr.c): break up did_set_string_option 26 2023-01-25 11:48:52 +00:00
7fa7c758e2 refactor(optionstr.c): break up did_set_string_option 25 2023-01-25 11:48:52 +00:00
12d065dceb refactor(optionstr.c): break up did_set_string_option 24 2023-01-25 11:48:52 +00:00
3fbc5f9860 refactor(optionstr.c): break up did_set_string_option 23 2023-01-25 11:48:52 +00:00
ccaed94475 refactor(optionstr.c): break up did_set_string_option 22 2023-01-25 11:48:52 +00:00
6dc62f2fe2 refactor(optionstr.c): break up did_set_string_option 21 2023-01-25 11:48:52 +00:00
2cea568a7c refactor(optionstr.c): break up did_set_string_option 20 2023-01-25 11:48:52 +00:00
c2fa39e026 refactor(optionstr.c): break up did_set_string_option 19 2023-01-25 11:48:52 +00:00
fec41d5f15 refactor(optionstr.c): break up did_set_string_option 18 2023-01-25 11:48:52 +00:00
fca3053a3e refactor(optionstr.c): break up did_set_string_option 17 2023-01-25 11:48:52 +00:00
5adf8f9276 refactor(optionstr.c): break up did_set_string_option 16 2023-01-25 11:48:52 +00:00
db6461b6ad refactor(optionstr.c): break up did_set_string_option 15 2023-01-25 11:48:52 +00:00
f6eac7fdf9 refactor(optionstr.c): break up did_set_string_option 14
squash me
2023-01-25 11:48:52 +00:00
b3272031f7 refactor(optionstr.c): break up did_set_string_option 13 2023-01-25 11:48:52 +00:00
9d12b07405 refactor(optionstr.c): break up did_set_string_option 12 2023-01-25 11:48:52 +00:00
fb8dd1bac7 refactor(optionstr.c): break up did_set_string_option 11 2023-01-25 11:48:52 +00:00
3f2c72d873 refactor(optionstr.c): break up did_set_string_option 10 2023-01-25 11:48:52 +00:00
696c470e68 refactor(optionstr.c): break up did_set_string_option 9 2023-01-25 11:48:52 +00:00
47145eb3cd refactor(optionstr.c): break up did_set_string_option 8 2023-01-25 11:48:52 +00:00
a22702b5d5 refactor(optionstr.c): break up did_set_string_option 7 2023-01-25 11:48:52 +00:00
632bc7954e refactor(optionstr.c): break up did_set_string_option 6 2023-01-25 11:48:52 +00:00
5ec8bb73c2 refactor(optionstr.c): break up did_set_string_option 5 2023-01-25 11:48:52 +00:00
e334f5a57d refactor(optionstr.c): break up did_set_string_option 4 2023-01-25 11:48:52 +00:00
2a665736c1 refactor(optionstr.c): break up did_set_string_option 3 2023-01-25 11:48:52 +00:00
e93d9df4ec refactor(optionstr.c): break up did_set_string_option 2 2023-01-25 11:48:52 +00:00
d5119db2fa refactor(optionstr.c): break up did_set_string_option 1 2023-01-25 11:48:52 +00:00
8fd3d2b61f refactor(optionstr.c): reduce scope of locals 2023-01-25 11:48:52 +00:00
db87807983 refactor(option.c): use intermediate for options ref 2023-01-25 11:48:52 +00:00
29215d3a49 refactor(option.c): de-nest set_option_value 2023-01-25 11:48:51 +00:00
f90d78654a refactor(option.c): add get_varp_from and get_varp_scope_from 2023-01-25 11:48:48 +00:00
06d1e86ff8 fix(intro): make :help news line easier to translate (#21974)
Include version number in the translated message so that the word order
can be changed.
Also do not translate URL.
2023-01-25 12:53:52 +08:00
3776363617 docs(tutor): fix TODO line demo (#21965)
Here, it is expected that the user add the word TODO: to show how the
markdown is rendered, but the tutor is configured to expect the text
without the word TODO. This PR fixes this behavior.

Ref #7028
2023-01-25 09:46:00 +08:00
51b39f816c fix(tui): set stdin as "blocking" on exit (#21973)
This fixes a regression from #21605 that stdin is no longer set as
"blocking" after Nvim TUI exits, and the problems described in #2598
happen again.

I'm not sure if this should be done in TUI code or common exiting code.
I added this call in tui_stop() as it is also present in tui_suspend().
2023-01-25 07:34:28 +08:00
314d3ce1eb docs(vim.fs): normalize Windows example was incorrect (#21966) 2023-01-25 06:45:30 +08:00
9166116c67 doc(lsp): format arguments to start_client() (#21980)
docs(lsp): format arguments to start_client()
2023-01-24 18:04:15 +00:00
cd613712b1 build: use cmake to build treesitter on all platforms (#21984)
This reduces platform-specific differences and the amount of code.
2023-01-24 16:43:29 +01:00
51863b2d66 build: remove tests for libtermkey (#21983)
The dependencies aren't set up properly meaning that this will cause a
failure on some systems such as void linux.

Closes https://github.com/neovim/neovim/issues/21982.
2023-01-24 15:24:15 +01:00
a293598a97 Merge pull request #21888 from leonerd/altfont
Support `altfont` as a term rendering attribute
2023-01-24 15:00:46 +01:00
00a7c40f4f refactor(option.c): reduce scope of locals 2023-01-24 13:15:40 +00:00
a56dc7a7f6 feat(tui): support altfont mode in tui.c 2023-01-24 11:27:50 +00:00
f3039ce531 feat(highlight): define the concept of altfont as a (c)term rendering attribute 2023-01-24 11:27:50 +00:00
f5d357de55 refactor(highlight): reshape the HL_UNDER* bits into a 3-bit integer mask
Saves two bits for reuse for new features
2023-01-24 11:27:50 +00:00
c6ab8dfc15 revert: "refactor(win_close): remove "force", don't pass on "free_buf" (#21921)" (#21979)
This reverts commit 0371d0f7af.

> 'bufhidden' option exists. I don't think we should assume autoclosing
windows are fine just because 'hidden' is set.
2023-01-24 18:31:07 +08:00
39630265c4 build: remove GNU make check (#21977)
The entire thing is incorrect. It checks the wrong variable and tries to
unset a cache variable without using the CACHE keyword, which doesn't work.
2023-01-24 10:40:50 +01:00
34a16209bb build: delete pthreads import (#21732)
We shouldn't need this as all threading should already be handled by
libuv. Furthermore, it wasn't even used correctly as
CMAKE_THREAD_PREFER_PTHREAD has been removed from cmake a long time ago.
2023-01-24 10:40:18 +01:00
993dc6e97e build: use upstream CMakeLists.txt for unibilium (#21976)
Also remove UnibiliumCMakeLists.txt as it's not necessary anymore.
2023-01-24 09:36:32 +01:00
bcbdb94185 build: simplify treesitter installation (#21969) 2023-01-24 08:55:56 +01:00
20a932cb72 build: use cmake for all platforms for unibilium and libtermkey (#21926)
It's simpler to rely on the same build file, especially if there aren't
any platform-specific workarounds like in this case.
2023-01-24 08:55:38 +01:00
fca39eeabb fix(api): don't allow hiding aucmd_win from another tabpage (#21975) 2023-01-24 15:39:43 +08:00
bcdbf77537 fix(lsp): check method is supported when range formatting (#21970)
`vim.lsp.buf.format()` silently did nothing if no servers supported
`textDocument/rangeFormatting` when formatting with a range.

Issue found by `@hwrd:matrix.org` in the Matrix chat.
2023-01-24 07:15:43 +01:00
7126d9b8c7 refactor(window): remove aucmd_win check from one_window() (#21972)
In most places where one_window() or last_window() is called, aucmd_win
has already been checked, so there is no need to check for it again.

The only place where this isn't checked is when using `:wincmd T`.
Before this PR using `:wincmd T` in an aucmd_win will give a warning
when there is only one non-floating window, but E813 error if there are
multiple. Now it consistently gives E813 error.
2023-01-24 11:29:37 +08:00
fa12b9ca2b vim-patch:partial:9.0.1237: code is indented more than necessary (#21971)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11858)

6ec6666047

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-24 08:43:51 +08:00
dbb6c7f1b8 vim-patch:9.0.1236: code in same_leader() can be simplified (#21968)
Problem:    Code in same_leader() can be simplified.
Solution:   Simplify code that is executed only once. (closes vim/vim#11867)

9cbf791995
2023-01-24 07:40:22 +08:00
322c83896d build: remove unnecessary unit test code (#21940)
The files generated by test/includes/CMakeLists.txt have been unused
since commit c49e22d396. The unittests include the headers in
test/includes directly without any processing, meaning that the
CMakeLists.txt file is no longer necessary.
2023-01-24 00:03:25 +01:00
5a94d24095 fix: add manifest file to correctly determine Windows version (#21953)
In Windows 8.1 and later, GetVersionEx does not automatically give the
correct information if a manifest file doesn't explicitly mention we
support that version. This will enable further detection for Windows 8.1
and Windows 10/11 when using windowsversion(), with an easy way to add
future versions. A list of all operating system versions can be found
here:
https://learn.microsoft.com/en-us/windows/win32/sysinfo/operating-system-version
2023-01-23 23:47:06 +01:00
f08051c2e6 feat!: make iconv a non-optional dep 2023-01-23 16:33:45 +00:00
3b75485043 revert: "shada/context: fully remove jumplist duplicates #10898" (#21874)
This reverts commit 8b8ecf44f2.
It is causing performance problems on exit.
Fix #21082.
2023-01-23 19:32:27 +08:00
0371d0f7af refactor(win_close): remove "force", don't pass on "free_buf" (#21921)
Problem:
The "force" flag of win_close() complicates the code and adds edge cases
where it is not clear what the correct behavior should be.
The "free_buf" flag of win_close() is passed on to float windows when
closing the last window of a tabpage, which doesn't make much sense.

Solution:
Remove the "force" flag and always close float windows as if :close! is
used when closing the last window of a tabpage, and set the "free_buf"
flag for a float window based on whether its buffer can be freed.
As 'hidden' is on by default, this change shouldn't affect many people.
2023-01-23 18:55:11 +08:00
d58bf4ff30 perf(completion): use one call to globpath() for .vim and .lua #21942
Test using the following test script (timings with ASAN):

    let start = reltime()
    for i in range(100)
      call getcompletion('', 'filetype')
    endfor
    echomsg reltimefloat(reltime(start))

Without this PR: 3.251825 seconds
With this PR: 2.747285 seconds
2023-01-23 02:42:37 -08:00
45d511574c project: "steps to reproduce" in lsp_bug_report #21932 2023-01-23 02:11:53 -08:00
b36b58d0d4 fix(Windows): restore console title at exit #21922
Fixes #21404
2023-01-23 01:45:18 -08:00
cb757f2663 build: make generated source files reproducible #21586
Problem:
Build is not reproducible, because generated source files (.c/.h/) are not
deterministic, mostly because Lua pairs() is unordered by design (for security).

https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671
https://www.lua.org/manual/5.1/manual.html#pdf-next
> The order in which the indices are enumerated is not specified [...]
>
>> The hardening of the VM deliberately randomizes string hashes. This in
>> turn randomizes the iteration order of tables with string keys.

Solution:
- Update the code generation scripts to be deterministic.
    - That is only a partial solution: the exported function
      (funcs_metadata.generated.h) and ui event
      (ui_events_metadata.generated.h) metadata have some mpack'ed
      tables, which are not serialized deterministically.
    - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can
      inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0)
      that preserves table order.
    - Longer-term we should change the mpack'ed data structure so it no
      longer uses tables keyed by strings.

Closes #20124

Co-Authored-By: dundargoc <gocdundar@gmail.com>
Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
2023-01-23 01:26:46 -08:00
da671b21cc refactor(PVS/V1048): remove redundant assignment (#21871) 2023-01-23 11:42:16 +08:00
323ea17a19 fix(extmarks): problems with folded virtual lines (#21930)
Problem:    When a folded line has virtual lines attached, the following
            problems occur:
              - The virtual lines are drawn empty.
              - The 'foldtext' line is drawn empty.
              - The cursor is drawn incorrectly.
Solution:   Check whether virtual lines belong to a folded line.

Fix #17027
Fix #19557
Fix #21837

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-01-23 07:43:04 +08:00
0f633ff494 vim-patch:9.0.1233: search() loops forever if "skip" is TRUE for all matches (#21956)
Problem:    search() loops forever if "skip" is TRUE for all matches.
Solution:   Keep the position of the first match.

3d79f0a430

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-23 07:36:01 +08:00
1b642648f6 vim-patch:9.0.1230: Apache Thrift files are not recognized (#21955)
Problem:    Apache thrift files are not recognized.
Solution:   Add a pattern for thrift files. (Amaan Qureshi, closes vim/vim#11859)

f3da4c8427
2023-01-23 07:08:08 +08:00
e5a537c885 fix: use correct number for INT_MAX (#21951)
Actually use INT_MAX rather than a number to prevent these types of
situations to begin with.
2023-01-23 06:08:38 +08:00
8e52d8a394 fix(lsp): assert workspace/applyEdit receives params (#21945)
According to the specification `workspace/applyEdit` must be called with
`ApplyWorkspaceEditParams`.

So far the client just returned, which could lead to a misleading error
on the server side because `workspace/applyEdit` must respond with a
`ApplyWorkspaceEditResult`.

This adds an assertion to clarify that the server is violating the
specification.

See https://github.com/neovim/neovim/issues/21925
2023-01-22 18:54:09 +01:00
63e67468b4 build: use CMAKE_POSITION_INDEPENDENT_CODE instead of -fPIC (#21947)
It's simpler to let cmake figure out what flags to add to each platforms
to create position independent code rather than handling it ourselves.

Also remove code that sets POSITION_INDEPENDENT_CODE property on SHARED
and MODULE libraries, as it's already on by default.
2023-01-22 18:02:02 +01:00
151b9fc52e feat(treesitter): show filetype associated with parser (#17633)
to ease debug. At one point I had an empty filetype and the current message was not helpful enough
2023-01-22 16:51:17 +01:00
80bede1dfc vim-patch:9.0.1229: Cap'n Proto files are not recognized (#21950)
Problem:    Cap'n Proto files are not recognized.
Solution:   Add a pattern and the "capnp" filetype. (Amaan Qureshi,
            closes vim/vim#11862)

040e795e8d
2023-01-22 22:08:33 +08:00
2ef913468b vim-patch:9.0.1228: fuzzy menu completion is only tested in the GUI (#21948)
Problem:    Fuzzy menu completion is only tested in the GUI.
Solution:   Make fuzzy menu completion test work without GUI.
            (closes vim/vim#11861)

145a6afe3a
2023-01-22 21:13:52 +08:00
18fb669b9b fix(completion): include lua syntaxes in :ownsyntax completion (#21941)
This just removes DIP_LUA and always executes its branches.
Also add tests for cmdline completion for other lua runtime files.
2023-01-22 11:19:58 +08:00
108452aaba vim-patch:9.0.1225: reading past the end of a line when formatting text (#21937)
Problem:    Reading past the end of a line when formatting text.
Solution:   Check for not going over the end of the line.

11977f9175

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-22 07:41:39 +08:00
0f52e2c849 vim-patch:8.2.0382: some tests fail when run under valgrind (#21936)
Problem:    Some tests fail when run under valgrind.
Solution:   Increase timeouts.

353c351bd2

Cherry-pick Test_pum_with_preview_win() from patch 8.2.0011.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-21 20:50:46 +08:00
fb805bb8b7 fix(remote): don't leak memory on failure to connect to server (#21931)
Also fix the race between output and resize in the test for this.
2023-01-21 18:54:17 +08:00
eec979ca81 test(tui_spec): don't expect exact screen in rapid resize test (#21935)
There may be a race between resizes, so don't expect exact screen.
Expect window width instead.
2023-01-21 18:15:38 +08:00
e336251f2b test(tui_spec): make rapid resize test test what it wants to test (#21933)
Actually execute the command.
Don't use assert_alive() as it checks the host session instead of the
child session. Use screen:expect() instead.
2023-01-21 17:11:02 +08:00
9a81ce6854 build: bump MSVC warning to level two (#21890) 2023-01-21 09:55:10 +01:00
7ef5e363d3 feat(lsp): add triggerKind option for vim.lsp.buf.code_action (#21905) 2023-01-21 08:22:34 +01:00
e86d2734a9 refactor: use uint8_t for blobs and ga_append() (#21916)
A blob is used as a sequence of bytes and usually accessed individually,
not as as a NUL-terminuated string, so uint8_t should be better.

Not sure about ga_append(), but using uint8_t leads to fewer casts.
2023-01-21 09:24:09 +08:00
1c16d0994d refactor: change char_u to uint8_t or char in sha256.c/undo.c (#21914)
Use uint8_t for bytes in hashes as it doesn't make sense for them to be signed.
2023-01-21 08:58:57 +08:00
efe5ce6fa8 vim-patch:9.0.1223: cannot use setcellwidths() below 0x100 (#21929)
Problem:    Cannot use setcellwidths() below 0x100.
Solution:   Also accept characters between 0x80 and 0x100. (Ken Takata,
            closes vim/vim#11834)

7193323b77

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-01-21 08:44:14 +08:00
4c5c6ca800 build: various cmake fixes (#21902)
* build: various cmake refactors and simplifications

- Add STATUS keyword to message to ensure messages are shown in the
  correct order.
- Remove DEPS_CXX_COMPILER as we don't rely on C++ for any of our
  dependencies.
- Simplify how msgpack and luv configure options are constructed.
- Rely on the default installation for luv instead of manually passing
  configure, build and install commands.
- Simplify return code conditional.

* build: remove CMAKE_OSX_ARCHITECTURES_ALT_SEP workaround

CMAKE_OSX_ARCHITECTURES_ALT_SEP was defined as a workaround to prevent
the shell from interpreting `;`, which CMake uses as a list separator.
However, the same thing can be achieved by instead passing
CMAKE_OSX_ARCHITECTURES as a cache variable instead, which is a more
idiomatic way of achieving the same thing.

* build: define CMAKE_BUILD_TYPE before adding it to BUILD_TYPE_STRING

The problem with the current setup is that CMAKE_BUILD_TYPE is defined
after BUILD_TYPE_STRING. BUILD_TYPE_STRING will then be empty on the
first run, meaning that dependencies are built without a build type.
However, since CMAKE_BUILD_TYPE is a cache variable its value will
persist in subsequent runs. On the second run BUILD_TYPE_STRING will
have the correct value, but it's a different value from the ones the
dependencies were built with. This will force some dependencies to be
built again.

Fixes https://github.com/neovim/neovim/issues/21672.
2023-01-20 23:48:46 +01:00
c41214c7d4 docs: docs: use codeblocks in runtime/doc/options.txt (#21919)
ensure correct parsing with tree-sitter

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-01-20 17:29:15 +01:00
d8d39344e3 fix(lsp): fix removed param value in add_workspace_folder (#21915) 2023-01-20 07:59:31 +01:00
51d082b466 vim-patch:9.0.0358: 'breakindent' does not indent non-lists (#21913)
Problem:    'breakindent' does not indent non-lists with
            "breakindentopt=list:-1".
Solution:   Adjust indent computation. (Maxim Kim, closes vim/vim#11038)

119167265e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2023-01-20 10:35:52 +08:00
0481f04ec9 test(syn_attr_spec): add more information (#21912)
This makes it clear on test failure what the attributes are.
2023-01-20 10:03:29 +08:00
999bb983f0 perf(statuscolumn): only fill click defs array once per redraw (#21884)
Problem:    'statuscolumn' click definitions are cleared, evaluated,
            allocated and filled each redraw for every row in a window.
            This despite the fact that we only store a single click
            definition array for the entire column as opposed to one
            for each row.
Solution:   Only fill the 'statuscolumn' click definition array once per
            window per redraw.

Resolve https://github.com/neovim/neovim/issues/21767.
2023-01-20 07:47:02 +08:00
775e292290 build: remove nvim as a dependency of unittests (#21903)
Unittests rely on nvim-test and not nvim, leading to both nvim and
nvim-test being compiled each time a file is changed. Furthermore, the
dependencies are already specified by CMakeLists.txt and shouldn't need
to be specified in Makefile as it's only meant to be syntactic sugar.
2023-01-19 22:12:27 +01:00
5f3b76d5ce refactor(highlight_group.c): reduce scope of locals 2023-01-19 15:54:59 +00:00
4c531714ff refactor: replace char_u with char 25 (#21838)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-19 22:25:56 +08:00
adfad50ac0 fix(rpc): don't parse msgpack if buflen is 0 (#21899)
This prevents `buflen` from becoming a very large number when it is 0
when calling mpack_rtoken().
2023-01-19 20:38:29 +08:00
363d153bb9 fix: pass value instead of pointer to isalpha (#21898) 2023-01-19 18:48:49 +08:00
00a976129b build: enable cmake workflow presets (#21860)
Workflow presets allows combining configure, build, test and packaging
steps and makes it possible to run everything in a single command. So

cmake --preset iwyu
cmake --build --preset iwyu

instead becomes

cmake --workflow --preset iwyu

Workflow presets requires at least cmake version 3.25 to use.
2023-01-19 10:34:45 +01:00
6e3890f4ce vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894)
Problem:    Command line completion popup menu positioned wrong when using a
            terminal window.
Solution:   Position the popup menu differently when editing the command line.
            (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035)

1104a6d0c2

The test in the patch looks a bit hard to understand.
Add a Lua test that is more straightforward.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-19 15:13:27 +08:00
93adf74a03 refactor(eval.c): factor out get_number_tv() (#21893)
It was refactored into a separate function in Vim in patch 8.2.0149.
2023-01-19 13:27:36 +08:00
42e9a09a44 Merge pull request #21879 from zeertzjq/stl-click-zero-len
Fix statusline memory leaks with click labels
2023-01-19 11:00:00 +08:00
01ddc09747 fix(statusline): don't leak memory with truncated click labels 2023-01-19 10:36:29 +08:00
295a264b65 fix(statusline): don't leak memory with zero-width click labels
A zero-width click label isn't assigned to any click definition, so its
function name should be freed when filling click definitions.
2023-01-19 10:36:29 +08:00
45dc0f3454 vim-patch:9.0.1221: code is indented more than necessary (#21891)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11833)

f97a295cca

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-19 09:51:59 +08:00
f8669e8a18 vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 (#21883)
Problem:    Cannot lock a variable in legacy Vim script like in Vim9.
Solution:   Make ":lockvar 0" work.

a187c43cfe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-19 08:03:13 +08:00
42d5142367 ci: enable CI_BUILD on windows (#21557)
This will ensure warnings are treated as errors when using MSVC.

Also fix const correctness warnings. The warnings in mbyte.c are false
positives that triggers this warning on MSVC v19.32 and lower, which our
CI still use. The (void *) casts can be removed once the CI MSVC version
has been upgraded to v19.33 or higher.
2023-01-18 20:23:46 +01:00
92a46727f7 Merge pull request #21881 from bfredl/uniterror
fix(unittests): do not consider process crash to be a success
2023-01-18 18:52:24 +01:00
6bfbb4db1d fix(unittests): fix TUI broken test previously ignored 2023-01-18 14:56:55 +01:00
847a1507aa fix(unittest): delete unused duplicated code
YAGNI. These were disabled 5 years ago in lint commit 29ed5b3a39
2023-01-18 14:56:55 +01:00
9fdb586592 fix(unittests): do not consider process crash to be a success
unittests relied on the exact setup of coredumps on CI to detect
process crashing, and otherwise completely discarded errors.

Dectect child process failure reliably using process status, so that
unittests actually work locally as well.
2023-01-18 14:56:55 +01:00
8a4285d563 refactor: replace char_u with char 24 (#21823)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-18 21:17:11 +08:00
2c1e7242f9 refactor: replace char_u with char 23 (#21798)
Work on https://github.com/neovim/neovim/issues/459
2023-01-18 18:52:19 +08:00
7f7b83baef build(Windows): fix redoing version generation (#21880)
Problem: On Windows, neovim's version is generated every time nvim is
built, even if code hasn't been changed.  That is because version
generation is done based on a hash matching of a file and the content of
the file.  And in Windows they don't match, because of the DOS
line-endings.

Solution: Write the file containing nvim version with UNIX line-endings.
2023-01-18 11:48:01 +01:00
36555730da fix(statuscolumn): always fill click defs array (#21878)
Click definitions are always filled for tabline, statusline and winbar,
so they should also be always filled for statuscolumn, otherwise it will
leak memory.

Note: this doesn't actually change the existing code much, because of a
typo in the existing code.
2023-01-18 17:55:03 +08:00
0aae7f3860 vim-patch:9.0.0149: test for fuzzy completion fails sometimes (#21876)
Problem:    Test for fuzzy completion fails sometimes.
Solution:   Use a more specific file name to minimize the chance of matching a
            random directory name. (closes vim/vim#10854)

5ac4b1a24e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-18 12:00:40 +08:00
2082d275fe refactor(PVS): suppress false positive V547 in drawline.c (#21875)
This is a false positive as "did_emsg" can be set by get_syntax_attr()

Example: get_syntax_attr() -> syn_current_attr() -> syn_getcurline()
-> ml_get_buf() -> siemsg() -> semsgv() -> emsg() -> emsg_multiline()
2023-01-18 10:36:23 +08:00
0133fbb37a vim-patch:9.0.1213: adding a line below the last one does not expand fold (#21869)
Problem:    Adding a line below the last one does not expand fold.
Solution:   Do not skip mark_adjust() when adding lines below the last one.
            (Brandon Simmons, closes vim/vim#11832, closes vim/vim#10698)

da3dd7d857

Co-authored-by: Brandon Simmons <simmsbra@gmail.com>
2023-01-18 07:33:18 +08:00
1453c7163d refactor(PVS/V1048): remove unnecessary assignment (#21870) 2023-01-18 07:22:25 +08:00
847e603554 Merge pull request #21868 from zeertzjq/vim-9.0.1214
vim-patch:9.0.{1214,1215}
2023-01-18 07:21:57 +08:00
9a2dd52a6a vim-patch:9.0.1215: using isalpha() adds dependency on current locale
Problem:    Using isalpha() adds dependency on current locale.
Solution:   Do not use isalpha() for recognizing a URL or the end of an Ex
            command. (closes vim/vim#11835)

0ef9a5c094
2023-01-18 06:50:47 +08:00
8c344378b8 vim-patch:9.0.1214: file left behind after running tests
Problem:    File left behind after running tests.
Solution:   Delete the file. (Dominique Pellé, closes vim/vim#11839)

541c87c808

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-01-18 06:50:47 +08:00
f4e03cbdbc vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)
Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes vim/vim#11837)

66bb9ae70f

Co-authored-by: Kota Kato <github@kat0h.com>
2023-01-18 06:50:22 +08:00
20b7be2d10 fix(treesitter): really restore syntax
- also unset b:ts_highlight on stop()

Fixes: #21836
2023-01-17 16:56:23 +00:00
0344bfad0f refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
2023-01-17 21:17:40 +08:00
99186508d9 Merge pull request #21859 from zeertzjq/vim-8.2.4617
vim-patch:8.2.{4617,4618,4620,5126}
2023-01-17 20:49:08 +08:00
c416da9d1a vim-patch:8.2.5126: substitute may overrun destination buffer
Problem:    Substitute may overrun destination buffer.
Solution:   Disallow switching buffers in a substitute expression.

d6211a52ab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
8aece0089d vim-patch:8.2.4618: cmdline completion does not recognize single letter commands
Problem:    Command line completion does not recognize single letter commands.
Solution:   Use the condition from find_ex_command().

f4f0525c34

vim-patch:8.2.4620: two letter substitute commands don't work

Problem:    Two letter substitute commands don't work. (Yegappan Lakshmanan)
Solution:   Invert condition.

1e2c4175dc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 20:26:12 +08:00
3db2139195 vim-patch:8.2.4617: no completion for :scriptnames
Problem:    No completion for :scriptnames.
Solution:   Implement :scriptnames completion. (Yegappan Lakshmanan,
            closes vim/vim#10005)

454ce6737c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 20:26:06 +08:00
2d71ed9929 build(deps): bump tree-sitter to HEAD - eb970a83a (#21858)
includes efd22e452b which fixes some errors around infinite loops with injections
2023-01-17 12:57:06 +01:00
132f001ce8 vim-patch:8.2.4483: command completion makes two rounds to collect matches (#21857)
Problem:    Command completion makes two rounds to collect matches.
Solution:   Use a growarray to collect matches. (Yegappan Lakshmanan,
            closes vim/vim#9860)

5de4c4372d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 19:52:02 +08:00
ddd69a6c81 vim-patch:8.2.4959: using NULL regexp program (#21855)
Problem:    Using NULL regexp program.
Solution:   Check for regexp program becoming NULL in more places.

b62dc5e782

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 17:02:25 +08:00
b4d669e7ac vim-patch:8.2.4928: various white space and cosmetic mistakes (#21854)
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.

6ed545e797

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 16:53:37 +08:00
58f2dcfc88 vim-patch:8.2.4917: fuzzy expansion of option names is not right (#21853)
Problem:    Fuzzy expansion of option names is not right.
Solution:   Pass the fuzzy flag down the call chain. (Christian Brabandt,
            closes vim/vim#10380, closes vim/vim#10318)

cb747899bd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-01-17 16:46:43 +08:00
8abf53be6e vim-patch:9.0.0089: fuzzy argument completion doesn't work for shell commands (#21852)
Problem:    Fuzzy argument completion doesn't work for shell commands.
Solution:   Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan,
            closes vim/vim#10769)

7db3a8e329

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 16:28:15 +08:00
fc692dfce1 Merge pull request #21851 from zeertzjq/vim-8.2.4482
vim-patch:8.2.{4482,4485}: fuzzy cmdline custom completion
2023-01-17 16:16:44 +08:00
d512678739 fix(completion): correct what modes support fuzzy completion 2023-01-17 15:55:58 +08:00
441d13eae5 vim-patch:8.2.4482: no fuzzy cmdline completion for user defined completion
Problem:    No fuzzy cmdline completion for user defined completion.
Solution:   Add fuzzy completion for user defined completion. (Yegappan
            Lakshmanan, closes vim/vim#9858)

afd4ae35d6

Cherry-pick related docs from Vim runtime.

N/A patches for version.c:

vim-patch:8.2.4485: compiler warning for uninitialized variable
vim-patch:8.2.4732: duplicate code to free fuzzy matches

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 15:55:58 +08:00
2093e574c6 Merge pull request #21850 from zeertzjq/vim-8.2.4463
vim-patch:8.2.{4463,4465,4475,4477,4478,4479,4608}: fuzzy cmdline builtin completion
2023-01-17 14:34:27 +08:00
15e42dd449 vim-patch:8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Problem:    getcompletion() does not work properly when 'wildoptions
            contains "fuzzy".
Solution:   Do not use addstar(). (Yegappan Lakshmanan, closes vim/vim#9992,
            closes vim/vim#9986)

e7dd0fa2c6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
5ce6685119 vim-patch:8.2.4479: no fuzzy completieon for maps and abbreviations
Problem:    No fuzzy completieon for maps and abbreviations.
Solution:   Fuzzy complete maps and abbreviations. (Yegappan Lakshmanan,
            closes vim/vim#9856)

6caeda2fce

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
245522db1e vim-patch:8.2.4478: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9852, closes vim/vim#9851)

00333cb3b3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
bdd14d03c7 vim-patch:8.2.4477: crash when using fuzzy completion
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes vim/vim#9851)

29ab6ce9f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 14:01:26 +08:00
4c127f107a vim-patch:8.2.4475: fuzzy cmdline completion does not work for lower case
Problem:    Fuzzy cmdline completion does not work for lower case.
Solution:   Also use fuzzy completion for lower case input. (Yegappan
            Lakshmanan, closes vim/vim#9849)

4df5b33f20

Initialize "regmatch" to avoid using uninitialized memory.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
0c689fec8e vim-patch:8.2.4465: fuzzy completion does not order matches properly
Problem:    Fuzzy completion does not order matches properly.
Solution:   Do not use regular expression match. (Yegappan Lakshmanan,
            closes vim/vim#9843)

5ec633b9b0

Nvim's ExpandGeneric() was refactored to eliminate looping for "round",
so the patch has been adapted.

fuzzy_match_str() change was already applied earlier.

In Test_wildoptions_fuzzy(), test for NvimParenthesis over MatchParen
for :syntax list, as the fuzzy matching algorithm prefers the former
(even in Vim).

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:26 +08:00
6734dd2503 vim-patch:8.2.4463: completion only uses strict matching
Problem:    Completion only uses strict matching.
Solution:   Add the "fuzzy" item for 'wildoptions'. (Yegappan Lakshmanan,
            closes vim/vim#9803)

38b85cb4d7

Use MAX_FUZZY_MATCHES in fuzzy_match_str().
Omit fuzmatch_str_free() as it is only used on allocation failure.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 14:01:10 +08:00
34e62d3875 refactor: remove char_u from arguments of fuzzy_match()
Also change some single quotes to double quotes.
2023-01-17 12:48:31 +08:00
f6929ea51d fix(tabline): avoid memory leak in tabline click definitions (#21847)
Problem:    Memory is leaked in tabline click definitions since
            https://github.com/neovim/neovim/pull/21008.
Solution:   Add back a call to `stl_clear_click_defs()` that was lost in
            the refactor PR.
2023-01-17 09:51:01 +08:00
6c2f02cbd0 fix: failing XDG test on Windows CI
Problem:
Failing Windows CI:
    FAILED   test/functional\options\defaults_spec.lua @ 361: XDG defaults with too long XDG variables are correctly set
    test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: /X/X/X" not found in log (last 10 lines): Xtest-defaults-log:
    FAILED   test/functional\options\defaults_spec.lua @ 435: XDG defaults with XDG variables that can be expanded are not expanded
    test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: %$XDG_RUNTIME_DIR%/" not found in log (last 10 lines): Xtest-defaults-log:

Solution:
The assert_log() statements are not relevant on Windows, because there
XDG_RUNTIME_DIR is not used for creating servers, it uses \\.pipe\….
2023-01-17 01:57:52 +01:00
f72cb97fa0 vim-patch:9.0.1208: code is indented more than necessary (#21846)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11819)

a41e221935

Cherry-pick check_text_or_curbuf_locked() from patch 9.0.0947.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-17 08:09:51 +08:00
bbdded5cf7 test(statuscolumn): %l should follow default wrap behavior (#21766) 2023-01-17 08:02:33 +08:00
2302ca4700 refactor: fix sign conversion warning from gcc (#21833) 2023-01-17 07:43:04 +08:00
7ebb1cf28f Merge #21844 test: avoid noise in test logs 2023-01-16 18:38:20 -05:00
da3460562e fix(api): avoid memory leak with click functions in nvim_eval_statusline() (#21845)
Problem:    Allocated click function memory is lost due to
            `nvim_eval_statusline()` not passing in a `StlClickRecord`.
Solution:   Do not allocate click function memory if `tabtab == NULL`.

Resolve #21764, supersede #21842.
2023-01-17 07:31:36 +08:00
665a7dafaf refactor(tests): lift retry() into assert_log() 2023-01-17 00:19:30 +01:00
6ec7bcb618 test: avoid noise in NVIM_LOG_FILE
Problem:
Tests that _intentionally_ fail certain conditions cause noise in
$NVIM_LOG_FILE:

    $NVIM_LOG_FILE: /home/runner/work/neovim/neovim/build/.nvimlog
    (last 100 lines)
    WRN 2023-01-16T18:26:27.673 T599.7799.0 unsubscribe:519: RPC: ch 1: tried to unsubscribe unknown event 'doesnotexist'
    WRN 2023-01-16T18:29:00.557 ?.11151    server_start:163: Failed to start server: no such file or directory: /X/X/X/...
    WRN 2023-01-16T18:33:07.269 127.0.0.1:12345 server_start:163: Failed to start server: address already in use: 127.0.0.1
    ...
    -- Output to stderr:
    module 'vim.shared' not found:
    	no field package.preload['vim.shared']
    	no file './vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared/init.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared/init.lua'
    	no file './vim/shared.so'
    	...
    E970: Failed to initialize builtin lua modules

Solution:
- Log to a private $NVIM_LOG_FILE in tests that intentionally fail and
  cause ERR log messages.
- Assert that the expected messages are actually logged.
2023-01-16 23:56:56 +01:00
9ccc6de8d3 Merge pull request #21768 from luukvbaal/test-virtline
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines

BREAKING CHANGE: In 'statuscolumn' evaluation, `v:wrap` has been
replaced by `v:virtnum`. `v:virtnum` is negative when drawing
virtual lines, zero when drawing the actual buffer line, and
positive when drawing the wrapped part of a buffer line.
2023-01-17 06:24:52 +08:00
1484995a1e Merge pull request #21839 from seandewar/lua-health-fix
feat(health): detect tmux RGB support via `client_termfeatures`
2023-01-16 18:23:44 +00:00
d8eb99e363 Merge pull request #21828 from clason/bump-libvterm
build(deps): bump libvterm to v0.3.1
2023-01-16 19:04:24 +01:00
7295ed1f6f build(deps): bump libvterm to v0.3.1
Included patches:

821. By Paul "LeoNerd" Evans on 2022-12-29
Don't bother to emit the unrecognised sequence in DECRQSS response as it provides an echo roundtrip possibility

820. By Paul "LeoNerd" Evans on 2022-11-26
erase_internal() should only set fg/bg colour, resetting other attributes (especially RV)

819. By Paul "LeoNerd" Evans on 2022-11-09
Added vterm_screen_set_default_colors(), which repaints the cells in the buffer(s)

818. By Paul "LeoNerd" Evans on 2022-11-09
Permit either colour argument to be NULL to vterm_state_set_default_colors()

817. By Paul "LeoNerd" Evans on 2022-10-01
Delete the mk_wcswidth functions as they're not used; guard the CJK-wide one with an ifdef as by default we don't use it

816. By Paul "LeoNerd" Evans on 2022-10-01
Make sure to supply empty (void) prototype to functions that take no arguments in bin/vterm-ctrl.c
2023-01-16 18:40:19 +01:00
7e24c45221 feat(health): detect tmux RGB support via client_termfeatures
Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB
capabilities over `terminal-overrides`. However, `show-messages` cannot be used
to detect if RGB capabilities are enabled using `terminal-features`.

Solution: Try to use `display-message -p #{client_termfeatures}` instead.
The returned features include "RGB" if either "RGB" is set in
`terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as
before).
Nothing is returned by tmux versions older than v3.2, so fallback to checking
`show-messages` in that case.

Also, un-Vimscriptify the previous logic a bit, and change the error message to
point to using the `terminal-features` option instead for newer tmux versions.
2023-01-16 15:30:57 +00:00
60df0c0651 fix(health): fix tmux_esc_time comparison
Regression from the health.vim to .lua changes.

Unlike Vim script, Lua does not implicitly convert strings to numbers, so this
comparison threw an error.
2023-01-16 14:26:29 +00:00
54470336ff fix(column): avoid drawing columns for virt_lines_leftcol
Problem:    The default fold column, as well as the 'statuscolumn', were
            drawn unnecessarily/unexpectedly for virtual lines placed
            with `virt_lines_leftcol` set.
Solution:   Skip the column states if a virtual line with
            `virt_lines_leftcol` set will be drawn.
2023-01-16 15:09:12 +01:00
85111ca0f4 fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines
Problem:    The `'statuscolumn'` was not re-evaluated for wrapped lines,
            when preceded by virtual/filler lines. There was also no way
            to distinguish virtual and wrapped lines in the status column.
Solution:   Make sure to rebuild the statuscolumn, and replace variable
            `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing
            virtual lines, zero when drawing the actual buffer line, and
            positive when drawing the wrapped part of a buffer line.
2023-01-16 14:03:09 +01:00
ef89f9fd46 docs: treesitter.add_directive, add_predicate #21206 2023-01-16 04:39:19 -08:00
9e1d2e2ca7 build(deps): bump LuaJIT to HEAD - d0e88930d
build(deps): bump LuaJIT to HEAD-d0e88930d

 Don't fail for Clang builds, which pretend to be an ancient GCC.
 Fix compiler warning.
2023-01-16 12:10:42 +00:00
e7ea156604 Merge pull request #20945 from erw7/feat-more-exception-info
feat(api): show more exception info
2023-01-16 19:28:17 +08:00
90493beb15 Merge pull request #21831 from bfredl/nofd
fix(ui): re-organize tty fd handling and fix issues
2023-01-16 11:55:34 +01:00
2773685c1d Merge #21175 exepath() with powershell 2023-01-16 05:28:56 -05:00
e5b9485eac test: align Test_shell_options, Test_shellslash with Nvim default
'shellxquote' Nvim default was adjusted in: 131aad953c
The use of "/s" is different than Vim, and may avoid the need for `shellxquote="&|<>()@^`.

For the other shells, Nvim intentionally does not fiddle with the
various "shell*" options if 'shell' is set by the user: if the user sets
'shell', they are expected to set other "shell*" options correctly.
2023-01-16 11:27:35 +01:00
7360dda670 vim-patch:8.2.3071: shell options are not set properly for PowerShell
(Most of this patch is intentionally dropped, it adds far too much
special-cases for almost zero purpose: ":help shell-powershell" makes it
easy to choose powershell without spreading special-cases throughout the
codebase, randomly changing slash behavior, etc.)

Problem:    Shell options are not set properly for PowerShell.
Solution:   Use better option defaults. (Mike Willams, closes vim/vim#8459)

127950241e

Co-authored-by: Mike Williams <mikew@globalgraphics.com>
2023-01-16 11:27:35 +01:00
26d6e27973 vim-patch:8.2.3070: not enough testing for shell use
Problem:    Not enough testing for shell use.
Solution:   Add a bit more testing. (Yegappan Lakshmanan, closes vim/vim#8469)

ffec6dd16a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-16 11:27:35 +01:00
48144525bf vim-patch:8.2.3061: testing the shell option is incomplete and spread out
Problem:    Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
            Lakshmanan, closes vim/vim#8464)

054794c20f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-16 11:27:35 +01:00
52268afb1c fix(exepath)!: prefers extensionless for powershell
PROBLEM:
exepath("test") should prefer ".bat" when shell=powershell.
Current behavior differs from Vim 8.2.3071.

TEST CASE:
1. in a folder which is in $PATH, create files "test" "test.bat".
   - "(Get-Command test).Path test" returns "test.bat".
2. compare nvim:
     nvim --clean
     :set shell=powershell
     :echo exepath("test")
3. should returns "path\to\test.bat" (before this patch it returns "path\to\test").

SOLUTION:
After this patch, the binary files "text.exe", "test.bat", "test.com"
will be found, but the file "test" (without any extension) will not be
found (matches Vim 8.2.3071). But powershell's `where` and
`Get-Command` _do_ find the extensionless 'test' file.

But Nvim with ":set shell=cmd.exe", doesn't find "test" either (before
and after this patch), even though `where test` returns correct path in
cmd.

- `where` is a program to find files in general, not just executable files.
-`Get-Command` returning extensionless (and thus non-executable) file is
  puzzling even to Chris Dent, [PowerShell expert][1] (asked on
  Discord).

[1]: https://www.amazon.com/Mastering-PowerShell-Scripting-Automate-environment-ebook/dp/B0971MG88X

Co-authored-by: Enan Ajmain <3nan.ajmain@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>

Fixes #21045
2023-01-16 11:26:57 +01:00
160c69b655 fix(ui): re-organize tty fd handling and fix issues
- Use the correct fd to replace stdin on windows (CONIN)
- Don't start the TUI if there are no tty fd (not a regression,
  but makes sense regardless)
- De-mythologize "global input fd". it is just STDIN.
2023-01-16 11:26:49 +01:00
6383e454ab ci: run each linter once (#21825)
Running "make lintlua" will run both stylua and luacheck if both exist.
But this is not necessary as we already lint with stylua with the
stylua-action, so we only need to lint with luacheck on our own.
2023-01-16 11:11:48 +01:00
61d5bd561a refactor: remove E5500, adjust tests
Now with try_end() including more exception info, E5500 looks like
redundant information.
Adjust tests for more exception information.
2023-01-16 18:03:08 +08:00
ce66f158b5 feat(api): show more exception info 2023-01-16 17:58:57 +08:00
307efe4906 health: migrate to Lua #21661
* refactor: remove all vimscript from nvim/health
* fixup: previous method broke if you had a folder named 'x-lua'
2023-01-16 01:55:24 -08:00
8a5dad44a7 docs(news): graduation of msgsep #21826 2023-01-16 01:44:20 -08:00
be3d30cace fix(diff): "nvim -d" should only diff arglist files #21829
Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2023-01-16 01:37:58 -08:00
34b973b1d9 docs(lua): use luaref tag instead of www.lua.org #21813 2023-01-15 13:32:23 -08:00
69c71c4ab4 build: exclude tui/terminfo_defs.h from lintc-clint (#21822)
clint takes around 5-10 seconds to lint tui/terminfo_defs.h. For CI this
is negligible, but it's annoying for local development as touching
terminfo_defs.h will skyrocket lint times. Furthermore, we have no
reason to touch or modify terminfo_defs.h as it's a generated file, so
linting it shouldn't be necessary. This should speed up "make lint" by
the same amount, so around 5-10 seconds.
2023-01-15 19:30:17 +01:00
c752c85363 refactor: format with stylua (#21821) 2023-01-15 16:00:23 +01:00
3269902a13 refactor: fix IWYU mapping file and use IWYU (#21802)
Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
2023-01-15 14:16:33 +01:00
43feb973e3 Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenu
fix: properly close builtin popup in ext_popupmenu
2023-01-15 13:40:55 +01:00
909abfbd87 ci: deduplicate TEST_FILE environment variable (#21667) 2023-01-15 12:25:28 +01:00
6f0234a5e5 docs(lua): lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814) 2023-01-15 12:08:03 +01:00
6134c1e8a3 test(fileio_spec): avoid expect_exit() without calling clear() (#21810)
Since before_each() doesn't call clear() in these tests, after_each()
may call expect_exit() without calling clear() if a test is skipped,
causing frequent test failures on Cirrus CI. Close the session instead.
2023-01-15 09:34:21 +08:00
2f32b19967 vim-patch:8.2.0188: Check commands don't work well with Vim9 script (#21809)
Problem:    Check commands don't work well with Vim9 script.
Solution:   Improve constant expression handling.

7f829cab35

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 09:08:51 +08:00
9dd5903273 Merge pull request #21806 from zeertzjq/vim-8.2.4565
vim-patch:8.2.{4563,4565,4570}: cmdline completion for :breakadd, :breakdel, :profdel
2023-01-15 08:38:23 +08:00
064fdad98c vim-patch:8.2.4570: no command line completion for :profile and :profdel
Problem:    No command line completion for :profile and :profdel.
Solution:   Implement completion. (Yegappan Lakshmanan, closes vim/vim#9955)

1fdf84e033

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:59:45 +08:00
f2056e4045 vim-patch:8.2.4565: no command line completion for :breakadd and :breakdel
Problem:    No command line completion for :breakadd and :breakdel.
Solution:   Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
            closes vim/vim#9950)

6e2e2cc95b
2023-01-15 07:59:45 +08:00
89f45dc155 vim-patch:8.2.4563: "z=" in Visual mode may go beyond the end of the line
Problem:    "z=" in Visual mode may go beyond the end of the line.
Solution:   Adjust "badlen".

5c68617d39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:59:45 +08:00
fe17cd50fb Merge pull request #21807 from zeertzjq/vim-8.2.4579
vim-patch:8.2.{4481,4579,4585}: PageUp/PageDown for cmdline pum
2023-01-15 07:59:24 +08:00
940643aa33 vim-patch:8.2.4585: cannot use keypad page-up/down for completion menu
Problem:    Cannot use keypad page-up/down for completion menu.
Solution:   Recognize the keypad keys. (Yegappan Lakshmanan, closes vim/vim#9963)

155b088208

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
066a1a069b vim-patch:8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Problem:    Cannot use page-up and page-down in the command line completion
            popup menu.
Solution:   Check for to page-up and page-down keys. (Yegappan Lakshmanan,
            closes vim/vim#9960)

5cffa8df7e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
44710a91d0 vim-patch:8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Problem:    Cmdline popup menu not removed when 'lazyredraw' is set.
Solution:   Temporarily reset 'lazyredraw' when removing the popup menu.
            (closes vim/vim#9857)

5c52be40fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:00:53 +08:00
4c8d707a5e vim-patch:9.0.0876: code is indented more than needed (#21805)
Problem:    Code is indented more than needed.
Solution:   Split ExpandEscape() in two. (Yegappan Lakshmanan, closes vim/vim#11539)

68353e5270

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 06:34:45 +08:00
f445096cc6 vim-patch:9.0.1043: macro has confusing name and is duplicated (#21801)
Problem:    Macro has confusing name and is duplicated.
Solution:   Use one macro with an understandable name. (closes vim/vim#11686)

c51a376265
2023-01-15 05:27:55 +08:00
7af2c52ef0 docs: builtin TUI is no longer channel 0 (#21794) 2023-01-15 05:24:19 +08:00
da70c39405 fix(extmarks): adjust extmarks when inserting prompt prefix 2023-01-14 20:11:03 +02:00
8b86cb8f5b vim-patch:8.2.4406: expand functions use confusing argument names (#21800)
Problem:    Expand functions use confusing argument names.
Solution:   Rename "file" to "match".  Refactor some completion code.  Add a
            few more tests. (Yegappan Lakshmanan, closes vim/vim#9790)

2438430863

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 23:44:38 +08:00
c1fffc42fb build: enable iwyu with target properties instead of variables (#21797)
IWYU stopped working after 438b4361cc,
likely due to the code being moved from CMakeLists.txt to
src/nvim/CMakelists.txt. Using the IWYU target property instead of the
variable ensures that the information to use IWYU isn't lost.
2023-01-14 15:37:31 +01:00
686168c648 vim-patch:8.2.4398: some command completion functions are too long (#21799)
Problem:    Some command completion functions are too long.
Solution:   Refactor code into separate functions.  Add a few more tests.
            (Yegappan Lakshmanan, closes vim/vim#9785)

b31aec3b93

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 22:28:21 +08:00
2065ce877e vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11813)

e857598896

Partial port as this depends on some previous eval and 'smoothscroll'
patches.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 21:36:15 +08:00
d549734fb4 Merge pull request #21795 from zeertzjq/vim-8.2.4346
vim-patch:8.2.{4346,4382,4391},9.0.1195

N/A patches for version.c:

vim-patch:9.0.1197: dump file missing from patch

Problem:    Dump file missing from patch.
Solution:   Add missing dump file.

034c350207
2023-01-14 20:50:53 +08:00
d98e4e4b2e vim-patch:9.0.1195: restoring KeyTyped when building statusline not tested
Problem:    Restoring KeyTyped when building statusline not tested.
Solution:   Add a test.  Clean up and fix other tests. (closes vim/vim#11815)

378e6c03f9
2023-01-14 20:27:40 +08:00
f95ad61a89 vim-patch:8.2.4391: command line executed when typing Esc in the GUI
Problem:    Command line executed when typing Esc in the GUI.
Solution:   Move saving/restoring KeyTyped to build_stl_str_hl().
            (closes vim/vim#9783)

0e1f36fc59

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
81473c8ab2 vim-patch:8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Problem:    A custom 'tabline' may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9776)

e4835bf340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
ef77598bfb vim-patch:8.2.4346: a custom statusline may cause Esc to work like Enter
Problem:    A custom statusline may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9749)

481acb1141

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
bf08390442 Merge pull request #21793 from bfredl/noringbuf
fix(rbuffer): handle edge case where write_ptr has wrapped around too early
2023-01-14 13:06:22 +01:00
8ebdb97ea7 fix(rbuffer): handle edge case where write_ptr has wrapped around
when using the rbuffer as a linear buffer, exactly filling the buffer
will case write_ptr to wrap around too early. For now detect this
special case.

Of course, the rbuffer should refactored to a proper ring buffer where
write_pos >= read_pos always and there is no special case for full
buffers. This will be a follow up change.
2023-01-14 11:53:47 +01:00
d1183b48ad vim-patch:8.2.4341: command line not redrawn when finishing popup menu (#21792)
Problem:    Command line not redrawn when finishing popup menu and the screen
            has scrolled up.
Solution:   Redraw the command line after updating the screen. (closes vim/vim#9722)

414acd342f

Code change is N/A as Nvim doesn't call update_screen() here.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 18:36:59 +08:00
22e3b155f4 vim-patch:partial:8.2.4339: CTRL-A does not work properly with the cmdline popup menu (#21791)
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Only port cmdexpand.c and test_cmdline.vim changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 17:23:24 +08:00
e89c39d6f0 refactor: replace char_u with char 21 (#21779)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-14 15:58:28 +08:00
9220755302 build: remove clint error suppression #21782
Fix remaining clint errors and remove error suppression completely.

Rename the lint targets to align with the established naming convention:

- lintc-clint lints with clint.py.
- lintc-uncrustify lints with uncrustify.
- lintc runs both targets.

lintc is also provided as a make target for convenience.

After this change we can remove these files:
https://github.com/neovim/doc/tree/gh-pages/reports/clint
https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
2023-01-13 15:48:10 -08:00
b884d0b370 vim-patch:9.0.1189: invalid memory access with folding and using "L" (#21787)
Problem:    Invalid memory access with folding and using "L".
Solution:   Prevent the cursor from moving to line zero.

232bdaaca9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 07:02:45 +08:00
fd3d30a22c vim-patch:9.0.1191: some Bazel files are not recognized (#21784)
Problem:    Some Bazel files are not recognized.
Solution:   Add an extra Bazel pattern. (Keith Smily, closes vim/vim#11807)

3213952966

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2023-01-13 17:27:35 +01:00
4a12372ccf fix(statuscolumn): make %l/%r respect 'number'/'relativenumber' (#21747)
Resolve https://github.com/neovim/neovim/issues/21745.
2023-01-13 09:41:19 +00:00
449c0762d3 test: avoid consecutive mouse input at different positions (#21781)
The seconds call's position may override the first call if the first
call isn't processed yet, defeating the purpose of the first call.
2023-01-13 12:25:19 +08:00
1097d239c3 fix(ui): command line issues with external messages (#21709)
* fix: don't truncate external messages
* fix: avoid resizing command line with external messages
2023-01-13 11:47:55 +08:00
4876654d4c fix(mouse): statusline click registered as statuscolumn (#21748)
fix(statuscolumn): statusline click registered as statuscolumn

Problem:  Status line click is registered as status status column click.
Solution: Check that mouse is not on the status line.

Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
2023-01-13 07:36:59 +08:00
f2141de9e4 refactor: replace char_u with char 20 (#21714)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-13 07:35:39 +08:00
2f1fd15554 fix(powershell): wrong length allocation for ":%w !" #20530
Problem:
The calculation of `len` in `make_filter_cmd` for powershell falls short
by one character for the following ex command:
  :%w !sort
This command satisfies these conditions:
  - `itmp` is not null
  - `otmp` is null
__NOTE__ that other shells circumvent this bug only because of `len`
allocation for six extra characters: a pair of curly braces and four
spaces:
  cfdb4cbada/src/nvim/ex_cmds.c (L1551-L1554)
If allocation for these six characters are removed, then bash also faces
the same bug.

Solution:
Add allocation for 6 extra bytes. 1 would do, but let's keep powershell
in sync with other shells as much as possible.
2023-01-12 09:25:29 -08:00
572cd8031d feat(diagnostic): vim.diagnostic.is_disabled() #21527 2023-01-12 08:57:39 -08:00
a0b2c124a3 build: include our libraries before system libraries (#21746)
Including our libraries as system libraries is helpful to suppress any
warnings, but the default behavior is to include it after existing
libraries. This can become a problem with some package managers such as
macports, as CMake automatically adds /opt/local to the include path,
which is where they store all includes. This means that the wrong header
might be chosen if it has the same name as the one from our
dependencies.

Adding the BEFORE keyword when including will ensure that our
dependency headers are chosen first.

Also remove old Darwin workarounds that shouldn't be necessary anymore.

Closes: https://github.com/neovim/neovim/issues/21742
2023-01-12 16:49:17 +01:00
921e634119 fix(api): nvim_create_autocmd crash on invalid types inside pattern array
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-01-12 15:25:44 +00:00
0fd59f0121 fix(statuscolumn): foldcolumn buffer is too small (#21761)
Resolve https://github.com/neovim/neovim/issues/21759.
2023-01-12 23:04:43 +08:00
443bbfd59e docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
2023-01-12 15:51:19 +01:00
a5f4ba7447 vim-patch:9.0.1183: code is indented more than necessary (#21773)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11805)

0233bdfa2b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-12 21:33:38 +08:00
2aabe9b858 vim-patch:9.0.1182: go checksum files are not recognized (#21758)
Problem:    go checksum files are not recognized.
Solution:   Add the name of go checksum files. (Amaan Qureshi, closes vim/vim#11803)

043d7b2c84

Co-authored-by: Amaan Q <amaanq12@gmail.com>
2023-01-12 09:21:58 +01:00
143d3f1f32 fix(lsp): revert semantic token gravity change from #21574 (#21763) 2023-01-12 07:13:52 +01:00
a37c686d21 docs(lsp): update buf_notify and rpc.notify params types (#21753)
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.
2023-01-11 20:17:10 +01:00
8c5c2136fe vim-patch:9.0.1176: smithy files are not recognized (#21751)
Problem:    smithy files are not recognized.
Solution:   Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804)

f68cddabff

Co-authored-by: Chris Kipp <ckipp@pm.me>
2023-01-11 17:15:54 +01:00
3d49d39cd8 ci(tsan): run functionaltests instead of oldtests (#21744)
With TUI as an external process oldtests no longer involve threads, so
TSAN isn't useful. Meanwhile functionaltests may involve threads.
2023-01-11 14:36:26 +01:00
80a02d1cef Merge pull request #21706 from bfredl/notermios
refactor(pty): remove old logic for inheriting termios from host terminal
2023-01-11 13:19:01 +01:00
ddecf5e27f ci: remove ci/snap (#21743)
Context: https://github.com/neovim/neovim/pull/21166#issuecomment-1377623160
2023-01-11 10:31:03 +01:00
93d99aefd3 fix(statuscolumn): fix sign column highlights (#21727)
Resolve #21726.
2023-01-11 09:52:11 +08:00
b603d6f9e7 fix: properly close builtin popup in ext_popupmenu 2023-01-11 08:52:12 +09:00
08d5b4275e vim-patch:9.0.1172: when 'selection' is "exclusive" then "1v" is one char short (#21735)
Problem:    When 'selection' is "exclusive" then "1v" is one char short.
Solution:   Add one character when 'selection' is "exclusive. (closes vim/vim#11791)

79c11e399b

Cherry-pick update_curswant_force() refactor from patch 9.0.0482.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-11 06:39:20 +08:00
15ee93c0b4 vim-patch:9.0.1171: screen is not redrawn after using setcellwidths() (#21730)
Problem:    Screen is not redrawn after using setcellwidths().
Solution:   Redraw the screen when the cell widths have changed. (Yasuhiro
            Matsumoto, closes vim/vim#11800)

2bc849ff81
2023-01-11 05:42:33 +08:00
ea2658e1f7 vim-patch:9.0.1174: smali files are not recognized (#21734)
Problem: Smali files are not recognized.
Solution: Add a pattern for Smali files. (Amaan Qureshi, closes vim/vim#11801)
2023-01-10 22:29:25 +01:00
438b4361cc build: use modern cmake (#21589)
Replace old-school cmake with the so-called "Modern CMake", meaning
preferring using targets and properties over directory settings and
variables. This allows greater flexibility, robustness and clarity over
how the code works.

The following deprecated commands will be replaced with their modern
alternatives that operates on a specific target, rather than all targets
in the current directory:

- add_compile_options -> target_compile_options
- include_directories -> target_include_directories
- link_libraries -> target_link_libraries
- add_definitions -> target_compile_definitions

There are mainly four main targets that we currently use: nvim, libnvim,
nvim-test (used by unittests) and ${texe} (used by
check-single-includes). The goal is to explicitly define the
dependencies of each target fully, rather than having everything be
dependent on everything else.
2023-01-10 18:49:57 +01:00
9b1112cf48 fix(statuscolumn): fix crashes and clang/PVS warnings (#21725) 2023-01-10 21:18:12 +08:00
38140a63fb refactor(pty): remove old logic for inheriting termios from host terminal 2023-01-10 14:04:58 +01:00
870ca1de52 feat(float): open float relative to mouse #21531
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line < col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '<MouseMove>', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '<MouseMove>'
    end, { expr = true })
    ```
2023-01-10 02:22:41 -08:00
d6cb3328f7 vim-patch:1b5f03ec9c55 (#21715)
Update runtime files

1b5f03ec9c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-10 11:02:00 +01:00
87cfe50944 fix(ui): set stc to empty in floatwin with minimal style (#21720)
fix(ui): set stc to emtpy in floatwin with minimal style
2023-01-10 10:36:48 +01:00
1df2db0bc4 test(statuscolumn): add more tests for wrapped lines (#21718)
test(statuscolumn): add more tests more wrapped lines

Also initialize a "relnum" variable to suppress a Coverity warning.
The uninitialized value wasn't actually used by build_statuscol_str().
2023-01-10 11:30:45 +08:00
ef67503320 refactor: replace char_u with char 19 (#21241)
* refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-10 10:28:01 +08:00
f62da7381e docs: add 'statuscolumn' docstrings (#21717) 2023-01-10 09:00:21 +08:00
dc7edce650 vim-patch:partial:9.0.1166: code is indented more than necessary (#21716)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11792)

1cfb14aa97

Partial port as some highlight.c changes depend on previous patches.
Cherry-pick fname_match() change from patch 8.2.4959.
Omit internal_func_check_arg_types(): only used for Vim9 script.

N/A patches for version.c:

vim-patch:9.0.1167: EditorConfig files do not have their own filetype

Problem:    EditorConfig files do not have their own filetype.
Solution:   Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779)

d41262ed06

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-10 08:46:42 +08:00
364b131f42 feat(ui): add 'statuscolumn' option
Problem:    Unable to customize the column next to a window ('gutter').
Solution:   Add 'statuscolumn' option that follows the 'statusline' syntax,
	    allowing to customize the status column. Also supporting the %@
	    click execute function label. Adds new items @C and @s which
	    will print the fold and sign columns. Line numbers and signs
	    can be clicked, highlighted, aligned, transformed, margined etc.
2023-01-09 17:12:06 +00:00
50f03773f4 refactor: replace char_u with char 18 (#21237)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-09 22:37:34 +08:00
9cd7edc6ad Merge pull request #21704 from bfredl/nofree
fix(rpc): don't free args on error in rpc_send_event
2023-01-09 14:52:02 +01:00
1492094003 refactor: replace char_u with char 17 - remove STRLCPY (#21235)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-09 21:13:06 +08:00
bb7033a033 fix(rpc): don't free args on error in rpc_send_event
fixup #21631
fixes #21690
2023-01-09 13:59:35 +01:00
fc2cd28547 Merge pull request #21702 from glepnir/fix_2
fix(api): convert title_pos string in nvim_win_get_config
2023-01-09 12:33:08 +01:00
df60ac9767 Merge pull request #21675 from bfredl/nonstdio
fix(embed): handle stdio in server properly
2023-01-09 12:28:10 +01:00
1d16bba4d8 fix(embed): handle stdio in server properly
Rename stdin/stdout in the server, so that RPC data won't get corrupted.
This also restores the use of stderr to write directly to the terminal.
2023-01-09 11:17:11 +01:00
d64549bc4e Merge pull request #21488 from dundargoc/refactor/char_u/16.1
refactor/char u/16.1
2023-01-09 17:37:21 +08:00
7ba39b4378 test: add more tests for Unicode 2023-01-09 17:11:39 +08:00
08c2c74806 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2023-01-09 17:03:40 +08:00
53adccb6e0 test(tui_spec): doesn't use Unicode in cursor_address test (#21703)
Using Unicode makes the test flaky because of #16245.
2023-01-09 17:02:45 +08:00
3a8be82175 fix: use enum type 2023-01-09 17:00:32 +08:00
ad34ab38db fix: format 2023-01-09 14:22:10 +08:00
e351ab179b fix(ui): add test case 2023-01-09 14:17:32 +08:00
1f18c27404 fix(ui): convert title_pos string in nvim_win_get_config 2023-01-09 13:57:46 +08:00
c19bd47c0a test(tui_spec): improve cursor_address test (#21700) 2023-01-09 12:20:50 +08:00
a174f4e53f vim-patch:9.0.1158: code is indented more than necessary (#21697)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11787)

7f8b2559a3

Omit reset_last_used_map(): only used in Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-09 07:16:36 +08:00
904c13e6b5 dist: transpile cfilter.vim => cfilter.lua #21662
Vim has changed cfilter.vim from vimscript to vim9script.
Nvim supports only vimscript, not vim9script.
2023-01-08 12:31:38 -08:00
266a1c61b9 Merge pull request #21678 from dundargoc/build/remove-old-workarounds
build: remove old cmake workarounds that aren't necessary anymore
2023-01-08 11:01:24 +01:00
50687e60ae build: remove workaround for ancient clang versions
We don't need to support this as it's only required when using
AddressSanitizer, meaning it only affects developers.
2023-01-08 11:00:16 +01:00
623dad1a2c build: remove workaround for old luajit versions
Luajit version 2.1.0-beta3 was released 2017, there's no reason to use
such an old version on macOS. Also, the version check doesn't work
anymore as LUAJIT_VERSION seems to not be defined anywhere.
2023-01-08 10:58:51 +01:00
d1b3611f03 feat(lsp): show active clients in :checkhealth vim.lsp (#21670)
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`
2023-01-08 09:23:08 +01:00
0b136a14dc fix(lsp): partially revert semantic token gravity change from #21574 (#21680) 2023-01-08 07:43:15 +01:00
d89290b453 ci(news): checkout to HEAD commit instead of merge commit (#21679)
The default merge branch is unreliable when trying to determine number
of commits in a PR. Using the HEAD branch of the PR removes this
ambiguity.
2023-01-07 16:51:52 +01:00
f601c4b1ca fix(editorconfig): do not highlight unknown properties as errors (#21673)
Other plugins may define their own custom properties outside of Neovim's
builtin EditorConfig support. Instead of highlighting these unknown
properties as errors, do not highlight them at all.

This still differentiates between known and unknown properties, which
helps to catch typos or mistakes, but does not use the garish "error"
highlight that signals something is wrong.
2023-01-07 08:20:55 -07:00
3636338449 Merge pull request #21649 from gpanders/editorconfig-enable
feat(editorconfig): allow editorconfig to be toggled dynamically
2023-01-07 08:20:37 -07:00
6ffa434f0b refactor(editorconfig)!: change editorconfig_enable to editorconfig 2023-01-07 08:19:37 -07:00
34d1eaa792 feat(editorconfig): allow editorconfig to be toggled dynamically
Rather than only check `editorconfig_enable` when the plugin is loaded,
check it each time the autocommand fires, so that users may enable or
disable it dynamically.

Also check for a buffer local version of the variable, so that
editorconfig can be enabled or disabled per-buffer.
2023-01-07 08:19:12 -07:00
42afa0369a Merge #21663 lua: "nvim -l" scriptname in _G.arg[0] 2023-01-06 22:07:34 -05:00
e17430c1cd feat(lua): store "nvim -l" scriptname in _G.arg[0] 2023-01-07 03:03:38 +01:00
7fc5d6ea50 refactor: eliminate bump-deps.sh using "nvim -l" 2023-01-07 02:47:18 +01:00
b741788a3a lint: bump_deps.lua 2023-01-07 02:41:17 +01:00
1c6be5e5e6 fix(coverity/433537): don't call kv_concat_len() when read_size is 0 (#21664)
fix(coverity): don't call kv_concat_len() when read_size is 0
2023-01-07 07:50:48 +08:00
f7ad46e69e fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() (#21665)
Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
2023-01-06 15:26:31 +01:00
0996430392 Merge pull request #21666 from bfredl/padbell
fix(tui): do not invoke loop recursively for pad()
2023-01-06 13:35:01 +01:00
b303ab9a7d fix(tui): do not invoke loop recursively for pad()
fixes #21610
2023-01-06 11:01:02 +01:00
08ebf8d3a8 Merge #18706 execute Lua with "nvim -l" 2023-01-05 13:06:21 -05:00
628b717022 refactor: extract code to open stdin for reading 2023-01-05 17:44:12 +01:00
7089f33144 refactor(lua): move _G.arg init to nlua_init() 2023-01-05 17:10:02 +01:00
e8ab218716 feat(message): avoid spam on failed os_msg
also de-dupe the code
2023-01-05 17:10:02 +01:00
f43de742e8 feat(lua): execute stdin ("-") as Lua 2023-01-05 17:10:02 +01:00
adef308a59 feat(lua): exit 1 on Lua "-l" script error 2023-01-05 17:10:02 +01:00
45549f031e feat(lua): send "--" literally to Lua "-l" script
Problem:
When "-l" is followed by "--", we stop sending args to the Lua script
and treat "--" in the usual way. This was for flexibility but didn't
have a strong use-case, and has these problems:
- prevents Lua "-l" scripts from handling "--" in their own way.
- complicates the startup logic (must call nlua_init before command_line_scan)

Solution:
Don't treat "--" specially if it follows "-l".
2023-01-05 17:10:02 +01:00
599e1d019a ci: use nvim -l in api-docs job 2023-01-05 17:10:02 +01:00
7c94bcd2d7 feat(lua)!: execute Lua with "nvim -l"
Problem:
Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua
scripts, especially scripts that take arguments or produce output.

Solution:
- support "nvim -l [args...]" for running scripts. closes #15749
- exit without +q
- remove lua2dox_filter
- remove Doxyfile. This wasn't used anyway, because the doxygen config
  is inlined in gen_vimdoc.py (`Doxyfile` variable).
- use "nvim -l" in docs-gen CI job

Examples:

    $ nvim -l scripts/lua2dox.lua --help
    Lua2DoX (0.2 20130128)
    ...

    $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2
    $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l -

TODO?
  -e executes Lua code
  -l loads a module
  -i enters REPL _after running the other arguments_.
2023-01-05 17:10:02 +01:00
39d70fcafd dist: generated version of ccomplete.vim (#21623)
This is the first PR featuring a conversion of an upstream vim9script file
into a Lua file.

The generated file can be found in `runtime/autoload/ccomplete.vim` in
the vim repository. Below is a limited history of the changes of that file
at the time of conversion.

```
❯ git log --format=oneline runtime/autoload/ccomplete.vim
c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files
a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files
4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files
d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files
20aac6c1126988339611576d425965a25a777658 Update runtime files.
30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files.
b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files.
00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files.
8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a
...
```

The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated
(for any bug fixes or new features, like implementing class and interface, the latest in vim9script).

Further PRs will improve the DX of generated the converted lua and
tracking which files in the neovim's code base have been generated.
2023-01-05 11:00:32 -05:00
19591e9918 fix(ui): fix fragile UI_CALL macro invocation (#21656)
Fixup #21605

Depending on the phase of the moon, UI_CALL expanding UI_LOG expanding the default value of entered_free_all_mem might or might not work.
2023-01-05 13:31:47 +01:00
c889f75436 project: rearrange ISSUE_TEMPLATE/bug_report.yml
Problem:
The "system info" fields in the bug report take up a lot of space at the
top. That hides the most relevant part of the bug report. To read the
actual bug, you always have to scroll down.

Solution:
Move the "system info" fields to the bottom.
2023-01-05 10:48:48 +01:00
85eb564bac Merge pull request #21605 from bfredl/uidvp
The UI Devirtualization Project
2023-01-05 10:41:14 +01:00
47ba78f89a refactor(ui): devirtualize the ui layer
- The defined interface for the UI is only the RPC protocol. The original
  UI interface as an array of function pointers fill no function.
- On the server, all the UI:s are all RPC channels.
  - ui.c is only used on the server.
  - The compositor is a preprocessing step for single-grid UI:s
- on the client, ui_client and tui talk directly to each other
  - we still do module separation, as ui_client.c could form the basis
    of a libnvim client module later.

Items for later PR:s
- vim.ui_attach is still an unhappy child, reconsider based on plugin experience.
- the flags in ui_events.in.h are still a mess. Can be simplified now.
- UX for remote attachment needs more work.
- startup for client can be simplified further (think of the millisecs we can save)
2023-01-05 09:48:26 +01:00
ae64772a88 fix(diff): avoid restoring invalid 'foldcolumn' value (#21650)
Use "0" for 'foldcolumn' when w_p_fdc_save is empty, like how
"manual" is used for 'foldmethod' when w_p_fdm_save is empty.
2023-01-05 07:12:02 +08:00
89232b8b48 fix(tui): make a copy of data->params before unibi_format() (#21643)
Problem:    When unibi_format() modifies params and data->buf overflows,
            unibi_format() is called again, causing the params to be
            modified twice. This can happen for escapes sequences that
            use the %i terminfo format specifier (e.g. cursor_address),
            which makes unibi_format() increase the param by 1.
Solution:   Make a copy of data->params before calling unibi_format().
2023-01-05 00:25:25 +08:00
1bd6e4469b docs(website): soft wrap code blocks #21644
Use `white-space: pre-wrap` to preserve white space as per `pre`, but to
allow line wrapping if the display runs out of horizontal space.

This prevents lines overflowing their box, and causing horizontal
scrolling across the entire page on small screens.

This `pre-wrap` technique is used by GitHub to format code for mobile.

See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#pre-wrap
2023-01-04 07:15:08 -08:00
e35b9020b1 docs(lua): adjust some type annotations 2023-01-04 11:48:41 +00:00
ef18c9f9b0 test(tui_spec): avoid race between nvim_paste and nvim_input (#21639)
Now that the TUI calls nvim_paste and nvim_input through RPC, the data
race is much more likely, as nvim_paste is deferred while nvim_input is
not. Add an expect_child_buf_lines() call to avoid the race.
2023-01-04 08:39:20 +08:00
63e0e77bd9 project: update feature request template
- Ask for problem/solution format.
- Drop "Vim version" field, it is usually empty and takes up too much space.
2023-01-03 16:30:56 -08:00
936e191fef docs: fix typos (#21427)
Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Tomas Nemec <nemi@skaut.cz>
2023-01-04 07:38:48 +08:00
5529b07316 fix(clipboard): show provider warning when not during batch changes #21451
It is strange that Ex commands that explicitly interact with the
clipboard show provider warning, but Normal mode commands do not.
2023-01-03 15:17:54 -08:00
d56c603caf Merge pull request #21633 from gpanders/editorconfig
Builtin EditorConfig support
2023-01-03 11:38:20 -07:00
c951236d63 docs(editorconfig): add editorconfig.txt 2023-01-03 11:36:38 -07:00
e88cdc9a0f test(editorconfig): add editorconfig tests 2023-01-03 11:36:37 -07:00
eb702273c4 Merge pull request #21631 from bfredl/request_memory
refactor(api): do not allocate temporaries for internal events
2023-01-03 18:57:55 +01:00
6663c5fabd docs(editorconfig): update news.txt 2023-01-03 10:28:55 -07:00
d6510eec4f feat(editorconfig): add editorconfig syntax file
This is intentionally _not_ copied from Vim because our syntax file
makes use of Lua to dynamically generate a list of valid EditorConfig
properties. This requires the builtin editorconfig module, which Vim
does not have.
2023-01-03 10:28:55 -07:00
ab9a2c4925 feat(editorconfig): add builtin EditorConfig support 2023-01-03 10:28:55 -07:00
1b3c255f60 fix(fs): duplicate path separator #21509
Fixes #21497
2023-01-03 09:24:14 -08:00
b2295ac4ec refactor(api): do not allocate temporaries for internal events 2023-01-03 17:31:54 +01:00
5e9508c702 Merge #21580 cmdline issues with cmdheight=0 2023-01-03 11:02:32 -05:00
5eed3e741b fix(diagnostic): revert notification on missing diagnostics (#21632)
This reverts a change introduced in
4ace9e7e41.
2023-01-03 08:20:20 -07:00
5b22b32e50 fix(lsp): change vim.lsp.get_active_clients.filter name annotation to string (#21624) 2023-01-03 13:44:44 +01:00
a3c92f6b6c vim-patch:9.0.1137: some conditions are always false (#21628)
Problem:    Some conditions are always false.
Solution:   Remove the useless conditions. (closes vim/vim#11776)

ea720aea85
2023-01-03 19:22:32 +08:00
5841a97500 feat!: remove hardcopy
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 10:07:43 +00:00
7b76a3e799 refactor(diagnostic): DRY for loop #21521
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 02:07:27 -08:00
c3d8665851 fix(exit): the TUI should not ui_flush() itself (#21625) 2023-01-03 17:21:42 +08:00
4dd793a256 vim-patch:9.0.1132: code is indented more than needed (#21626)
Problem:    Code is indented more than needed.
Solution:   Use an early return to reduce indentation. (Yegappan Lakshmanan,
            closes vim/vim#11769)

dc4daa3a39

Omit expand_autoload_callback(): only applies to Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-03 14:55:00 +08:00
3a519d86bf docs: readme cleanup
- try to make the CI badge more reliable
- remove "snap" badge, it's too specific and doesn't show stats
- remove twitter link because it's already linked from
  https://github.com/neovim and https://neovim.io/ , and it's not super
  necessary in the readme.
2023-01-02 15:18:18 -08:00
a283a99165 refactor: eliminate os_unix.c #21621 2023-01-02 14:56:17 -08:00
5c6f2122ad vim-patch:9.0.1129: sporadic Test_range() failure (#21619)
Problem:    Sporadic Test_range() failure.
Solution:   Clear typeahead.  Move to a separate function. (issue vim/vim#22771)

7bdcba08bb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-02 21:03:40 +08:00
5322bf99e6 vim-patch:8.2.0711: temp directory might be cleared (#21614)
Problem:    With a long running Vim the temp directory might be cleared on
            some systems.
Solution:   Lock the temp directory. (closes vim/vim#6044)

b2d0e51366
2023-01-02 20:37:13 +08:00
c590641feb fix(tui): do not set ui_client_termname if it is already set (#21607)
It is fine to initialize ui_client_termname to NULL as it is only used
after tui_start().
2023-01-01 23:18:19 +08:00
f60cff8f9a Merge pull request #21570 from clason/vimdoc-parsing
docs: fix treesitter parsing errors
2023-01-01 15:24:06 +01:00
2f0c023f52 docs(manual): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
ad184b213d docs(luvref): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
dfb840970c docs(lua): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
9cc37e057a docs(api): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
18c22a6fb4 docs: fix treesitter parsing errors 2023-01-01 15:05:13 +01:00
c4942880be vim-patch:partial:f1dcd14fc5d4 (#21602)
Update runtime files

f1dcd14fc5

missing autocmd blocks and getscriptinfo()

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-01 15:00:39 +01:00
83e8723864 Merge pull request #21597 from gi1242/tex-ft-detection
fix(filetype): make .tex filetype detection match Vim
2023-01-01 21:45:12 +08:00
85b7c8b004 fix(filetype): correctly detect tex files
Fixes Issue #21594.
2022-12-31 20:54:01 -05:00
1b3e6e7594 vim-patch:9.0.1120: tex filetype detection not sufficiently tested
Problem:    Tex filetype detection not sufficiently tested.
Solution:   Add more test cases for "tex" detection. (Jonas Strittmatter,
            closes vim/vim#11765)

c55e8f2c6f

Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
2022-12-31 16:12:09 -05:00
6ba34e21fe feat(lsp): add function to clear codelens (#21504)
Currently once you retrieve the lenses you're pretty much stuck with
them as saving new lenses is additive.

Adding a dedicated method to reset lenses allows users to toggle lenses
on/off which can be useful for language servers where they are noisy or
expensive and you only want to see them temporary.
2022-12-31 16:16:21 +01:00
cce736218f Merge pull request #18375 from bfredl/tui_rework
feat(ui): refactor TUI from thread to separate process
2022-12-31 14:23:24 +01:00
9fdcbbb406 feat(tui): graduate the +tui feature
This was previously disabled due to build issues on windows.
Any reasonable platform can now be expected to have the necessary
interfaces to build and run the TUI subsystem.

Runtime quality issues of using the TUI (on any new platform) are not
relevant here. Just run Nvim in an external UI instead of the TUI as always.
2022-12-31 13:25:26 +01:00
43e8ec92de fix(tui): more work in the TUI 2022-12-31 13:25:26 +01:00
2448816956 feat(tui): run TUI as external process 2022-12-31 10:43:28 +01:00
69163727e9 test: add test cases for command line issues 2022-12-31 01:49:36 +01:00
935e538b63 fix: issues with command line if ui elements are externalized
Resolve https://github.com/neovim/neovim/issues/20888 and handle side
effects for setting 'cmdheight' to zero.
2022-12-31 00:50:39 +01:00
b102bf22c0 fix(ui): allow resize commands to set 'cmdheight' to 0
Resolve https://github.com/neovim/neovim/issues/21558
2022-12-31 00:30:53 +01:00
99cf111289 vim-patch:9.0.1115: code is indented more than needed (#21598)
Problem:    Code is indented more than needed.
Solution:   Use an early return to reduce indenting. (Yegappan Lakshmanan,
            closes vim/vim#11758)

ed0c1d5d4b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-31 06:41:23 +08:00
6a45360de9 Merge pull request #21596 from bfredl/nasleep
refactor(sleep): simplify rube goldberg implementation of :sleep
2022-12-30 20:39:42 +01:00
09370eae77 refactor(sleep): simplify rube goldberg implementation of :sleep
As neovim does have event handling, we are checking for CTRL-C
all the time, not once per second.

Also, do_sleep() reimplements the same loop as
LOOP_PROCESS_EVENTS_UNTIL() already contains internally. Fix the latter
to use the right integer type, so we do not need the extra indirection.
2022-12-30 19:56:11 +01:00
4ace9e7e41 feat(diagnostic): don't open quickfix/loclist if no diagnostics #21397 2022-12-30 10:23:54 -08:00
849f544d62 build: add git sha to version when built with nix flake (#21210) 2022-12-30 18:24:40 +01:00
b49599ce7e docs: clarify line about converse of lua-heredoc (#21592)
Co-authored-by: sean.twie03 <nothankyou@gmail.com>
2022-12-30 17:55:38 +01:00
f62c30ad0d fix(lsp): fix nil client access in get_active_clients (#21524)
Fixes https://github.com/neovim/neovim/issues/21523
2022-12-30 16:42:18 +01:00
469f985923 fix(lsp): adjust gravity of semantic tokens extmarks (#21574)
Fixes #21543

This should provide a better user experience when appending or prepending text to a word that has a semantic token extmark. More often than not, the appended/prepended text to the word will end up becoming part of the token anyway, so just use that extmark as the user types.
2022-12-30 16:40:23 +01:00
cb9d68fe6d Merge pull request #21591 from zeertzjq/vim-8.2.3773
vim-patch:8.2.{3773,3774}
2022-12-30 15:59:11 +08:00
d7855caa18 test: add test for setting &columns from modeline with tabpages 2022-12-30 15:16:28 +08:00
83472b3808 vim-patch:8.2.{3773,3774}
vim-patch:8.2.3773: wrong window size when a modeline changes 'columns'

Problem:    Wrong window size when a modeline changes 'columns' and there is
            more than one tabpage. (Michael Soyka)
Solution:   Adjust the frames of all tabpages. (closes vim/vim#9315)

8a7374f8c4

vim-patch:8.2.3774: test for command line height fails

Problem:    Test for command line height fails.
Solution:   Use another way to handle window size change.

b711814cb6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-30 14:45:28 +08:00
4703e561d5 chore: forward-port changes from v0.8.2 release 2022-12-29 17:36:28 +01:00
19a7636641 build: fix help tags generation when SHELL=fish (#21562)
Fish doesn't support glob pattern, so we use `remove_directory` instead.
2022-12-29 13:05:26 +01:00
b640161a69 test(tui_spec): don't use nested terminal for resize at startup (#21583) 2022-12-29 14:13:54 +08:00
587fbdd7a0 docs: fix order of numbers in syntax.txt (#21581) 2022-12-29 12:41:26 +08:00
05b6dd6e5f test(lsp): add a screen:expect() between insert() and feed_command() (#21577)
The insert() and feed_command() type a lot of text, with only one
screen:expect() call after the feed_command() it may time out.
2022-12-29 07:55:26 +08:00
d0dd8d11bf test: remove unused variable (#21552) 2022-12-29 07:20:42 +08:00
7067cde657 build(lintsh): double quote to prevent word splitting (#21571) 2022-12-28 22:50:24 +01:00
86a75c79e1 build(nix): remove pylint as it has been removed (#21572) 2022-12-28 17:20:23 +01:00
e6cae44cbf feat(highlight): add DiagnosticOk (and associated) highlight groups (#21286)
The existing groups, Error, Hint, Info, Warn cover many use cases, but
neglect the occasion where a diagnostic message should communicate a
non-informative (not a Hint or Info) event. DiagnosticOk covers this
with a generic green colorscheme.
2022-12-28 09:01:40 -07:00
ab11157808 ci: add platform:nix label when changing nix files (#21569)
Also update the reviewer list.
2022-12-28 15:19:23 +01:00
3d0eca6b65 build(nix): clean up nix flake (#21565) 2022-12-28 14:26:59 +01:00
2732759bff ci(release): properly set multiline output variable (#21560) 2022-12-28 19:48:19 +08:00
3b9b43063c vim-patch:9.0.1106: not all postfix files are recognized (#21568)
Problem:    Not all postfix files are recognized.
Solution:   Recognize main.cf.proto files. (closes vim/vim#11732)

09ce0b8e11

Co-authored-by: KodeToad <3880336+KodeToad@users.noreply.github.com>
2022-12-28 11:42:02 +01:00
a731a40f78 docs(README): add Kotlin as a language which can use the API (#21567)
Add Kotlin as a language which can use the API
2022-12-28 16:12:12 +08:00
bf459641a8 refactor(f_has): remove wrong comment (#21561)
Only one of "fork" and "system" should be defined.
Also change the line above "win32" to match Vim.
2022-12-28 10:05:03 +08:00
d215dae0e0 docs(lua): add vim.json (#21538) 2022-12-27 13:22:33 +01:00
4aec442b5a Merge pull request #21555 from zeertzjq/vim-9.0.1096
vim-patch:9.0.{1096,1097,1099,1100}: reallocating hashtab when the size didn't change
2022-12-27 19:29:43 +08:00
45d9735aae vim-patch:9.0.1100: a hashtab with many removed items is not cleaned up
Problem:    A hashtab with many removed items is not cleaned up.
Solution:   Re-hash a hashtab even when the size didn't change if too many
            items were removed.

d0883faac6

N/A patches for version.c:

vim-patch:9.0.1099: trying to resize a hashtab may cause a problem

Problem:    Trying to resize a hashtab may cause a problem.
Solution:   Do not try to resize a hashtab before adding an item.

81b7ecc5cb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-27 19:01:09 +08:00
9bab4b72ae vim-patch:9.0.1097: tests are failing
Problem:    Tests are failing.
Solution:   Do clean up a hashtab when at the initial size.

b3d614369f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-27 18:56:20 +08:00
59012a18e1 vim-patch:9.0.1096: reallocating hashtab when the size didn't change
Problem:    Reallocating hashtab when the size didn't change.
Solution:   Bail out when the hashtab is already the desired size.

71d53e7c57

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-27 18:54:47 +08:00
146c428a53 fix(statusline): make nvim_eval_statusline() work with %S (#21553) 2022-12-27 18:04:42 +08:00
cd6ec1db06 fix(win_close): remove float grid after closing buffer (#21551)
It is not safe to remove the float grid when autocommands can still be
triggered, as autocommands may use the float grid.
2022-12-27 17:29:05 +08:00
d4af8c6202 fix(statusline): don't show showcmd when not enough space (#21550) 2022-12-27 11:13:58 +08:00
dae2135849 vim-patch:9.0.1101: unused global variable (#21549)
Problem:    Unused global variable.
Solution:   Remove the variable. (closes vim/vim#11752)

b536540ab3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-27 06:19:39 +08:00
fe5665be3b vim-patch:9.0.1103: jq files are not recognized (#21545)
Problem:    jq files are not recognized.
Solution:   Add detection of Jq files. (David McDonald, closes vim/vim#11743)

b9a1edfc54

Co-authored-by: David McDonald <dgmcdona@uno.edu>
2022-12-26 18:36:51 +01:00
738427d498 vim-patch:9.0.1098: code uses too much indent (#21540)
Problem:    Code uses too much indent.
Solution:   Use an early return. (Yegappan Lakshmanan, closes vim/vim#11747)

465de3a57b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-26 21:54:31 +08:00
94ce25065b fix(showcmd): assert failure with cmdheight=0 (#21536) 2022-12-26 14:04:46 +08:00
522b15e2a4 Merge pull request #21202 from luukvbaal/statusline
feat: add 'showcmdloc' option and statusline item
2022-12-26 13:40:33 +08:00
5b89d480e3 vim-patch:9.0.1061: cannot display 'showcmd' somewhere else
Problem:    Cannot display 'showcmd' somewhere else.
Solution:   Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684)

ba936f6f4e

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2022-12-26 13:15:07 +08:00
357aab4c65 fix(mappings): use all buckets in second round of unmap (#21534) 2022-12-26 11:20:37 +08:00
6f25623e79 vim-patch:8.2.3737: test fails without the 'autochdir' option (#21529)
Problem:    Test fails without the 'autochdir' option.
Solution:   Check that the option is available. (Dominique Pellé, closes vim/vim#9272)

8dea145e39

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-12-25 13:07:30 +08:00
9be24110f6 vim-patch:8.2.4139: using freed memory in expression abbreviation (#21522)
Problem:    Using freed memory if an expression abbreviation deletes the
            abbreviation.
Solution:   Do not access the pointer after evaluating the expression.

94075b2b0e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-24 16:32:50 +08:00
4d4e697ef0 vim-patch:8.2.3513: using freed memory when using a timer and searching (#21519)
Problem:    Using freed memory when using a timer and searching. (Dominique
            Pellé)
Solution:   Allocated mr_pattern.

a2cff1dbc9

Restore xfree(strcopy) removed in ported patch 8.1.1270.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-24 09:07:03 +08:00
3b9bd7bd43 vim-patch:9.0.1092: search error message doesn't show used pattern (#21518)
Problem:    Search error message doesn't show used pattern.
Solution:   Pass the actually used pattern to where the error message is
            given. (Rob Pilling, closes vim/vim#11742)

e86190e7c1

Co-authored-by: Rob Pilling <robpilling@gmail.com>
2022-12-24 07:55:03 +08:00
3ea1524cf8 vim-patch:9.0.1090: FHIR Shorthand files are not recognized (#21515)
Problem:    FHIR Shorthand files are not recognized.
Solution:   Add a pattern to detect FSH files. (Matthew Gramigna,
            closes vim/vim#11738)

c9207d5d79

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-12-23 17:36:41 +01:00
2d7599248b vim-patch:9.0.1089: unnecessary assignment (#21493)
Problem:    unnecessary assignment
Solution:   Remove the assignment. (Luuk van Baal, closes vim/vim#11736)

c53e7904b9
2022-12-23 21:13:58 +08:00
788eb65494 ci: remove needs:response label if author responds (#21489)
ci: remove "needs:response" label if author responds

The default behavior of the stale action is to indiscriminately remove
the `needs:response` label for any activity whatsoever, from anyone. The
other option is to turn it off completely, meaning the maintainers needs
to manually remove the label themselves when the author responds for an
issue to not close automatically. Neither of these behaviors are useful
to us.
2022-12-23 12:54:30 +01:00
30f606fc60 fix(options): restore exists() behavior for options (#21510)
Duplicating get_option_value() logic for an obscure future refactor
isn't really worthwhile, and findoption() isn't used anywhere else
outside the options code.
2022-12-23 13:56:32 +08:00
98daaa798e test(lua/fs_spec): fix vim.fs.dir() test (#21503) 2022-12-22 22:46:07 +08:00
6e0082b356 fix(ci): skip test on windows (#21502) 2022-12-22 22:19:35 +08:00
b2d984558b test(unit): use file:close() properly (#21505) 2022-12-22 22:17:01 +08:00
843ad837c6 docs: add security policy (#17338) 2022-12-22 13:20:19 +01:00
fa6ab48926 ci: bump api-docs runner to ubuntu-latest (#21501)
This was set explicitly to ubuntu.22.04 as ubuntu-latest pointed to
ubuntu.20.04, and we needed 22.04 to have a new enough doxygen version
for this job to work. Now that ubuntu-latest points to 22.04 this
workaround is no longer needed.
2022-12-22 13:18:17 +01:00
39ea662824 build(deps): bump LuaJIT to HEAD - a04480e31 (#21500) 2022-12-22 11:34:26 +01:00
ceb533181c Merge pull request #21402 from lewis6991/feat/fs_ls 2022-12-22 10:23:19 +00:00
ff45a142b6 Merge pull request #21494 from dundargoc/ci/asan_symbolize
ci: don't use asan_symbolize for the ASAN job
2022-12-22 10:45:32 +01:00
f9c62ce342 vim-patch:8.2.5142: startup test fails if there is a status bar (#21496)
Problem:    Startup test fails if there is a status bar at the top of the
            screen. (Ernie Rael)
Solution:   Use a larger vertical offset in the test.

fa04eae5a5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-22 11:14:04 +08:00
b1ca49a002 ci: don't use asan_symbolize for the ASAN job
asan_symbolize-14 gives a deprecation as it relies on outdated python
features. We can safely stop using asan_symbolize as it's only needed
for special cases such as cross compilation which we don't have to worry
about.
2022-12-21 23:53:45 +01:00
5d5fa886ff ci: bump stale action version (#21490) 2022-12-21 16:54:46 +01:00
f384896837 fix(decoration): do not reset must_redraw after calling providers (#21459)
Resetting must_redraw caused a strange bug #21278, so don't do it.
Remove the goto as well, as it doesn't make much sense after #20665.
2022-12-21 23:40:21 +08:00
ec1738a6ed refactor: replace char_u with char 16 - remove STRNCMP (#21208)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2022-12-21 19:00:05 +08:00
c24605a5a0 refactor(win_line): rename attr to vi_attr (#21487)
Vim renamed it in patch 8.1.1391.
2022-12-21 15:58:59 +08:00
a6747545be Merge pull request #21441 from bfredl/neoterminfo
refactor(tui): use nvim_echo() for verbose terminfo
2022-12-20 22:20:17 +01:00
b42d8a43b9 refactor(tui): use nvim_echo() for verbose terminfo
This is needed for #18375 for the obvious reasons.
note: verbose_terminfo_event is only temporarily needed
until the full TUI process refactor is merged.
2022-12-20 21:43:42 +01:00
45d1b1c678 vim-patch:9.0.1082: some jsonc files are not recognized (#21483)
Problem:    Some jsonc files are not recognized.
Solution:   Add patterns for jsonc and move some from json to jsonc.
            (closes vim/vim#11711)

104b2ff4d0

Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2022-12-20 18:04:47 +01:00
fb5576c2d3 feat(fs): add opts argument to vim.fs.dir()
Added option depth to allow recursively searching a directory tree.
2022-12-20 16:39:34 +00:00
f04087d8ba vim-patch:8.2.2912: MS-Windows: most users expect using Unicode (#21482)
Problem:    MS-Windows: most users expect using Unicode.
Solution:   Default 'encoding' to utf-8 on MS-Windows. (Ken Takata,
            closes vim/vim#3907)

f883d9027c

Correct the encoding of the file.

Co-authored-by: K.Takata <kentkt@csc.jp>
2022-12-20 17:15:37 +08:00
de90a8bfe5 test(old): make test_signs.vim closer to upstream (#21479) 2022-12-20 11:03:38 +08:00
03166838ab test(exrc): add tests for .nvimrc and .nvim.lua (#21478) 2022-12-20 08:38:24 +08:00
b3c9563e6b Merge pull request #21477 from zeertzjq/vim-9.0.1078
vim-patch:9.0.{1078,1079}
2022-12-20 07:48:52 +08:00
ff62d76193 vim-patch:9.0.1079: leaking memory when defining a user command fails
Problem:    Leaking memory when defining a user command fails.
Solution:   Free "compl_arg" when needed. (closes vim/vim#11726)

33e543038b
2022-12-20 05:26:52 +08:00
b201cbfc61 vim-patch:9.0.1078: with the +vartabs feature indent folding may use wrong 'ts'
Problem:    With the +vartabs feature indent folding may use wrong 'tabstop'.
Solution:   Use the "buf" argument instead of "curbuf".

07146ad1d3
2022-12-20 05:26:49 +08:00
23d8f5b870 feat(exrc): support .nvim.lua (#21436) 2022-12-19 09:33:47 -07:00
f4d8e992bf fix(lsp): token_edit.data might be null on deletion (#21462) 2022-12-19 09:24:27 +01:00
a7332ba9b4 fix(tui): set cursor color param as string when required #21407
Problem:
See #20628. Terminals supporting cursor color changing usually set the
"user-defined" `Cs` terminfo capability. Most terminals expect the parameter to
the capability to be a string (in hex format like `#0099ff` or like
`rgb:00/99/ff`), others may expect a number.

Nvim currently can't handle string parameters, causing terminals to receive
a bogus command.

Unfortunately, as the `Cs` capability is "user-defined", there's no strict
format. The parameter it takes isn't really standardized. It seems most
terminals in use follow xterm; iTerm appears to be an exception.

Solution:
Use the `Cs` capability more reliable by following terminfo and
sending the color in hex format, at the cost of using unibilium string vars.
Alternatively, could revert 34d41baf8a
and hardcode the specific format required by terminals, instead of reading
terminfo.

Fixes #20628
Fixes #19607
2022-12-18 15:10:47 -08:00
bf9ad5db96 fix(diagnostic): sort diagnostics by column (#21457)
Sort diagnostics by column number in quickfix list
2022-12-18 08:17:15 -07:00
6b3ae24a70 vim-patch:9.0.1072: screenpos() column result in fold may be too small (#21465)
Problem:    screenpos() column result in fold may be too small.
Solution:   Add space of 'number', sign column, etc. (closes vim/vim#11715)

ba2d191932
2022-12-18 21:26:17 +08:00
1743359235 fix(diagnostic): clear stale cache on reset (#21454)
The BufWipeout autocmd is not 100% reliable and may leave stale entries
in the cache. This is sort of a hack/workaround to ensure
`vim.diagnostic.reset` calls don't fail if there are stale cache entries
but instead clears them

Fixes errors like

    Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: Invalid buffer id: 22
    stack traceback:
            [C]: in function 'nvim_exec_autocmds'
            /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: in function 'reset'
2022-12-17 19:19:15 -07:00
1c4794944d Merge pull request #21393 from folke/highlight_show
feat(lsp): add function to get semantic tokens at cursor
feat: `vim.inspect_pos()`, `vim.show_pos()` and `:Inspect[!]`
2022-12-17 13:43:46 +01:00
d65684f0c7 ci: bump stylua action to v2 (#21455) 2022-12-17 13:32:20 +01:00
ef91146efc feat: vim.inspect_pos, vim.show_pos, :Inspect 2022-12-17 13:05:31 +01:00
2d8bbe468e Merge pull request #21450 from zeertzjq/vim-8.2.1210
vim-patch:8.2.{1208,1209,1210}: using ht_used when looping through a hashtab is less reliable
2022-12-17 09:28:44 +08:00
b969844398 vim-patch:8.2.1210: using ht_used when looping through a hashtab is less reliable
Problem:    Using ht_used when looping through a hashtab is less reliable.
Solution:   Use ht_changed in a few more places.

1f22cc5cdb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
73a6000120 vim-patch:8.2.1209: Vim9: test failure
Problem:    Vim9: test failure.
Solution:   Add missing changes to hashtab.

21c16f868d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
d302c0e35e vim-patch:8.2.1208: build failure
Problem:    Build failure.
Solution:   Add missing change.

49fe0d6b28

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-17 08:58:50 +08:00
4d860a5370 fix(folds): use long for number of folded lines (#21447)
Also remove some duplicate unsigned long casts.
2022-12-17 08:11:35 +08:00
37915cc5ab Merge #21444 rename mch_msg => os_msg 2022-12-16 12:27:49 -05:00
a5207304dd refactor: rename mch_get_acl => os_get_acl 2022-12-16 17:40:06 +01:00
614d382621 refactor: rename mch_msg => os_msg 2022-12-16 17:33:52 +01:00
b55ccb4324 Merge pull request #21440 from bfredl/scriptparm
refactor(params): open -s and -w script files after parsing commands
2022-12-16 12:53:41 +01:00
4ca3519a7a refactor(option.c): reduce scope of locals (#21433)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-12-16 11:24:44 +00:00
b6dda012ea refactor(params): open -s and -w script files after parsing commands
This will be needed for #18375 as only the server should open the.
scriptfile, and redirected stdin fd will need to be used.

Also executing actions in the middle of command_line_scan() is cringe.
2022-12-16 11:43:41 +01:00
72a19b2ffe fix(api): "emsg_silent" should imply "silent" in nvim_cmd (#21438) 2022-12-16 08:54:13 +08:00
a2bf0cef10 vim-patch:9.0.1062: some test function names do not match what they are doing (#21429)
Problem:    Some test function names do not match what they are doing.
Solution:   Leave out user data for the test that is called "NoUserData".
            (closes vim/vim#11703)

4cd45f1408

Nvim's tests already match function names. Add missing indent changes
and a missing comment from patch 8.2.0084.
2022-12-16 06:08:59 +08:00
ef95174694 ci: add team reviewers (#21434)
Using team reviewers when possible reduces the churn on the git history
as we'll be able to add or remove reviewers without needing to change
the workflow files.

This requires using Github fine-grained personal access tokens with Pull
Requests set to "Read and write" and Members to "Read-only".
2022-12-15 20:40:30 +01:00
3091fa778a Merge pull request #21426 from williamboman/fix/tbl_get-nil-return-val
fix(lua): always return nil values in vim.tbl_get when no results
2022-12-15 08:03:31 +00:00
26c918d03f fix(lua): always return nil values in vim.tbl_get when no results
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:

```lua
local function nothing() return     end
local function null()    return nil end

select('#', nothing()) -- 0
select('#', null())    -- 1
```

`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
2022-12-15 02:43:43 +01:00
0887ad1cbb fix(ts): check buffer is loaded when restoring options (#21419)
fix(treesitter): check buffer is loaded when restoring options

Also restore spelloptions

Fixes #21416
2022-12-14 22:54:58 +00:00
4a78ed60a3 vim-patch:9.0.1057: conflict between supercollider and scala filetype detection (#21417)
Problem:    Conflict between supercollider and scala filetype detection.
Solution:   Do not check for "Class : Method", it can appear in both
            filetypes. (Chris Kipp, closes vim/vim#11699)

70ef3f546b

Co-authored-by: Chris Kipp <ckipp@pm.me>
2022-12-14 19:46:17 +01:00
6631df9107 fix(terminal): fix 'mousescroll' not respected in terminal mode (#21415) 2022-12-14 23:45:31 +08:00
d127c684fa fix(treesitter): properly restore 'syntax' (#21358) 2022-12-14 15:00:48 +00:00
04da043244 feat(lsp): add function to get semantic tokens at cursor 2022-12-13 18:59:27 +01:00
090048bec9 vim-patch:9.0.1051: after a failed CTRL-W ] next command splits window (#21400)
Problem:    After a failed CTRL-W ] next command splits window.
Solution:   Reset postponed_split. (Rob Pilling, closes vim/vim#11698)

cb94c91070

Co-authored-by: Rob Pilling <robpilling@gmail.com>
2022-12-13 22:43:54 +08:00
a6b05cb75d vim-patch:9.0.0530: using freed memory when autocmd changes mark (#21396)
Problem:    Using freed memory when autocmd changes mark.
Solution:   Copy the mark before editing another buffer.

8ecfa2c56b

Nvim already copies the mark.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-13 10:47:39 +08:00
0b20762c60 docs: remove "How-to disable mouse" menu item #21394 2022-12-12 17:43:49 -08:00
a442c9f556 Merge pull request #21375 from nojnhuh/highlight-test
fix(tests): initialize Screen.colors in API highlight tests
2022-12-12 22:11:39 +01:00
54d6a32fbd feat(lsp): highlight semantic token modifiers (#21390)
Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
2022-12-12 20:43:14 +01:00
3869a2e0cf perf(lsp): update semantic tokens algorithm for parsing modifiers (#21383)
Instead of testing for every possible modifier type, only test bits up
to the highest set in the token array. Saves many bit ops and
comparisons when there are no modifiers or when the highest set bit is a
lower bit than the highest possible in the legend on average.

Can be further simplified when non-luaJIT gets the full bit module (see #21222)
2022-12-12 18:42:37 +01:00
d40d34aaa5 fix(diff): handle long lines without crashing (#21389)
Fixes https://github.com/neovim/neovim/issues/21388
2022-12-12 16:44:11 +00:00
49c240d3a2 docs: add links to extmarks and namespaces (#21378)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-12-12 15:15:31 +00:00
8b9bf3e3b9 fix: vim.opt_local:append ignoring global option value (#21382)
Closes https://github.com/neovim/neovim/issues/18225
2022-12-12 15:14:50 +00:00
3217a31f9b vim-patch:7db29e4b5c3a (#21380)
* vim-patch:7db29e4b5c3a

Update runtime files

7db29e4b5c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-12 06:13:23 +01:00
1c324cb192 docs #20986
- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
  errors in pi_netrw.txt, so we can remove that workaround from
  ignore_parse_error().
- improved codeblock
2022-12-11 18:41:26 -08:00
b12bb97fee docs: fix typos (#21328) 2022-12-12 08:53:07 +08:00
407eef4738 vim-patch:9.0.1047: matchparen is slow (#21379)
Problem:    Matchparen is slow.
Solution:   Actually use the position where the match started, not the
            position where the search started. (closes vim/vim#11644)

79336e19cb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-11 23:02:41 +08:00
3dadd3aca5 vim-patch:8.2.2870: CmdlineChange event triggered twice for CTRL-R (#21361)
Problem:    CmdlineChange event triggered twice for CTRL-R.
Solution:   Return CMDLINE_NOT_CHANGED from cmdline_insert_reg().
            (closes vim/vim#8219)

796139ae3a

Cherry-pick Test_cmdline_map_cmdlineChanged() from patch 8.2.2851.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-11 08:48:00 +08:00
ea8b828901 fix(tests): initialize Screen.colors in API highlight tests 2022-12-10 15:59:21 -06:00
224473546c fix(api): set correct curbuf when temporarily changing curwin (#21371)
This is the same code change as 6c87bbb4e4
2022-12-10 20:13:40 +08:00
6d37d8cb17 fix(lsp): ignore null responses for semanticTokens request (#21364)
The spec indicates that the response may be `null`, but it doesn't
really say what a `null` response means. Since neovim raises an error if
the response is `null`, I figured that ignoring it would be the safest
bet.

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-12-10 12:16:33 +01:00
f96fb23de6 Merge pull request #21363 from jamessan/fuse-vim-patches
fix(vim-patches): ensure libfuse is installed
2022-12-09 19:49:36 -05:00
7faf8a45e8 fix(events): skip WinScrolled for newly-created float windows (#21333)
Unlike split windows, creating a new floating window does not cause
other windows to resize, so it doesn't make much sense to trigger
WinScrolled or WinResized when creating a new floating window.
2022-12-10 06:50:03 +08:00
8b84a10db7 fix(lsp): fix get_active_clients bufnr parameter (#21366)
Follow up to https://github.com/neovim/neovim/pull/21337
2022-12-09 22:02:04 +01:00
49df92da94 fix(lsp): correct some type annotations (#21365) 2022-12-09 19:18:31 +01:00
2ecb401f8b fix(vim-patches): ensure libfuse is installed 2022-12-09 09:56:56 -05:00
3cf0131c5c vim-patch:9.0.1038: function name does not match what it is used for (#21359)
Problem:    Function name does not match what it is used for.
Solution:   Include the modifier in the name. (closes vim/vim#11679)

ffa4e9b43a
2022-12-09 20:09:03 +08:00
5e6a288ce7 fix(lsp): followup fixes for semantic tokens support (#21357)
1. The algorithm for applying edits was slightly incorrect. It needs to
   preserve the original token list as the edits are applied instead of
   mutating it as it iterates. From the spec:

   Semantic token edits behave conceptually like text edits on
   documents: if an edit description consists of n edits all n edits are
   based on the same state Sm of the number array. They will move the
   number array from state Sm to Sm+1.

2. Schedule the semantic token engine start() call in the
   client._on_attach() function so that users who schedule_wrap() their
   config.on_attach() functions (like nvim-lspconfig does) can still
   disable semantic tokens by deleting the semanticTokensProvider from
   their server capabilities.
2022-12-09 11:54:09 +01:00
b5edea6553 vim-patch:9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off (#21355)
Problem:    Shift-Tab shows matches on cmdline when 'wildmenu' is off.
Solution:   Only show matches when 'wildmode' contains "list". (closes vim/vim#10951)

300175fd7f

Code change has already been ported.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-09 11:31:02 +08:00
f69d531d84 test: convert another test in test_matchadd_conceal.vim to Lua (#21353) 2022-12-09 10:37:53 +08:00
0483ee8254 vim-patch:8.2.4387: command line completion doesn't always work properly (#21352)
Problem:    Command line completion doesn't always work properly.
Solution:   Adjust triggering after a "|".  Add more tests. (Yegappan
            Lakshmanan, closes vim/vim#9779)

e3846cf1eb

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-09 09:45:45 +08:00
ae5980ec79 Merge pull request #21350 from zeertzjq/vim-8.2.4366
vim-patch:8.2.{4366,4376}: cmdline completion tests
2022-12-09 08:18:07 +08:00
98dc445767 vim-patch:8.2.4376: not enough tests for command line completion
Problem:    Not enough tests for command line completion.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#9771)

9773db6f9b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-09 07:52:50 +08:00
41282259ba vim-patch:8.2.4366: not enough tests for command line completion
Problem:    Not enough tests for command line completion.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#9760)

4d03d87000

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-09 07:52:50 +08:00
8b3412636a test(old): change $TMPDIR from Xtest-tmpdir to X-test-tmpdir (#21346)
I've noticed a patch 8.2.4376 that uses more Xtest directories.
Change $TMPDIR to X-test-tmpdir to avoid more future divergence.
2022-12-09 07:51:37 +08:00
d82096edf8 Merge pull request #21348 from zeertzjq/vim-9.0.1036
vim-patch:9.0.1036: undo misbehaves when writing from an insert mode mapping
2022-12-09 07:24:09 +08:00
95044991e6 test(undo_spec): add more tests for writing in Insert mode 2022-12-09 07:00:27 +08:00
70d6c335b1 vim-patch:9.0.1036: undo misbehaves when writing from an insert mode mapping
Problem:    Undo misbehaves when writing from an insert mode mapping.
Solution:   Sync undo when writing. (closes vim/vim#11674)

3f8f827723

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-09 06:55:15 +08:00
ea39fc2cad docs: dark/light color/accessibilty pass for generated html docs #21345 2022-12-08 14:00:18 -08:00
1e2cc68889 fix(chansend): sending lines to terminal in reverse order on Windows #19315
Problem: `chansend()` on Windows sends lines in reverse order.
Cause: Using \n instead of \r\n for newlines on Windows.
Solution: on Windows, use CRLF newline characters.

Fixes #18501
2022-12-08 12:55:50 -08:00
9b2c790344 Merge pull request #21338 from zeertzjq/vim-9.0.1030
vim-patch:9.0.{1030,1032}: using freed memory with the cmdline popup menu
2022-12-09 02:40:50 +08:00
95c655fedc vim-patch:9.0.1032: test fails when terminal feature is missing
Problem:    Test fails when terminal feature is missing.
Solution:   Use CheckRunVimInTerminal.

b9603f6498

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-09 02:16:57 +08:00
4d22424d9e vim-patch:9.0.1030: using freed memory with the cmdline popup menu
Problem:    Using freed memory with the cmdline popup menu.
Solution:   Clear the popup menu when clearing the matches. (closes vim/vim#11677)

038e6d20e6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-09 02:16:57 +08:00
9b14ad5fd9 Merge pull request #21100 from jdrouhard/lsp_semantic_tokens
LSP: semantic tokens support
2022-12-08 10:55:09 -07:00
9f035559de feat(lsp): initial support for semantic token highlighting
* credit to @smolck and @theHamsta for their contributions in laying the
  groundwork for this feature and for their work on some of the helper
  utility functions and tests
2022-12-08 11:31:56 -06:00
5e0c74cd82 refactor(test): create an lsp-specific helpers.lua file
* move the code for creating fake rpc servers there
2022-12-08 11:31:56 -06:00
42009ac7df feat(treesitter): add 'lang' option to show_tree() (#21341)
This is necessary for now to support filetypes that use a parser with a
different name (e.g. the "terraform" filetype uses the "hcl" parser).
2022-12-08 09:51:46 -07:00
d44699800c feat(treesitter): add vim.treesitter.show_tree() (#21322)
Add a "show_tree" function to view a textual representation of the
nodes in a language tree in a window. Moving the cursor in the
window highlights the corresponding text in the source buffer, and
moving the cursor in the source buffer highlights the corresponding
nodes in the window.
2022-12-08 09:22:57 -07:00
3576776903 vim-patch:86b4816766d9 (#21314)
Update runtime files

86b4816766

vim-patch:9.0.1029: autoload directory missing from distribution

Problem:    Autoload directory missing from distribution.
Solution:   Add the autoload/zig directory to the list of distributed files.

84dbf855fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-08 16:33:38 +01:00
7b9ad45178 vim-patch:8.2.1634: loop to handle keys for the command line is too long (#21340)
Problem:    Loop to handle keys for the command line is too long.
Solution:   Move a few more parts to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#6895)

9c929713b7
2022-12-08 22:52:25 +08:00
50ffb8d7f4 refactor(lsp): remove deprecated vim.lsp.buf_get_clients calls (#21337) 2022-12-08 13:28:28 +01:00
e2c5b21e18 test(lsp): call clear() before willSave tests (#21336)
Otherwise these two tests cannot run alone and may fail on CI.
2022-12-08 19:22:40 +08:00
4f64aef29f vim-patch:8.2.3564: invalid memory access when scrolling without valid screen (#21335)
vim-patch:8.2.3564: invalid memory access when scrolling without valid screen

Problem:    Invalid memory access when scrolling without a valid screen.
Solution:   Do not set VALID_BOTLINE in w_valid.

777e7c21b7

Remove -Z flag when using RunVim().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-08 18:58:06 +08:00
a27ed57ad0 docs(lua): add guide to using Lua in Neovim (#21137)
Add introductory guide explaining how to use Lua in Neovim:
where to put Lua files, how to set variables and options, how
to create mappings, autocommands, and user commands.

Adapted with kind permission from 
https://github.com/nanotee/nvim-lua-guide
2022-12-08 11:21:42 +01:00
54305443b9 feat(lsp): support willSave & willSaveWaitUntil capability (#21315)
`willSaveWaitUntil` allows servers to respond with text edits before
saving a document. That is used by some language servers to format a
document or apply quick fixes like removing unused imports.
2022-12-08 10:55:01 +01:00
a505c1acc3 vim-patch:9.0.1026: type of w_last_topfill is wrong (#21332)
Problem:    type of w_last_topfill is wrong.
Solution:   Use "int" instead of "linenr_T". (closes vim/vim#11670)

2e613453ee
2022-12-08 07:39:56 +08:00
f92aab5f70 vim-patch:9.0.1025: WinScrolled is not triggered when filler lines change (#21325)
Problem:    WinScrolled is not triggered when filler lines change.
Solution:   Add "topfill" to the values that WinScrolled triggers on.
            (closes vim/vim#11668)

3fc84dc2c7

Cherry-pick StopVimInTerminal() from patch 9.0.1010.
2022-12-07 18:34:39 +08:00
f8aa2a0dea docs(treesitter): use full function names in tags (#21321) 2022-12-07 09:27:41 +01:00
0caae2376e Merge pull request #21324 from zeertzjq/vim-8.2.1768
vim-patch:8.2.1768,0e6adf8a29d5,fa3b72348d88
2022-12-07 14:51:36 +08:00
214c9ed1e2 vim-patch:fa3b72348d88
Update runtime files

fa3b72348d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-07 14:25:58 +08:00
c61af03cd2 vim-patch:0e6adf8a29d5
Update runtime files

0e6adf8a29

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-07 14:25:58 +08:00
7dfd466437 vim-patch:8.2.1768: cannot use the help menu from a terminal window
Problem:    Cannot use the help menu from a terminal window.
Solution:   Add ":tlnoremenu" commands. (Yee Cheng Chin, closes vim/vim#7023)

b45cd36bd9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-07 14:25:57 +08:00
ed23cd3e50 fix(float): fix crash with bufpos and non-existent window (#21319) 2022-12-07 11:36:34 +08:00
eab71e7875 test: add more tests for float window bufpos (#21318) 2022-12-07 10:18:12 +08:00
ad244a865b fix(events): save v:event for cmdline autocommands separately (#21316) 2022-12-07 08:57:29 +08:00
a069e88b4e docs(lua): correct vim.spell.check example (#21311) 2022-12-06 16:44:43 +00:00
73ddb6daf9 ci(news): fetch full history (#21312)
We seem to need the parent commit of the earliest PR commit in order to
perform common git functionality to check which files were changed.
2022-12-06 17:38:24 +01:00
9628348a6a vim-patch:9.0.1017: test for srand() fails on MS-Windows (#21308)
Problem:    Test for srand() fails on MS-Windows.
Solution:   Do not expect the same result a second time.

9dacdb1d56

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 17:41:57 +08:00
d82e56dd12 vim-patch:8.2.1622: loop to handle keys for the command line is too long (#21307)
Problem:    Loop to handle keys for the command line is too long.
Solution:   Move code to functions. (Yegappan Lakshmanan, closes vim/vim#6880)

2f3cd2e4ec

Use the command line state as only argument instead.
2022-12-06 16:31:38 +08:00
6d7b94ea08 vim-patch:8.2.4393: possible number overflow with nested folds (#21305)
Problem:    Possible number overflow with nested folds.
Solution:   Avoid a negative line number.

6b43471da4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 11:34:20 +08:00
9a6f481ca0 version.c: update [skip ci] (#20958)
Co-authored-by: marvim <marvim@users.noreply.github.com>

N/A patches:
vim-patch:8.1.0820: test for sending large data over channel sometimes fails
vim-patch:8.1.1133: compiler warning for uninitialized struct member
vim-patch:8.1.1699: highlight_ga can be local instead of global
2022-12-06 09:39:43 +08:00
5199c333a0 vim-patch:9.0.1015: without /dev/urandom srand() seed is too predictable (#21303)
Problem:    Without /dev/urandom srand() seed is too predictable.
Solution:   Use micro seconds and XOR with process ID. (Yasuhiro Matsumoto,
            closes vim/vim#11656)

f0a9c00482

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2022-12-06 09:15:04 +08:00
54a1cc0ab0 Merge pull request #21302 from zeertzjq/vim-8.2.3193
vim-patch:8.2.{3193,4204,4389},9.0.{1011,1016}: screenpos() fixes
2022-12-06 08:39:57 +08:00
52b3e8bdef vim-patch:9.0.1016: screenpos() does not count filler lines for diff mode
Problem:    screenpos() does not count filler lines for diff mode.
Solution:   Add filler lines. (closes 11658)

1cb16c3a20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 08:02:39 +08:00
0909d987fe vim-patch:9.0.1011: ml_get error when using screenpos()
Problem:    ml_get error when using screenpos().
Solution:   Give an error for the line number. (closes vim/vim#11661)

99d19438ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 08:00:17 +08:00
10af0549df vim-patch:8.2.4389: screenpos() does not handle a position in a closed fold
Problem:    screenpos() does not handle a position in a closed fold.
Solution:   Check if the position is inside a closed fold. (closes vim/vim#9778)

4556a2e868

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 07:51:32 +08:00
6f9cda0f0a vim-patch:8.2.4204: screenpos() has non-zero row for invisible text
Problem:    screenpos() has non-zero row for invisible text.
Solution:   Only add the window row when the text is visible. (closes vim/vim#9618)

7924a17791

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 07:40:16 +08:00
e120a049f0 fix(float): fix ml_get error with bufpos 2022-12-06 07:40:16 +08:00
11d2704274 vim-patch:8.2.3193: screenpos() is wrong when 'display' is "lastline"
Problem:    screenpos() is wrong when the last line is partially visible and
            'display' is "lastline".
Solution:   Also compute the position for a partially visible line.
            (closes vim/vim#8599)

189663bdac

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-06 07:40:16 +08:00
0ff9131a92 vim-patch:9.0.1014: zir files are not recognized (#21301)
Problem:    Zir files are not recognized.
Solution:   Add a pattern for Zir files. (closes vim/vim#11664)

25201016d5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 15:54:32 -07:00
f3bf1fbf60 fix(secure): crash when hitting escape in prompt (#21283)
- use pcall when calling vim.secure.read from C
- catch keyboard interrupts in vim.secure.read, rethrow other errors
- selecting "view" in prompt runs :view command
- simplify lua stack cleanup with lua_gettop and lua_settop

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-12-05 11:59:04 -07:00
707df88054 docs: add missing docs from some Vim patches (#21296)
This is cherry-picked from these Vim patches:

Only applicable change outside vi_diff.txt in patch 8.1.1226:
6c60f47fb9

Most changes outside starting.txt and vi_diff.txt in patch 8.1.1280:
25c9c680ec

Missing docs for 'mousemoveevent':
cbaff5e06e
2022-12-05 21:09:31 +08:00
6c285a6e49 ci: create CI job to check if news needs to be updated (#21142)
If any commit message in the PR is either of type "feat" or is a
breaking change, then there's a high probability that news.txt should be
updated. Give an error if news.txt hasn't been updated in that case.

This workflow cannot 100% correctly determine if news.txt should be
updated even if the commit messages were exactly correct. The entries in
news.txt is determined by changes between releases, while the commit
messages are based on the master branch. While it is an approximation,
it is still a useful enough one that it's still valuable to have this
job as a reminder even if it gives an error if it shouldn't. In these
cases it is perfectly fine to ignore the failure for this job.
2022-12-05 11:58:30 +01:00
5c52971f60 ci: use shell script to deduplicate workflow (#21079) 2022-12-05 11:58:13 +01:00
9d8dbd9846 ci: use local action to make make cache keys consistent (#20538)
The advantages of using an action is that it reduces boilerplate and
repetition from the main ci.yml workflow.
2022-12-05 11:57:52 +01:00
89374da798 vim-patch:8.2.2328: some test files may not be deleted (#21194)
Problem:    Some test files may not be deleted.
Solution:   Add a delete() call, correct name. (Dominique Pellé, closes vim/vim#7654)

48e11c1054
2022-12-05 10:47:05 +08:00
1c6f7e5933 Merge pull request #21292 from zeertzjq/vim-8.2.1195
vim-patch:8.2.{1195,1197,2240,3108,3109,3495,3499,3526,5145}
2022-12-05 10:22:47 +08:00
9ae6b03e7a vim-patch:8.2.5145: exit test causes spurious valgrind reports
Problem:    Exit test causes spurious valgrind reports.
Solution:   Skip test.  Add CheckNotValgrind.

cf801d4b95

Cherry-pick RunningWithValgrind() from patch 8.2.5136.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:55:18 +08:00
ba9fcc22ef vim-patch:8.2.3526: tests have clumsy check for X11 based GUI
Problem:    Tests have clumsy check for X11 based GUI.
Solution:   Add CheckX11BasedGui.

40bd5a1540

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:55:18 +08:00
e043dbf0aa vim-patch:8.2.3499: GUI geometry startup test fails
Problem:    GUI geometry startup test fails.
Solution:   Check string values instead of numbers

3d031a0ae7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:55:18 +08:00
78fa1f069d vim-patch:8.2.3495: GUI geometry startup test fails on some systems
Problem:    GUI geometry startup test fails on some systems. (Drew Vogel)
Solution:   Add tolerance to the size check. (closes vim/vim#8815)

b376aa2da4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:55:18 +08:00
e9ad613fdf vim-patch:8.2.3109: check for $DISPLAY never fails
Problem:    Check for $DISPLAY never fails.
Solution:   Use eval().

f6d877975b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:51:08 +08:00
adcf7a2219 vim-patch:8.2.3108: test for remote_foreground() fails
Problem:    Test for remote_foreground() fails. (Elimar Riesebieter)
Solution:   Check that $DISPLAY is set. (Christian Brabandt)

d6fa7bd5b9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:50:54 +08:00
060789e335 vim-patch:8.2.2240: clientserver test fails if full path is used
Problem:    Clientserver test fails if full path is used.
Solution:   Ignore the path preceding the file name.

41a834d1e3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:50:18 +08:00
ee944ef103 vim-patch:8.2.1197: clientserver test still fails on MS-Windows
Problem:    Clientserver test still fails on MS-Windows.
Solution:   Expect a different error message.

c212dd0a34

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:49:44 +08:00
5d691a4669 vim-patch:8.2.1195: clientserver test fails on MS-Windows
Problem:    Clientserver test fails on MS-Windows.
Solution:   Expect a different error message.

4d57ba0202

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 09:49:32 +08:00
b098e7971f fix(lsp): ensure open_logfile is safe for fast events (#21288)
Closes https://github.com/neovim/neovim/issues/21052
2022-12-04 18:02:24 +01:00
ec6ba87229 Merge pull request #21287 from mfussenegger/lsp-show-document
fix(lsp): call show_document with correct args
2022-12-04 16:29:05 +01:00
67e1390dc8 fix(lsp): call show_document with correct args
Closes https://github.com/neovim/neovim/issues/21177
2022-12-04 15:57:46 +01:00
48b84d6d6e refactor(lsp): extract a _create_server method in lsp_spec 2022-12-04 15:39:22 +01:00
01a8cd0432 fix(lsp): remove workspaceFolders field (#21284) 2022-12-04 14:56:04 +01:00
b866d8d2e7 vim-patch:9.0.0610: global interrupt test fails when run under valgrind (#21285)
Problem:    Global interrupt test fails when run under valgrind.
Solution:   Use TermWait().

859ea4bc76

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-04 18:33:04 +08:00
9263f17d0d vim-patch:9.0.0259: crash with mouse click when not initialized (#21282)
Problem:    Crash with mouse click when not initialized.
Solution:   Check TabPageIdxs[] is not NULL.

80525751c5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-04 17:44:51 +08:00
823247a040 Merge pull request #21281 from zeertzjq/vim-8.2.4163
vim-patch:8.2.{4163,4168}
2022-12-04 16:59:45 +08:00
d93b906254 vim-patch:8.2.4168: disallowing empty function name breaks existing plugins
Problem:    Disallowing empty function name breaks existing plugins.
Solution:   Allow empty function name in legacy script.

e6a4200ff4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-04 16:34:01 +08:00
32810c0818 vim-patch:8.2.4163: no error for omitting function name after autoload prefix
Problem:    No error for omitting function name after autoload prefix.
Solution:   Check for missing function name. (issue vim/vim#9577)

2017d6f3b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-04 16:29:26 +08:00
a0dd663c2d Merge pull request #21279 from zeertzjq/vim-8.2.2182
vim-patch:8.2.{2182,2295,3265,3292}: search fixes
2022-12-04 10:32:20 +08:00
9476dd2f92 vim-patch:8.2.3292: underscore in very magic pattern causes a hang
Problem:    Underscore in very magic pattern causes a hang.  Pattern with \V
            are case sensitive. (Yutao Yuan)
Solution:   Adjust condition for magicness and advance pointer. (Christian
            Brabandt, closes vim/vim#8707, closes vim/vim#8704, closes vim/vim#8705)

bc67e5a0a4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-12-04 10:07:05 +08:00
3f1ee12d31 vim-patch:8.2.3265: smartcase does not work correctly in very magic pattern
Problem:    Smartcase does not work correctly in very magic pattern.
Solution:   Take the magicness into account when skipping over regexp items.
            (Christian Brabandt, closes vim/vim#8682, closes vim/vim#7845)

78ba933d18

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-12-04 10:07:05 +08:00
46e4be0fd0 vim-patch:8.2.2295: incsearch does not detect empty pattern properly
Problem:    Incsearch does not detect empty pattern properly.
Solution:   Return magic state when skipping over a pattern. (Christian
            Brabandt, closes vim/vim#7612, closes vim/vim#6420)

d93a7fc1a9
2022-12-04 10:07:05 +08:00
a91ba088ab vim-patch:8.2.2182: Vim9: value of 'magic' is still relevant
Problem:    Vim9: value of 'magic' is still relevant.
Solution:   Always behave like 'magic' is on in Vim9 script (closes vim/vim#7509)

f4e2099e39

EX_NONWHITE_OK is N/A: only applies to Vim9 script.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-04 10:07:04 +08:00
fba0562723 fix(syntax): correct conceal for annotated code blocks (#21272)
fixup for https://github.com/neovim/neovim/pull/21154
2022-12-03 15:16:37 +01:00
e642825e28 Merge pull request #21274 from zeertzjq/vim-8.2.3992
vim-patch:8.2.{3992,4261,4262},9.0.{0110,0577}
2022-12-03 21:44:13 +08:00
0cb90114d4 vim-patch:9.0.0577: buffer underflow with unexpected :finally
Problem:    Buffer underflow with unexpected :finally.
Solution:   Check CSF_TRY can be found.

96b9bf8f74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 21:21:47 +08:00
bf4bf7f9e0 vim-patch:9.0.0110: help tag generation picks up words in code examples
Problem:    Help tag generation picks up words in code examples.
Solution:   Skip over examples. (Carlo Teubner, closes vim/vim#10813)

ddab3ce345

Also fix mistakes in help files.

Co-authored-by: Carlo Teubner <carlo@cteubner.net>
2022-12-03 21:21:47 +08:00
3838ee63d0 test(old): skip Vim9 script with less divergence 2022-12-03 21:21:47 +08:00
742d95a629 vim-patch:8.2.4262: some search tests fail
Problem:    Some search tests fail.
Solution:   Use a better way to reject searching for the Visual area.

44a4d947bb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 21:21:47 +08:00
f6caa35e65 vim-patch:8.2.4261: accessing invalid memory in a regular expression
Problem:    Accessing invalid memory when a regular expression checks the
            Visual area while matching in a string.
Solution:   Do not try matching the Visual area in a string.

679d66c2d2

Use CheckScriptFailure() instead of v9.CheckScriptFailure().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 21:21:47 +08:00
b69c581761 vim-patch:8.2.3992: wrong local-additions in the help with language mix
Problem:    Wrong local-additions in the help with language mix.
Solution:   Adjust how the local additions list is generated. (Hirohito
            Higashi, closes vim/vim#9464)

0e2508d9e6

Co-authored-by: h-east <h.east.727@gmail.com>
2022-12-03 21:21:47 +08:00
e7a2ae829a test(old): make ":h local-additions" work properly in test_help.vim 2022-12-03 21:21:47 +08:00
c768b578fa fix(lsp): render <pre>{lang} code blocks and set separator default to false (#21271) 2022-12-03 13:51:57 +01:00
8f1ef36875 Merge pull request #21270 from zeertzjq/vim-8.2.1420
vim-patch:8.2.{1420,1440}: test 49 is old style
2022-12-03 15:09:46 +08:00
7d283d2139 vim-patch:8.2.1440: debugger code insufficiently tested
Problem:    Debugger code insufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6700)

16c6232cad
2022-12-03 14:47:35 +08:00
8a29d9660e vim-patch:8.2.1420: test 49 is old style
Problem:    Test 49 is old style.
Solution:   Convert remaining parts to new style. Remove obsolete items.
            (Yegappan Lakshmanan, closes vim/vim#6683)

f7c4d83609
2022-12-03 14:47:35 +08:00
aa49212731 vim-patch:9.0.0322: crash when no errors and 'quickfixtextfunc' is set (#21269)
Problem:    Crash when no errors and 'quickfixtextfunc' is set.
Solution:   Do not handle errors if there aren't any.

4f1b083be4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 13:34:25 +08:00
c0840087c8 Merge pull request #21267 from zeertzjq/vim-8.2.3900
vim-patch:8.2.{3900,partial:3908}: it is not easy to use a script-local function for an option
2022-12-03 09:05:20 +08:00
5e97984188 vim-patch:partial:8.2.3908: cannot use a script-local function for 'foldtext'
Problem:    Cannot use a script-local function for 'foldtext'.
Solution:   Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes vim/vim#9411)

27708e6c7b

Only port the changes actually related to 'foldtext'.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-03 08:39:57 +08:00
9671908c68 vim-patch:8.2.3900: it is not easy to use a script-local function for an option
Problem:    It is not easy to use a script-local function for an option.
Solution:   recognize s: and <SID> at the start of the expression. (Yegappan
            Lakshmanan, closes vim/vim#9401)

8bb65f230d

Omit duplicate docs in fold.txt: removed in a later runtime update.
Cherry-pick test_diffmode.vim changes from patch 8.2.1432.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-03 08:35:13 +08:00
2ae0d32a72 refactor: make sure getting a callback doesn't modify argument 2022-12-03 08:24:48 +08:00
10c50d9f30 Merge pull request #21266 from zeertzjq/vim-8.2.3889
vim-patch:8.2.3889,9.0.{0805,0990}
2022-12-03 04:26:00 +08:00
afb3ff52ec vim-patch:9.0.0990: callback name argument is changed by setqflist()
Problem:    Callback name argument is changed by setqflist().
Solution:   Use the expanded function name for the callback, do not store it
            in the argument. (closes vim/vim#11653)

c96b7f5d2a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 04:05:18 +08:00
1e6d5fdf3f vim-patch:9.0.0805: filetype autocmd may cause freed memory access
Problem:    Filetype autocmd may cause freed memory access.
Solution:   Set the quickfix-busy flag while filling the buffer.

d0fab10ed2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-03 03:42:43 +08:00
70ac0c9358 vim-patch:8.2.3889: duplicate code for translating script-local function name
Problem:    Duplicate code for translating script-local function name.
Solution:   Move the code to get_scriptlocal_funcname(). (Yegappan Lakshmanan,
            closes vim/vim#9393)

e7f4abd38b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-03 03:39:56 +08:00
07e6296520 Merge pull request #21154 from clason/vimdoc-injections
feat(help): highlighted codeblocks
2022-12-02 16:45:39 +01:00
e40df8b1bc docs(news): add entry for highlighted code 2022-12-02 16:05:00 +01:00
0b05bd87c0 docs(gen): support language annotation in docstrings 2022-12-02 16:05:00 +01:00
9e1187e489 feat(web): syntax highlighting via highlight.js
download from https://highlightjs.org/download/
place `highlight/` directory next to `css/`

style needs adapting for Neovim colors
2022-12-02 16:05:00 +01:00
952f19ba38 docs: add language annotation to Nvim manual 2022-12-02 16:05:00 +01:00
7314323420 Merge pull request #21264 from zeertzjq/vim-8.2.3829
vim-patch:8.2.{3829,3838}: cannot use script-local function for setting *func options
2022-12-02 22:10:09 +08:00
7d10194426 vim-patch:8.2.3838: cannot use script-local function for setting *func options
Problem:    Cannot use script-local function for setting *func options.
Solution:   Use the script context. (Yegappan Lakshmanan, closes vim/vim#9362)

db1a410b61

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-12-02 21:28:07 +08:00
1aad5af637 vim-patch:8.2.3829: no error when setting a func option to script-local function
Problem:    No error when setting a func option to a script-local function.
Solution:   Give an error if the name starts with "s:". (closes vim/vim#9358)

94c785d235

Omit test: reverted in patch 8.2.3838.
Cherry-pick SCRIPT_ID_VALID from patch 8.2.1539.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-02 21:28:07 +08:00
a3f01d32cb build: restrict git describe to top level source directory (#20993)
fix version determination when building neovim from release tarball
extracted within another git repository
2022-12-02 13:45:37 +01:00
c95a0c9959 fix(diff): fix a crash in diff mode with linematch enabled (#21070)
Problem: With two files open side by side in diff mode and deleting all of the contents of one file, the w_topfill value, which indicates the number of filler lines at the top of the window is set to be a negative number, and it will result in the virtual_lines_passed variable also being negative, and this while loop will run when it shouldn't. While calculating where the cursor and topline should be with linematch enabled, this topfill value is used to put the cursor and top line where it should be in the other windows. If that topfill number is negative, this causes a segfault. 

Solution: Check for positive top fill.
2022-12-02 13:45:00 +01:00
1145a9b248 feat(aucmd_win): allow crazy things with hidden buffers (#21250)
Problem:    Crash when doing crazy things with hidden buffers.
Solution:   Dynamically allocate the list of autocommand windows.
2022-12-02 20:39:24 +08:00
805c83f43e build(deps): bump LuaJIT to HEAD - 564147f51 (#21257) 2022-12-02 10:20:53 +01:00
86f9e29c86 refactor: remove COMMA (#21260)
It is not needed in Nvim. Ref #6068
2022-12-02 13:10:30 +08:00
dcc686a208 test: use luv.os_uname for fast platform detection (#21157) 2022-12-02 12:36:31 +08:00
facfc88b4c Merge pull request #21262 from zeertzjq/vim-8.2.1748
vim-patch:8.2.1748: closing split window in other tab may cause a crash
2022-12-02 11:15:47 +08:00
47d3d0102f vim-patch:8.2.1748: closing split window in other tab may cause a crash
Problem:    Closing split window in other tab may cause a crash.
Solution:   Set tp_curwin properly. (Rob Pilling, closes vim/vim#7018)

f3c51bbff1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-02 10:51:50 +08:00
982c0053f4 fix(float): make closing float in another tab return to correct window 2022-12-02 10:51:50 +08:00
61e99217e6 refactor(fs): replace vim.fn/vim.env in vim.fs (#20379)
Avoid using vim.env and vim.fn in vim.fs functions so that
they can be used in "fast" contexts.
2022-12-01 08:15:05 -07:00
adda751407 ci: rename workflow files to be simpler and more consistent (#21253) 2022-12-01 10:55:34 +01:00
1390e97c20 feat(provider): add support for Yarn node modules on Windows (#21246) 2022-12-01 11:50:53 +08:00
bd2d0edcbf fix: clang warnings (#21247) 2022-12-01 09:05:25 +08:00
282dda643a fix(ui-ext): log and clear error in ui_comp_event (#21147)
* fix: log and clear error in ui_comp_event

* fix: handling error in each map_foreach_value iteration

* fix: handling error decl in for_each loop

* fix: updating initerr to const, removing initerr free-ing

* fix: using ERROR_SET for error check

* fix: wrapping ERROR_INIT in parens to allow for including inside macro
2022-11-30 21:32:57 +01:00
ef5ab2bf76 ci: add more reviewers based on label (#21155) 2022-11-30 14:19:11 +01:00
c0d17cec0b vim-patch:8.2.3259 when 'indentexpr' causes an error did_throw may hang (#21240)
vim-patch:8.2.3259: when 'indentexpr' causes an error did_throw may hang

Problem:    When 'indentexpr' causes an error the did_throw flag may remain
            set.
Solution:   Reset did_throw and show the error. (closes vim/vim#8677)

620c959c6c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 11:47:30 +08:00
bfdddec8ba Merge pull request #21238 from zeertzjq/vim-8.2.5080
vim-patch:8.2.{5080,5082,5102,5103,5104,5105,5108}: when indenting gets out of hand it is hard to stop
2022-11-30 10:43:38 +08:00
22622df950 vim-patch:8.2.5108: retab test disabled because it hangs on MS-Windows
Problem:    Retab test disabled because it hangs on MS-Windows.
Solution:   Also set got_int at the other place a overlong text is detected.

308660bd26

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 10:15:48 +08:00
e0c7b8955d refactor: move ex_retab() to indent.c 2022-11-30 10:12:28 +08:00
3f743c39d3 vim-patch:8.2.5105: test still hangs on MS-Windows
Problem:    Test still hangs on MS-Windows.
Solution:   Skip "nocatch" test the right way.

83497f8758

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 10:07:14 +08:00
b57daafdd9 vim-patch:8.2.5104: test hangs on MS-Windows
Problem:    Test hangs on MS-Windows.
Solution:   Skip another test on MS-Windows.

b31cb04771

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 10:05:26 +08:00
c180e0d8d5 vim-patch:8.2.5103: build fails with small features
Problem:    Build fails with small features.
Solution:   Add #ifdef.  Skip test on MS-Windows.

34f99584c7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 10:04:24 +08:00
a7dc48f19d vim-patch:8.2.5102: interrupt not caught in test
Problem:    Interrupt not caught in test.
Solution:   Consider an exception thrown in the current try/catch when got_int
            is set.  Also catch early exit when not using try/catch.

8bea171f15

Cherry-pick test changes from patch 8.2.0557.

bfe13ccc58

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 10:03:37 +08:00
f706d24045 vim-patch:8.2.5082: retab test fails
Problem:    Retab test fails.
Solution:   Disable the test for now.

9397423985

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 09:47:53 +08:00
ec52658af7 vim-patch:8.2.5080: when indenting gets out of hand it is hard to stop
Problem:    When indenting gets out of hand it is hard to stop.
Solution:   When line gets too long set got_int.

a7ac4c9c39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-30 09:47:12 +08:00
d311c5481d Merge pull request #21234 from zeertzjq/vim-9.0.0965
vim-patch:9.0.{0965,0966,0967}: using one window for executing autocommands is insufficient
2022-11-29 21:07:29 +08:00
95f5cf9691 vim-patch:9.0.0967: leaking memory from autocmd windows
Problem:    Leaking memory from autocmd windows.
Solution:   Free window when auc_win is not NULL.

84497cd06f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 20:36:31 +08:00
3173d07564 vim-patch:9.0.0965: using one window for executing autocommands is insufficient
Problem:    Using one window for executing autocommands is insufficient.
Solution:   Use up to five windows for executing autocommands.

e76062c078

N/A patches for version.c:

vim-patch:9.0.0966: some compilers don't allow a declaration after a label

Problem:    Some compilers don't allow a declaration after a label.
Solution:   Move the declaration to the start of the block. (John Marriott)

f86490ed4f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 20:36:31 +08:00
5093f38c9f feat(help): highlighted codeblocks 2022-11-29 13:32:46 +01:00
273358651a refactor: buffer_ensure_loaded()
Cherry-picked from Vim patch 8.1.1612.
2022-11-29 20:25:42 +08:00
89f0987bde Merge pull request #21232 from zeertzjq/vim-9.0.0910
vim-patch:9.0.{0910,0914}
2022-11-29 17:55:39 +08:00
05f7d2bade vim-patch:9.0.0914: deletebufline() may move marks in the wrong window
Problem:    deletebufline() may move marks in the wrong window.
Solution:   Find a window for the buffer being changed. (closes vim/vim#11583)

228e422855

Cherry-pick code change from patch 9.0.0961.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 17:04:19 +08:00
1282d6d59f vim-patch:9.0.0910: setting lines in another buffer may not work well
Problem:    Setting lines in another buffer may not work well.
Solution:   Make sure the buffer being changed has a window. (issue vim/vim#11558)

c934bfa1b7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 17:04:15 +08:00
0b79137c59 vim-patch:8.1.2001: some source files are too big (#21231)
Problem:    Some source files are too big.
Solution:   Move buffer and window related functions to evalbuffer.c and
            evalwindow.c. (Yegappan Lakshmanan, closes vim/vim#4898)

261f346f81
2022-11-29 16:47:29 +08:00
98695b4999 vim-patch:8.1.1313: warnings for using localtime() and ctime() (#21229)
Problem:    Warnings for using localtime() and ctime().
Solution:   Use localtime_r() if available.  Avoid using ctime().

63d2555c9c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 11:48:06 +08:00
7328c4de54 vim-patch:9.0.0733: use of strftime() is not safe (#21228)
Problem:    Use of strftime() is not safe.
Solution:   Check the return value of strftime().  Use a larger buffer and
            correctly pass the available space. (Dominique Pellé, closes
            vim/vim#11348)

84d14ccdb5

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-11-29 11:18:15 +08:00
65e8ed45de vim-patch:9.0.0969: matchparen highlight is not updated when switching buffers (#21227)
Problem:    Matchparen highlight is not updated when switching buffers.
Solution:   Listen to the BufLeave and the BufWinEnter autocmd events.
            (closes vim/vim#11626)

28a896f54d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 10:17:57 +08:00
615f124003 docs: fix typos (#21196)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-11-29 09:45:48 +08:00
0badfaa6d0 test: adding/removing winbar should not cause win_pos events (#21226) 2022-11-29 08:56:41 +08:00
31eb20d915 Merge pull request #21224 from luukvbaal/vim-9.0.0964
refactor(ui): statusbar invalidation to win_set_inner_size()
2022-11-29 08:53:16 +08:00
6b18c77a27 refactor(ui): statusbar invalidation to win_set_inner_size()
Problem:    w_redr_status invalidation is duplicated in multiple functions
            that all call win_set_inner_size().
Solution:   Move to win_set_inner_size().
2022-11-29 01:14:08 +01:00
80b6edabe3 refactor: rework parameter validation in vim.secure.trust() (#21223) 2022-11-28 15:40:50 -07:00
bf0665b3f3 vim-patch:9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Problem:    Status line of other window not redrawn when dragging it when
            'splitkeep' is set to "screen".
Solution:   Set w_redr_status earlier. (Luuk van Baal, closes vim/vim#11635,
            closes vim/vim#11632)

74a694dbe2

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2022-11-28 23:20:19 +01:00
f004812b33 feat(secure): add :trust command and vim.secure.trust() (#21107)
Introduce vim.secure.trust() to programmatically manage the trust
database. Use this function in a new :trust ex command which can
be used as a simple frontend.

Resolves: https://github.com/neovim/neovim/issues/21092
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-11-28 12:23:04 -07:00
77a0f4a542 docs(lua): correct the tags for vim.opt_local and vim.opt_global (#21138) 2022-11-28 18:29:15 +01:00
ccd17543f3 Merge pull request #21200 from dundargoc/refactor/char_u/15
refactor: replace char_u with char 15 - remove STRNLEN and STRNCPY
2022-11-28 18:11:41 +01:00
3b96ccf7d3 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-11-28 14:53:35 +01:00
b2bb3973d9 vim-patch:9.0.0963: function name does not match autocmd event name (#21215)
Problem:    Function name does not match autocmd event name.
Solution:   Rename "optionsset" to "optionset". (closes vim/vim#11630)

269aa2b29a
2022-11-28 20:01:36 +08:00
a6f0444ab9 vim-patch:9.0.0958: messages test is flaky (#21205)
Problem:    Messages test is flaky.
Solution:   Add a short delay.

19cf525c20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-28 06:59:19 +08:00
28e6fe85a7 Merge pull request #21204 from bfredl/colormap
fix(tests): only get the color map once, even for multiple test files
2022-11-27 23:30:49 +01:00
942f26279d fix(tests): only get the color map once, even for multiple test files
Problem: test/functional/ui/screen.lua would be reloaded for each
*_spec.lua file, which causes an extra nvim session to be started
to get the color map each time.

solution: Mark screen.lua as a preloaded file, but defer the
loading of the color map to the first time Screen object is initialised.
2022-11-27 11:51:10 +01:00
3098064f33 vim-patch:9.0.0953: part of making search more efficient is missing (#21201)
Problem:    Part of making search more efficient is missing.
Solution:   Add the change in searchit().

837ca8f43b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-27 07:19:52 +08:00
019c8805e5 Merge pull request #20196 from dundargoc/refactor/char_u/14
refactor: replace char_u with char 14: remove `STRLEN` part final
2022-11-26 18:58:45 +01:00
bd22585061 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-11-26 15:52:21 +01:00
319fbffc94 vim-patch:9.0.0952: Eclipse preference files are not recognized (#21199)
Problem:    Eclipse preference files are not recognized.
Solution:   Add a pattern to use "jproperties" for Eclipse preference files.
            (closes vim/vim#11618)

f3f198b634

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2022-11-26 14:35:40 +01:00
7e9981d246 vim-patch:9.0.0951: trying every character position for a match is inefficient (#21198)
Problem:    Trying every character position for a match is inefficient.
Solution:   Use the start position of the match ignoring "\zs".

01105b37a1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-26 21:28:47 +08:00
84465a8c15 vim-patch:8.2.1707: small inconsitency in highlight test (#21193)
Problem:    Small inconsitency in highlight test.
Solution:   Use one argument for :execute. (Antony Scriven, vim/vim#6975)

2bbada8116
2022-11-26 11:15:27 +08:00
3f478547cf fix(startup): support .exrc or .nvimrc with init.lua (#21181) 2022-11-26 08:50:52 +08:00
9dfbbde240 docs: fix typos (#21168) 2022-11-26 07:52:30 +08:00
d38da27f1e vim-patch:9.0.0950: the pattern "\_s\zs" matches at EOL (#21192)
Problem:    The pattern "\_s\zs" matches at EOL.
Solution:   Make the pattern "\_s\zs" match at the start of the next line.
            (closes vim/vim#11617)

c96311b5be

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-26 07:32:45 +08:00
29b80f6f2e vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh" (#21174)
* vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh"

Problem:    When using dash it may not be recognize as filetype "sh".
Solution:   Add checks for "dash". (Eisuke Kawashima,closes vim/vim#11600)

24482fbfd5

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-11-25 10:08:15 +01:00
2efcb1a7e9 Merge pull request #21188 from zeertzjq/vim-8.2.2684
vim-patch:8.2.{2684,2713}: fold tests
2022-11-25 16:22:39 +08:00
7875e1377c vim-patch:9.0.0932: Oblivion files are not recognized (#21179)
Problem:    Oblivion files are not recognized.
Solution:   Recognize Oblivion files and alike as "obse". (closes vim/vim#11540)

ecfd511e8d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-25 09:17:30 +01:00
5ca1f48b40 vim-patch:9.0.0942: Workflow Description Language files are not recognized (#21183)
Problem:    Workflow Description Language files are not recognized.
Solution:   Add a pattern for the "wdl" filetype. (Matt Dunford,
            closes vim/vim#11611)

f60bdc3417

Co-authored-by: Matt Dunford <zenmatic@gmail.com>
2022-11-25 09:17:08 +01:00
84646b80f3 vim-patch:8.2.2713: folding code not sufficiently tested
Problem:    Folding code not sufficiently tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes vim/vim#8064)

68ffe8cade
2022-11-25 15:55:43 +08:00
ba360a26a2 vim-patch:8.2.2684: not enough folding code is tested
Problem:    Not enough folding code is tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#8046)

5c504f680e

Reorder test_fold.vim to match upstream.
Cherry-pick Test_fold_expr_error() from patch 8.2.0633.
Cherry-pick syntax feature check from patch 8.2.1432.
Cherry-pick a delete() call from patch 8.2.2112.
2022-11-25 15:50:34 +08:00
2738f842f6 Merge pull request #21186 from zeertzjq/vim-8.2.4155
vim-patch:8.2.{4155,4412}
2022-11-25 12:05:06 +08:00
8212bec4e9 vim-patch:8.2.4412: translation cleanup script does not remove empty lines at end
Problem:    Translation cleanup script does not remove empty lines at end.
Solution:   Remove empty lines at the end. (Ken Takata, closes vim/vim#9794)

0257599036
2022-11-25 11:38:31 +08:00
c2a9c64d23 vim-patch:8.2.4155: translating strftime() argument results in check error
Problem:    Translating strftime() argument results in check error.
Solution:   Add gettext comment.

7e93577a95

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-25 11:35:33 +08:00
e2a8ea76ea Merge pull request #21185 from zeertzjq/vim-8.2.2466
vim-patch:8.2.{2466,2886},9.0.0936
2022-11-25 11:06:19 +08:00
0482f53395 vim-patch:9.0.0936: wrong type for "isunnamed" returned by getreginfo()
Problem:    Wrong type for "isunnamed" returned by getreginfo().
Solution:   Use VAR_BOOL instead of VAR_SPECIAL. (closes vim/vim#11598)

82946e1439

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-25 10:44:43 +08:00
0d6e1273d6 vim-patch:8.2.2886: various pieces of code not covered by tests
Problem:    Various pieces of code not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8255)

34fcb69724

Nvim does not have test_unknown().

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-25 10:43:08 +08:00
5bdd787a7a vim-patch:8.2.2466: max() and min() can give many error messages
Problem:    Max() and min() can give many error messages.
Solution:   Bail out at the first error. (closes vim/vim#1039, closes vim/vim#7778)

ab65fc77c5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-25 10:38:16 +08:00
2b55d09314 ci(labeler): also add filetype label for filetype/detect.lua (#21180) 2022-11-24 15:19:31 +01:00
26cba0b17d Merge pull request #21080 from folke/fix_multigrid_lua_ui_attach
fix: don't disable compositor widgets when a GUI with multigrid attaches
2022-11-24 14:19:23 +01:00
38863f5242 Merge pull request #21173 from zeertzjq/vim-8.2.3698
vim-patch:8.2.{3698,3940,4062}: match highlight continues in linebreak
2022-11-24 19:41:02 +08:00
a98970219d vim-patch:8.2.4062: match highlighting of tab too short
Problem:    Match highlighting of tab too short.
Solution:   Do not stop match highlighting if on a Tab. (Christian Brabandt,
            closes vim/vim#9507, closes vim/vim#9500)

0bbca540f7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-24 19:10:00 +08:00
e38ae3b74f vim-patch:8.2.3940: match highlight disappears when doing incsearch for ":s/pat"
Problem:    Match highlight disappears when doing incsearch for ":s/pat".
Solution:   Only use line limit for incsearch highlighting. (closes vim/vim#9425)

94fb8274ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-24 19:03:23 +08:00
81c87857f6 vim-patch:8.2.3698: match highlighting continues over breakindent
Problem:    Match highlighting continues over breakindent.
Solution:   Stop before the end column. (closes vim/vim#9242)

0c359af5c0

Cherry-pick Test_matchdelete_redraw() from patch 8.2.1077.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-24 18:52:27 +08:00
868d8d6962 vim-patch:partial:b59ae59a5870 (#21170)
Update runtime files

b59ae59a58

- Omit `map()` lambda arg comment. Not worth mentioning for legacy script
  (and is already hinted at below).
- Cherry-pick latest `'thesaurusfunc'` example.
- Skip `optwin.vim` `'keyprotocol'` change.
- 🧜‍♀️

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-24 10:23:50 +00:00
c9adbcafae docs(news): add diagnostic suffix (#21141) 2022-11-23 18:42:05 -07:00
ddea80ebd6 docs(lua): add clarifications for fs.find() and fs.normalize() (#21132)
Co-Authored-By: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-Authored-By: zeertzjq <zeertzjq@outlook.com>
2022-11-24 00:40:07 +01:00
b26cf45fec build(nix): update nixpkgs
Update flake and drop now superfluous libvterm-neovim override
2022-11-24 00:29:12 +01:00
d25889ab76 Merge pull request #21163 from zeertzjq/vim-9.0.0925
vim-patch:9.0.{0925,0926,0927}
2022-11-23 20:40:46 +08:00
27fceca501 refactor: maybe suppress a PVS warning 2022-11-23 20:03:06 +08:00
65d95fa415 vim-patch:9.0.0926: Coverity warns for not using return value of dict_add()
Problem:    Coverity warns for not using return value of dict_add().
Solution:   When dict_add() fails then don't call hash_remove().

bc222152d8

N/A patches for version.c:

vim-patch:9.0.0927: Coverity warns for using a NULL pointer

Problem:    Coverity warns for using a NULL pointer.
Solution:   Check for memory allocaion failure.

96cbbe29de

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-23 19:59:43 +08:00
e339376cca vim-patch:9.0.0925: two conditions are always false
Problem:    Two conditions are always false.
Solution:   Remove the conditions.  Update return value types to make clear
            what could be returned. (closes vim/vim#11593)

df3c0eb41e
2022-11-23 19:59:38 +08:00
f1b88ced07 fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)
Missing part of Vim patch 8.1.0864.
2022-11-23 12:14:16 +08:00
4571ba4d0a vim-patch:partial:9.0.0917: the WinScrolled autocommand event is not enough (#21161)
Problem:    The WinScrolled autocommand event is not enough.
Solution:   Add WinResized and provide information about what changed.
            (closes vim/vim#11576)

35fc61cb5b

Omit "func_name" comment in tv_dict_extend(): Vim9 script only.
Skip layout locking and E1312.
Skip list_alloc_with_items() and list_set_item().

Since this overrides remaining changes in patch 9.0.0913, that patch can
now be marked as fully ported:

vim-patch:9.0.0913: only change in current window triggers the WinScrolled event

N/A patches for version.c:

vim-patch:9.0.0919: build failure with tiny features

Problem:    Build failure with tiny features.
Solution:   Adjust #ifdef's.

9c5b7cb4cf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-23 09:54:48 +08:00
d41e93d5a8 vim-patch:9.0.0922: Mermaid files are not recognized (#21160)
Problem:    Mermaid files are not recognized.
Solution:   Add patterns for Mermaid. (Crag MacEachern)

364438d1e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 23:28:49 +01:00
915891f28c build(deps): update viml parser and queries (#21158) 2022-11-22 21:25:51 +01:00
cd386b2c72 Merge pull request #20151 from dundargoc/refactor/char_u/13
refactor: replace char_u with char 13: remove `STRLEN` part 3
2022-11-22 11:02:24 +01:00
5eb5f49488 test: simplify platform detection (#21020)
Extend the capabilities of is_os to detect more platforms such as
freebsd and openbsd. Also remove `iswin()` helper function as it can be
replaced by `is_os("win")`.
2022-11-22 08:13:30 +08:00
7c10774860 refactor: remove old TODO comments that aren't relevant anymore (#21144) 2022-11-22 08:09:33 +08:00
0cbc23d3cc fix: pvs warnings (#21145)
* fix(PVS/V009): start file with special comment

* fix(PVS/V501): identical sub-expressions for comparison

* fix(PVS/V560): part of conditional expression is always true/false

* fix(PVS/V593): review expression of type A = B < C

* fix(PVS/V614): potentially uninitialized variable used
2022-11-22 08:07:45 +08:00
edd0de9821 Merge pull request #21149 from zeertzjq/vim-9.0.0916
vim-patch:8.2.{2435,2479},9.0.0916
2022-11-22 07:55:08 +08:00
9b76875235 vim-patch:9.0.0916: getbufline() is inefficient for getting a single line
Problem:    getbufline() is inefficient for getting a single line.
Solution:   Add getbufoneline().

ce30ccc06a

Cherry-pick part of usr_41.txt from patch 8.1.1628.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:21:26 +08:00
5836c89ed0 vim-patch:8.2.2479: set/getbufline test fails without the job feature
Problem:    set/getbufline test fails without the job feature.
Solution:   Check whether the job feature is supported. (Dominique Pellé,
            closes vim/vim#7790)

00385114db

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:11:50 +08:00
ef5dfe6c65 vim-patch:8.2.2435: setline() gives an error for some types
Problem:    setline() gives an error for some types.
Solution:   Allow any type, convert each item to a string.

3445320839

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:11:50 +08:00
904d0056d5 fix(diagnostic): correct type annotations; add Diagnostic type (#21120)
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
2022-11-21 22:02:18 +01:00
5f7560b8da build(editorconfig): set indent_size to 4 for python files (#21135) 2022-11-21 06:53:29 -07:00
2bb244af31 feat(lsp): support set title in lsp relate floatwindow (#21110) 2022-11-21 11:06:14 +01:00
126ef65e5b feat(diagnostic): add suffix option to virt_text config (#21140)
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
2022-11-20 16:57:36 -07:00
fbce9f421a feat(diagnostic): add suffix option to open_float() (#21130)
Closes #18687

This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.

It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
2022-11-20 13:09:35 -07:00
565442ec42 Merge pull request #21136 from zeertzjq/vim-9.0.0913
vim-patch:9.0.{partial:0913,0915}: only change in current window triggers the WinScrolled event
2022-11-20 22:00:13 +08:00
d6bd9c7733 test: add a test for #18222 2022-11-20 21:38:29 +08:00
91c192922d vim-patch:9.0.0915: WinScrolled may trigger immediately when defined
Problem:    WinScrolled may trigger immediately when defined.
Solution:   Initialize the fields in all windows. (closes vim/vim#11582)

2996773276

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:24:22 +08:00
035d41ac5e vim-patch:partial:9.0.0913: only change in current window triggers the WinScrolled event
Problem:    Only a change in the current window triggers the WinScrolled
            event.
Solution:   Trigger WinScrolled if any window scrolled or changed size.
            (issue vim/vim#11576)

0a60f79fd0

Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:11:37 +08:00
822eabc5e1 docs(support): update tested versions (#21126) 2022-11-20 18:42:30 +08:00
cb27c09930 test: use isCI to simplify CI detection (#21134) 2022-11-20 18:26:21 +08:00
40f3f75867 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-11-19 16:27:10 +01:00
6e8ed5abaa perf(diagnostic): use api variable and improve validate (#21111)
* fix(diagnostic): use api variable and improve validate

* fix: fix test case
2022-11-19 06:41:47 -07:00
4650af38f0 test: fix failing tui_spec.lua tests (#21117)
* refactor(test): use exec_lua

* fix(test): fix failing tui_spec tests

test is failing when path of tty-test does not fit cmdline
2022-11-19 20:46:04 +08:00
cfdf5e6f37 fix(lsp): ignore hover and signatureHelp responses on buffer change (#21121)
Language servers can take some time to respond to the
`textDocument/hover` and `textDocument/signatureHelp` messages. During
that time, the user could have already moved to another buffer. The
popup was always shown in the current buffer, which could be a different
one than the buffer for which the request was sent.

This was particularly annoying when moving to a buffer with a `BufLeave`
autocmd, as that autocmd was triggered when the hover popup was shown
for the original buffer.

Ignoring the response from these 2 messages if they are for a buffer
that is not the current one leads to less noise. The popup will only be
shown for the buffer for which it was requested.

A more robust solution could involve cancelling the hover/signatureHelp
request if the buffer changes so the language server can free its
resources. It could be implemented in the future.
2022-11-19 12:27:00 +01:00
7c57f06b63 vim-patch:partial:d13166e788fc (#21109)
Update runtime files

d13166e788

- Skip E1309-1311 (not ported).
- Skip `:echowindow` changes (not ported).
- Skip termdebug winbar doc changes (not fully ported).
- Port missing `g:termdebug_config.{wide,use_prompt}` changes from v8.2.5010.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 10:31:51 +00:00
af204dd0f1 feat(lsp): run handler in coroutine to support async response (#21026)
To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
2022-11-19 10:48:49 +01:00
0958dccc6d vim-patch:8.2.5130: edit test for mode message fails when using valgrind (#21118)
Problem:    Edit test for mode message fails when using valgrind.
Solution:   Use WaitForAssert().  Run beep test later.

c5382b667a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 16:39:30 +08:00
c011747b5f vim-patch:8.2.5148: invalid memory access when using expression on command line (#21113)
Problem:    Invalid memory access when using an expression on the command line.
Solution:   Make sure the position does not go negative.

6046aded8d

N/A patches for version.c:

vim-patch:8.2.5149: cannot build without the +eval feature

Problem:    Cannot build without the +eval feature. (Tony Mechelynck)
Solution:   Add #ifdefs.

6689df024b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 14:12:45 +08:00
92e51d7e4b vim-patch:8.2.5167: get(Fn, 'name') on funcref returns special byte code (#21112)
Problem:    get(Fn, 'name') on funcref returns special byte code.
Solution:   Use the printable name.

1ae8c262df

Cherry-pick printable_func_name() from patch 8.2.0149.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 12:47:44 +08:00
f2b30b4d62 vim-patch:8.2.0260: several lines of code are duplicated (#21108)
Problem:    Several lines of code are duplicated.
Solution:   Move duplicated code to a function. (Yegappan Lakshmanan,
            closes vim/vim#5330)

f4140488c7

Using sizeof seems better than ARRAY_SIZE for vim_snprintf().
2022-11-19 10:57:06 +08:00
db407010fa feat(clipboard): added wayclip support (#21091) 2022-11-18 08:39:56 -07:00
2360c98456 Merge pull request #21104 from zeertzjq/vim-8.2.0469
vim-patch:8.2.{0450,0469}
2022-11-18 22:44:01 +08:00
a4114f16bf vim-patch:8.2.0469: Vim9: no error for missing ] after list
Problem:    Vim9: no error for missing ] after list.
Solution:   Add error message. Add more tests.

ee619e5bc0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 22:30:49 +08:00
fdeb20ddde vim-patch:8.2.0450: not enough testing for restricted mode and function calls
Problem:    Not enough testing for restricted mode and function calls.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5847)

7d941ee032
2022-11-18 22:30:47 +08:00
88d0d7ad10 Merge pull request #21103 from zeertzjq/vim-8.2.4553
vim-patch:8.2.{4553,4562}: linear tag search is not optimal
2022-11-18 21:00:21 +08:00
346c96a33f vim-patch:8.2.4562: linear tag search is not optimal
Problem:    Linear tag search is not optimal.
Solution:   Improve linear tag search performance. (Yegappan Lakshmanan,
            closes vim/vim#9944)

b29b96806f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 20:35:20 +08:00
6a5fbabe48 vim-patch:8.2.4553: linear tag search is a bit slow
Problem:    Linear tag search is a bit slow.
Solution:   Remove a vim_ftell() call. (Yegappan Lakshmanan, closes vim/vim#9937)

8b530b3158

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 20:05:00 +08:00
cf759c7429 Merge pull request #21102 from zeertzjq/vim-8.2.4512
vim-patch:8.2.{4512,4518,4538,4543,4544}: find_tags_in_file() function is too long
2022-11-18 20:01:09 +08:00
30e6cc405f vim-patch:8.2.4544: Coverity warnings for not using returned value
Problem:    Coverity warnings for not using returned value.
Solution:   Assign to vim_ignored.

dbf8094b17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 19:41:54 +08:00
b2345ddbf3 vim-patch:8.2.4543: Coverity warning for refactored tag search code
Problem:    Coverity warning for refactored tag search code.
Solution:   Avoid the warnings.  Update comments.  Add one more test case.
            (Yegappan Lakshmanan, closes vim/vim#9928)

20fb28b1dc

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
136112a869 vim-patch:8.2.4538: the find_tags_in_file() function is too long
Problem:    The find_tags_in_file() function is too long.
Solution:   Refactor into smaller functions. (Yegappan Lakshmanan,
            closes vim/vim#9920)

bf40e90dfe

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
e41469a5b5 vim-patch:8.2.4518: the binary tag search feature is always enabled
Problem:    The binary tag search feature is always enabled.
Solution:   Remove the #ifdefs.  Add a few more tests. (Yegappan Lakshmanan,
            closes vim/vim#9893)

655b734ee8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
6f08ea0131 vim-patch:8.2.4512: the find_tags_in_file() function is much too long
Problem:    The find_tags_in_file() function is much too long.
Solution:   Refactor into multiple smaller functions. (Yegappan Lakshmanan,
            closes vim/vim#9892)

df1bbea436

Cherry-pick Test_tag_file_encoding() changes from patch 8.2.1432.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:53 +08:00
f70963f838 Merge pull request #21101 from zeertzjq/vim-8.2.4494
vim-patch:8.2.{4494,4496}: find_tags() function is too long
2022-11-18 15:24:39 +08:00
41c85ac2ef vim-patch:8.2.4496: Coverity gives warnings after tags code refactoring
Problem:    Coverity gives warnings after tags code refactoring.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#9882)

fe9112e630
2022-11-18 14:59:18 +08:00
245035d6db vim-patch:8.2.4494: the find_tags() function is much too long
Problem:    The find_tags() function is much too long.
Solution:   Refactor the function. (Yegappan Lakshmanan, closes vim/vim#9869)

2f87a99b6e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 14:59:18 +08:00
282cbc2350 vim-patch:8.2.3776: when a tags file line is long a tag may not be found (#21099)
Problem:    When a tags file line is long a tag may not be found.
Solution:   When increasing the buffer size read the same line again.

f8e9eb8e17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 11:16:11 +08:00
ba04fffe98 feat(l10n): update zh_CN translations (#21085) 2022-11-18 08:43:56 +08:00
790d12b95f fix(ex_cmds): fix a mistake in the porting of Vim patch 8.1.0306 (#21096) 2022-11-18 08:14:17 +08:00
523b1943c3 vim-patch:9.0.0897: Clinical Quality Language files are not recognized (#21094)
Problem:    Clinical Quality Language files are not recognized.
Solution:   Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)

12babe45a3

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-11-18 00:39:31 +01:00
510429fc5c vim-patch:8.2.1497: CursorHold test is flaky (#21095)
Problem:    CursorHold test is flaky. (Jakub Kądziołka)
Solution:   Use WaitForAssert() (closes vim/vim#6754)

17f67547f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 06:47:51 +08:00
7b158e766b Merge pull request #21078 from dundargoc/refactor/remove-wint
refactor: remove __STDC_ISO_10646__ check
2022-11-17 21:20:11 +01:00
1f6d36c2c4 Merge pull request #21090 from zeertzjq/vim-8.2.2945
vim-patch:8.2.{2945,2952,2960,2973,2981,3080,3103,3440,3498},9.0.0895: recover tests
2022-11-17 23:53:58 +08:00
32cba4cee6 Merge pull request #20956 from gpanders/lua-readsecure
feat: implement vim.secure.read() and use it for 'exrc'
2022-11-17 08:47:41 -07:00
4b7aafc2f4 fix(memline): use long instead of linenr_T for db_line_count 2022-11-17 23:30:56 +08:00
7139035bfd vim-patch:9.0.0895: file renamed twice in test, missing feature check
Problem:    File renamed twice in test; missing feature check.
Solution:   Remove a rename() call.  Add check for cryptv feature.
            (closes vim/vim#11564)

780154bf7a

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-11-17 23:30:56 +08:00
6d9c3d903e refactor: deprecate 'secure' option
Now that 'exrc' files must be explicitly marked trusted there is no need
to constrain what can be done in them.
2022-11-17 08:23:41 -07:00
294910a1ff feat(exrc): use vim.secure.read() for 'exrc' option 2022-11-17 08:23:41 -07:00
f1922e78a1 feat: add vim.secure.read()
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
2022-11-17 08:23:41 -07:00
51a48d482e refactor: remove __STDC_ISO_10646__ check
We can always assume wchar_t values are unicode codepoints for the
systems we support, so this check isn't necessary.
2022-11-17 16:12:34 +01:00
c269b8dcae vim-patch:8.2.3498: recover test may fail on some systems
Problem:    Recover test may fail on some systems.
Solution:   Adjust the little endian and 64 bit detection. (James McCoy,
            closes vim/vim#8941)

37f341d723

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-11-17 23:03:31 +08:00
d8fc390bd0 vim-patch:8.2.3440: recover test fails if there is an old swap file
Problem:    Recover test fails if there is an old swap file.
Solution:   Delete old swap files.

f2a8bafa4b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 23:02:59 +08:00
acfc3d54c6 vim-patch:8.2.3103: swap test may fail on some systems
Problem:    Swap test may fail on some systems when jobs take longer to exit.
Solution:   Use different file names.

f33cae6050

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 23:02:26 +08:00
c1c2c7b316 vim-patch:8.2.3080: recover test fails on 32bit systems
Problem:    Recover test fails on 32bit systems. (Ondřej Súkup)
Solution:   Detect 32/64 bit systems. (Yegappan Lakshmanan, closes vim/vim#8485,
            closes vim/vim#8479)

576cb75ceb

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 23:01:09 +08:00
fa17dc1e1b vim-patch:8.2.2981: recovery test is not run on big-endian systems
Problem:    Recovery test is not run on big-endian systems.
Solution:   Make it work on big-endian systems. (James McCoy, closes vim/vim#8368)

6654ca702c

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-11-17 23:00:43 +08:00
f12a45c45e vim-patch:8.2.2973: fix for recovery and diff mode not tested
Problem:    Fix for recovery and diff mode not tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8352)

3044324e8d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:59:33 +08:00
a8f54a94c1 vim-patch:8.2.2960: swap file recovery not sufficiently tested
Problem:    Swap file recovery not sufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8339)

8cf02e5cf8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:56:39 +08:00
442a7e89b8 vim-patch:8.2.2952: recover test fails on big endian systems
Problem:    Recover test fails on big endian systems.
Solution:   Disable the failing test on big endian systems. (Yegappan
            Lakshmanan, closes vim/vim#8335)

99285550a9

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:53:24 +08:00
3f75f25f9c vim-patch:8.2.2945: some buffer related code is not tested
Problem:    Some buffer related code is not tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8320)

59b262362f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:45:14 +08:00
9736605672 Merge pull request #21089 from zeertzjq/vim-8.2.2586
vim-patch:8.2.{2586,2587,2589}: process id may be invalid
2022-11-17 22:38:39 +08:00
a77be32cf9 test: add a Lua test for swap file created before boot
Change the file modification time instead of uptime.
2022-11-17 22:17:48 +08:00
5176ed88f6 vim-patch:8.2.2589: recover test hangs in the GUI
Problem:    Recover test hangs in the GUI.
Solution:   Add g:skipped_reason to skip a _nocatch_ test.

776b954622

Now always skip the test as test_override() is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:37 +08:00
1ab08e23b3 vim-patch:8.2.2587: recover test fails on FreeBSD
Problem:    Recover test fails on FreeBSD.
Solution:   Check for Linux.

6635ae1437

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:37 +08:00
ec5c1c35c2 vim-patch:8.2.2586: process id may be invalid
Problem:    Process id may be invalid.
Solution:   Use sysinfo.uptime to check for recent reboot. (suggested by Hugo
            van der Sanden, closes vim/vim#7947)

f52f0606ed

test_override() is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:33 +08:00
0a4c5cd2b2 Merge pull request #21087 from zeertzjq/vim-8.2.1970
vim-patch:8.2.{1970,2016,2019,2026,2044,3041,3042}: check if process of swap file is still running
2022-11-17 19:38:57 +08:00
78998bc6c6 vim-patch:8.2.3042: swap file test fails
Problem:    Swap file test fails.
Solution:   Check for a very high process ID instead of one, which should be
            running.

6738fd2000

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 18:44:26 +08:00
a8489308ab vim-patch:8.2.3041: detecting if the process of a swap file is running fails
Problem:    Detecting if the process of a swap file is running fails if the
            process is owned by another user.
Solution:   Check for the ESRCH error. (closes vim/vim#8436)

44dea9da4b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 18:44:05 +08:00
1fe526184f vim-patch:8.2.2044: MS-Windows: swap file test sometimes fails
Problem:    MS-Windows: swap file test sometimes fails.
Solution:   Use a more reliable way to change the process ID. When "timeout"
            fails use "ping" to wait up to ten minutes. (Ken Takata,
            closes vim/vim#7365)

5ee0981fb5
2022-11-17 18:26:20 +08:00
8cf38c2fd9 vim-patch:8.2.2026: Coverity warns for possibly using not NUL terminated string
Problem:    Coverity warns for possibly using not NUL terminated string.
Solution:   Put a NUL in b0_hname just in case.

e79cdb69a4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 18:24:31 +08:00
1b95eaf84b vim-patch:8.2.2019: swap file test fails on MS-Windows
Problem:    Swap file test fails on MS-Windows.
Solution:   Add four to the process ID. (Ken Takata, closes vim/vim#7333)

80d868ec25
2022-11-17 18:24:28 +08:00
f97d88a58a vim-patch:8.2.2016: swap file test is a little flaky
Problem:    Swap file test is a little flaky.
Solution:   Don't set a byte to a fixed value, increment it.

c6ca9f3a29

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 18:24:28 +08:00
abe1dd308e vim-patch:8.2.1970: it is easy to make mistakes when cleaning up swap files
Problem:    It is easy to make mistakes when cleaning up swap files after the
            system crashed.
Solution:   Warn for the process still running after recovery.  Do not
            automatically delete a swap file created on another system.
            (David Fries, closes vim/vim#7273)

f883508e36
2022-11-17 18:24:21 +08:00
98bcf49d26 vim-patch:8.2.1260: there is no good test for CursorHold (#21086)
Problem:    There is no good test for CursorHold.
Solution:   Add a test.  Remove duplicated test. (Yegappan Lakshmanan,
            closes vim/vim#6503

7591116acf
2022-11-17 17:34:13 +08:00
488e99311f ci(release/winget): correctly set output variable (#21077) 2022-11-17 09:43:45 +01:00
6aa5520763 ci(windows): set $PSNativeCommandArgumentPassing = 'Legacy' (#21083)
Ref https://github.com/actions/runner-images/issues/6586

Some runners are using new images, while some others are using old
image. This is the only way I can find that makes it work on both.
2022-11-17 15:57:59 +08:00
ed27f0e93e vim-patch:9.0.0300: 'cpoptions' tests are flaky (#21081)
Problem:    'cpoptions' tests are flaky.
Solution:   Use a different file name for each test.

a85e4db978

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 07:51:04 +08:00
fedf002cb3 fix(api): nvim_win_set_cursor redraw cursorcolumn for non-current window (#21072)
fix #19063
this fixes the cursorcolumn not being redrawn for non-current windows in `nvim_win_set_cursor()`
2022-11-17 07:18:31 +08:00
c7ee0fe38f fix: don't disable compositor widgets when a GUI with multigrid attaches 2022-11-16 22:45:15 +01:00
c404f9b4ba ci(stale): disable remove-stale-when-updated (#21075)
The needs:response label should only be added and removed manually, and
the action's behavior of removing the label on any activity (e.g. title
change, removing reviewers) is unwanted.
2022-11-16 16:32:05 +01:00
fa7e1e2601 fix(api): nvim_buf_get_text regression (#21071) 2022-11-15 21:27:42 +00:00
fd54194a4f refactor: convert drawline.c draw states to enum (#21067) 2022-11-15 20:57:30 +00:00
c70d90dbfd vim-patch:9.0.0884: mouse shape remains in op-pending mode after failed change (#21066)
Problem:    Mouse shape remains in op-pending mode after failed change.
Solution:   Reset finish_op and restore it. (closes vim/vim#11545)

cdeb65729d
2022-11-15 23:02:48 +08:00
211c568e64 test: don't skip parser_spec on windows (#20294) 2022-11-15 19:33:30 +08:00
4b02291f81 Merge pull request #20157 from dundargoc/build/iwyu
build: allow IWYU to fix includes for all .c files
2022-11-15 10:55:07 +01:00
c6c265a86c Merge pull request #21031 from dundargoc/fix/windows
ci(windows): treat compiler warnings as errors
2022-11-15 10:35:25 +01:00
66360675cf build: allow IWYU to fix includes for all .c files
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.

Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
2022-11-15 10:30:03 +01:00
9d2a6cd11e docs(treesitter): change links for eq? and set! to codeblocks (#21047) 2022-11-15 10:23:56 +01:00
7439973851 vim-patch:9.0.0882: using freed memory after SpellFileMissing autocmd uses bwipe (#21060)
Problem:    Using freed memory after SpellFileMissing autocmd uses bwipe.
Solution:   Bail out if the window no longer exists.

c3d27ada14

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-15 07:58:22 +08:00
2685d27cd6 vim-patch:9.0.0883: a silent mapping may cause dots on the command line (#21061)
Problem:    A silent mapping may cause dots on the command line.
Solution:   Don't show dots for completion if they are not going to be removed
            again. (closes vim/vim#11501)

698a00f55d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-15 07:23:57 +08:00
4541c45081 Merge pull request #21054 from max397574/fix/deepcopy_vimNIL
fix(lua): make `vim.deepcopy` work with `vim.NIL`
2022-11-14 22:26:22 +01:00
Max
e15f61b1bd fix(lua): make vim.deepcopy work with vim.NIL
style: changed double quotes to single quotes

feat: add tests

fix tests
2022-11-14 21:14:27 +01:00
2755510f78 ci(windows): treat compiler warnings as errors
Reduce the warning level from 3 to 1 and fix all warnings.
2022-11-14 20:17:04 +01:00
f8c6718277 feat(lua-api): avoid unnecessary allocations (#19877)
Lua makes (or reuses) an internal copy of strings, so we can safely push
buf pointers onto the stack.
2022-11-14 18:04:36 +00:00
3060432007 vim-patch:9.0.0878: Coverity warns for dead code (#21053)
Problem:    Coverity warns for dead code.
Solution:   Remove the dead code.

b298fe6cba

Nvim has refactored this function and does not have the dead code.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-14 23:18:25 +08:00
e8cc489acc feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
5c5187c6f8 test: remove skip for 32-bit MSVC (#21030)
We don't support 32-bit windows anymore so it's not needed.
2022-11-14 16:28:30 +08:00
c4fcde5063 vim-patch:8.2.4038: various code not used when features are disabled (#21049)
Problem:    Various code not used when features are disabled.
Solution:   Add #ifdefs. (Dominique Pellé, closes vim/vim#9491)

748b308eeb

N/A patches for version.c:

vim-patch:8.2.2186: Vim9: error when using 'opfunc'

Problem:    Vim9: error when using 'opfunc'.
Solution:   Do not expect a return value from 'opfunc'. (closes vim/vim#7510)

5b3d1bb0f5
2022-11-14 12:10:26 +08:00
6d996f78ef vim-patch:8.2.4001: insert complete code uses global variables
Problem:    Insert complete code uses global variables.
Solution:   Make variables local to the file and use accessor functions.
            (Yegappan Lakshmanan, closes vim/vim#9470)

d94fbfc74a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-14 11:23:33 +08:00
f2695919bb test(old): add missing lines from Vim patch 8.2.0522 (#21048) 2022-11-14 08:16:29 +08:00
b433acc3c9 vim-patch:9.0.0872: code is indented more than needed (#21046)
Problem:    Code is indented more than needed.
Solution:   Return early. (Yegappan Lakshmanan, closes vim/vim#11538)

623e94e138

Only port the first change to init_history() as Nvim has refactored it.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-14 07:16:42 +08:00
736c36c02f test: introduce skip() #21010
This is essentially a convenience wrapper around the `pending()`
function, similar to `skip_fragile()` but more general-purpose.

Also remove `pending_win32` function as it can be replaced by
`skip(iswin())`.
2022-11-13 05:52:19 -08:00
0a96f18ed7 Merge pull request #21033 from bfredl/winfix
fix(ui): fix some cases of stale highlight definitions
2022-11-13 10:53:59 +01:00
d7e7578ada fix(ui): fix some cases of stale highlight definitions
fixes #20695
2022-11-13 10:20:28 +01:00
c4f84fc2e2 Merge pull request #20984 from notomo/fix-message-kind-on-history
fix(ui-ext): correct message kind in history before vim.ui_attach()
2022-11-13 09:53:02 +01:00
9d7dc50628 vim-patch:9.0.0865: duplicate arguments are not always detected (#21036)
Problem:    Duplicate arguments are not always detected.
Solution:   Expand to full path before comparing arguments. (Nir Lichtman,
            closes vim/vim#11505, closes vim/vim#9402)

b3052aa1b5

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2022-11-13 08:35:15 +08:00
849394e4e2 vim-patch:9.0.0863: col() and charcol() only work for the current window (#21038)
Problem:    col() and charcol() only work for the current window.
Solution:   Add an optional winid argument. (Yegappan Lakshmanan,
            closes vim/vim#11466, closes vim/vim#11461)

4c8d2f02b3

Cherry-pick test_functions.vim change from patch 8.2.0633.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-13 08:29:05 +08:00
ec449c27fd vim-patch:9.0.0867: wildmenu redrawing code is spread out (#21035)
Problem:    Wildmenu redrawing code is spread out.
Solution:   Refactor to move code together. (closes vim/vim#11528)

d6e91385f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 08:20:00 +08:00
e7ba5ba3cd test(lua/ui_spec): fix Ctrl-C test flakiness (#21039)
Prevent Ctrl-C from flushing the command that starts the prompt.
2022-11-13 08:16:06 +08:00
f516a9ced7 Merge pull request #21037 from zeertzjq/vim-8.2.4675
vim-patch:8.2.{4675,4676},9.0.0869: no error for missing expression after :elseif
2022-11-13 08:09:21 +08:00
b251972580 vim-patch:9.0.0869: bogus error when string used after :elseif
Problem:    Bogus error when string used after :elseif.
Solution:   Do not consider a double quote the start of a comment.
            (closes vim/vim#11534)

28c56d5013

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
bc1dbebe1f vim-patch:8.2.4676: test fails with different error
Problem:    Test fails with different error.
Solution:   Add argument for :elseif.

292e1b9f68

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
2cb0860117 vim-patch:8.2.4675: no error for missing expression after :elseif
Problem:    No error for missing expression after :elseif. (Ernie Rael)
Solution:   Check for missing expression. (closes vim/vim#10068)

fa010cdfb1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:21:22 +08:00
47ad4c8701 vim-patch:9.0.0866: no test for what patch 8.2.2207 fixes (#21034)
Problem:    No test for what patch 8.2.2207 fixes.
Solution:   Add a test case. (closes vim/vim#11531)

f7570f2107
2022-11-13 07:06:37 +08:00
7abe8ef422 vim-patch:9.0.0862: default value of 'endoffile' is wrong (#21032)
Problem:    Default value of 'endoffile' is wrong.
Solution:   The default must be 'noendoffile'.

0aad88f073

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 23:31:17 +08:00
b3f781ba91 fix: vim.ui.input always calls callback #21006
Followup to #20883
Related: #18144

This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `<C-c>`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `<C-c>` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `<Esc>`.
I can think of three good reasons why the behavior should be this way:

1. Easier for the user to understand** It's not intuitive for there to be two
   ways to abort an input dialog that have _different_ outcomes. As a user,
   I would expect any action that cancels the input to leave me in the same
   state. As a plugin author, I see no value in having two possible outcomes for
   aborting the input. I have to handle both cases, but I can't think of
   a situation where I would want to treat one differently than the other.

2. Provides an API that can be overridden by other implementations** The current
   contract of "throw an error upon `<C-c>`" cannot be replicated by async
   implementations of `vim.ui.input`. If the callsite wants to handle the case
   of the user hitting `<C-c>` they need to use `pcall(vim.ui.input, ...)`,
   however an async implementation will instantly return and so there will be no
   way for it to produce the same error-throwing behavior when the user inputs
   `<C-c>`. This makes it impossible to be fully API-compatible with the
   built-in `vim.ui.input`.

3. Provides a useful guarantee to the callsite** As a plugin author, I want the
   guarantee that `on_confirm` will _always_ be called (only catastrophic errors
   should prevent this). If I am in the middle of some async thread of logic,
   I need some way to resume that logic after handing off control to
   `vim.ui.input`. The only way to handle the `<C-c>` case is with `pcall`,
   which as already mentioned, breaks down if you're using an alternative
   implementation.
2022-11-12 06:57:35 -08:00
3621c127a8 Merge pull request #20178 from vigoux/extmark-nospell
feat(extmarks): allow preventing spellchecking with spell = false
2022-11-12 13:14:21 +00:00
07eb4263ca feat(spell): support nospell in treesitter queries 2022-11-12 10:19:03 +00:00
7e6d785d19 feat(extmarks): allow preventing spellchecking with spell = false 2022-11-12 10:19:01 +00:00
7335a67b57 vim-patch:9.0.0845: shell command with just space gives strange error (#21029)
Problem:    Shell command with just space gives strange error.
Solution:   Skip white space at start of the argument. (Christian Brabandt,
            Shane-XB-Qian, closes vim/vim#11515, closes vim/vim#11495)

4e7590ec00

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2022-11-12 12:29:16 +08:00
4d2373f5f6 feat(checkhealth): use "help" syntax, avoid tabpage #20879
- If Nvim was just started, don't create a new tab.
- Name the buffer "health://".
- Use "help" syntax instead of "markdown". It fits better, and
  eliminates various workarounds.
- Simplfy formatting, avoid visual noise.
- Don't print a "INFO" status, it is noisy.
- Drop the ":" after statuses, they are already UPPERCASE and highlighted.
2022-11-11 18:33:31 -08:00
2425fe2dc5 vim-patch:8.2.2207: illegal memory access if popup menu items are changed (#21028)
Problem:    Illegal memory access if popup menu items are changed while the
            menu is visible. (Tomáš Janoušek)
Solution:   Make a copy of the text. (closes vim/vim#7537)

38455a9213

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 09:57:29 +08:00
eee9560516 vim-patch:9.0.0861: solution for "!!sort" in closed fold is not optimal (#21027)
Problem:    Solution for "!!sort" in closed fold is not optimal.
Solution:   Use a different range instead of the subtle difference in handling
            a range with an offset. (issue vim/vim#11487)

9954dc39ea

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 07:43:36 +08:00
0d7cc5ee85 vim-patch:9.0.0715: wrong argument for append() gives two error messages (#21023)
Problem:    Wrong argument for append() gives two error messages.
Solution:   When getting an error for a number argument don't try using it as
            a string. (closes vim/vim#11335)

801cd35e7e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 18:18:38 +08:00
0d8e8d36ec vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal execution (#20998)
Problem:    Assert_fails() setting emsg_silent changes normal execution.
Solution:   Use a separate flag in_assert_fails.

28ee892ac4

Cherry-pick no_wait_return from patch 9.0.0846.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 17:50:52 +08:00
fc7ac688c3 fix(messages): don't set cmdline_row when messages have scrolled (#21015)
When 'cmdheight' is changed while messages have scrolled, the position
of msg_grid is not moved up, so cmdline_row should not be set based on
the position of msg_grid.
2022-11-11 16:46:45 +08:00
ae67706535 vim-patch:9.0.0858: "!!sort" in a closed fold sorts too many lines (#21022)
Problem:    "!!sort" in a closed fold sorts too many lines.
Solution:   Round to end of fold after adding the line count. (closes vim/vim#11487)

f00112d558

N/A patches for version.c:

vim-patch:9.0.0855: comment not located above the code it refers to

Problem:    Comment not located above the code it refers to.
Solution:   Move the comment. (closes vim/vim#11527)

09a93e3e66

vim-patch:9.0.0859: compiler warning for unused variable

Problem:    Compiler warning for unused variable.
Solution:   Add #ifdef.

fd3084b6e2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 10:16:26 +08:00
69507c0204 refactor: move tabline code to statusline.c (#21008)
* refactor: move tabline code to statusline.c

Problem:	Tabline code is closely related to statusline, but still left over in drawscreen.c and screen.c.
Solution:	Move it to statusline.c.

* refactor: add statusline_defs.h
2022-11-10 19:05:16 +08:00
befae73044 vim-patch:76db9e076318 (#21013)
Update runtime files

76db9e0763

- `col()`'s example was changed to use `:echowin` so that the message can be
  seen with `showmode`. Use "\n" to force a hit-enter instead as `:echowin`
  isn't ported.
- Replace interpolated string usage in syntax/modula3.vim (not ported).
- Add a space after the `wincmd =` examples in `*CTRL-W_=*` so that the inlined
  code is highlighted properly when followed by a full stop.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-10 09:05:25 +00:00
61d152779d docs(treesitter): fix predicate syntax (#21016) 2022-11-10 09:12:28 +01:00
04c73dbedb revert: "oldtests: win: fix buffer pathsep" (#21017)
This reverts commit 40e894f595.

No longer needed after #10679
2022-11-10 13:38:17 +08:00
0faf007a23 fix(man.lua): use env command (#21007)
Previously man.lua would use the `env` field in the parameters of
`vim.loop.spawn` to override things like MANPAGER. This caused issues on
NixOS since `spawn` will _override_ the environment rather than _append_
to it (and NixOS relies on a heavily modified environment). Using the
`env` command to append to the environment solves this issue.
2022-11-09 23:26:02 +00:00
ef1d291f29 fix(clipboard): update version regex pattern (#21012)
Building tmux from source uses a 'next-' prefix, so account for that.
Also handle failures to match more gracefully.
2022-11-09 16:21:54 -07:00
a122406be4 docs: swap CursorLineFold and CursorLineSign (#20875) 2022-11-10 06:34:02 +08:00
f2857dcd5a fix(messages): reset msg_grid_scroll_discount when redrawing (#21000) 2022-11-10 06:16:54 +08:00
fae7540732 Merge pull request #20821 from dundargoc/refactor/clang-tidy
refactor: fix clang-tidy warnings
2022-11-08 09:48:48 +01:00
d187c00faf refactor: remove stray emsg check after #20992 (#20996) 2022-11-08 08:41:49 +08:00
59ff4691f6 fix(vim.ui.input): return empty string when inputs nothing (#20883)
fix(vim.ui.input): return empty string when inputs nothing

The previous behavior of `vim.ui.input()` when typing <CR> with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.

Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.
2022-11-08 08:15:15 +08:00
8147d3df28 vim-patch:9.0.0844: handling 'statusline' errors is spread out (#20992)
Problem:    Handling 'statusline' errors is spread out.
Solution:   Pass the option name to the lower levels so the option can be
            reset there when an error is encountered. (Luuk van Baal,
            closes vim/vim#11467)

7b224fdf4a
2022-11-08 07:21:22 +08:00
050b0e30b9 vim-patch:9.0.0843: VHS tape files are not recognized (#20995)
Problem:    VHS tape files are not recognized.
Solution:   Add a filetype pattern. (Carlos Alexandro Becker, closes vim/vim#11452)

1756f4b218

Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-07 22:28:28 +01:00
059dfda0ca Merge pull request #20991 from famiu/feat/api/nvim_cmd/command-name
feat(api): add command name to Lua command callback opts
2022-11-07 18:00:21 +01:00
c022140ec6 feat(api): add command name to Lua command callback opts
Adds a `name` key to the opts dict passed to Lua command callbacks
created using `nvim_create_user_command()`. This is useful for when
multiple commands use the same callback.

Note that this kind of behavior is not as strange as one might think,
even some internal Neovim commands reuse the same internal C function,
differing their behavior by checking the command name. `substitute`,
`smagic` and `snomagic` are examples of that.

This will also be useful for generalized Lua command preview functions
that can preview a wide range of commands, in which case knowing the
command name is necessary for the preview function to actually be able
to execute the command that it's supposed to preview.
2022-11-07 22:27:37 +06:00
894c59ec1f test(old): make Test_help_tagjump() test order match upstream 2022-11-07 21:08:47 +08:00
451b8d6cb1 Merge pull request #20990 from zeertzjq/vim-8.2.2060
vim-patch:8.2.{2060,3626}
2022-11-07 20:13:39 +08:00
3435cdfb94 refactor(highlight): rename FloatBorderTitle #20988
requested in https://github.com/neovim/neovim/pull/20184
2022-11-07 04:02:00 -08:00
609c0513ca vim-patch:8.2.3626: "au! event" cannot be followed by another command
Problem:    "au!" and "au! event" cannot be followed by another command as
            documented.
Solution:   When a bar is found set nextcmd.

b8e642f7ac

Cherry-pick do_autocmd() "eap" argument from patch 8.2.3268.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 19:52:39 +08:00
a6f972cb6a vim-patch:8.2.2060: check for features implemented with "if"
Problem:    Check for features implemented with "if".
Solution:   Use the Check commands. (Ken Takata, closes vim/vim#7383)

aeb313f355

Cherry-pick test_compiler.vim changes from patch 8.1.2373.
2022-11-07 19:46:44 +08:00
31ffc360f2 docs(news): add linematch (#20927) 2022-11-07 10:22:16 +00:00
bdb98de2d1 refactor: more clint (#20910) 2022-11-07 10:21:44 +00:00
e9c1cb71f8 Merge pull request #20987 from zeertzjq/vim-8.2.3751
vim-patch:8.2.{3735,3751,3756,3758,3788,3792}
2022-11-07 14:49:53 +08:00
2ed2c04aa5 docs(options): remove mentions of 'imactivatefunc' and 'imstatusfunc' 2022-11-07 14:25:32 +08:00
be19990f30 vim-patch:8.2.3792: setting *func options insufficiently tested
Problem:    Setting *func options insufficiently tested.
Solution:   Impove tests. (Yegappan Lakshmanan, closes vim/vim#9337)

04ef1fb13d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
c00d241981 vim-patch:8.2.3788: lambda for option that is a function may be freed
Problem:    Lambda for option that is a function may be garbage collected.
Solution:   Set a reference in the funcref. (Yegappan Lakshmanan,
            closes vim/vim#9330)

6ae8fae869

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
8f9ae52784 vim-patch:8.2.3758: options that take a function insufficiently tested
Problem:    Options that take a function insufficiently tested.
Solution:   Add additional tests and enhance existing tests. (Yegappan
            Lakshmanan, closes vim/vim#9298)

2172bff364

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
d7bd7f13a8 vim-patch:8.2.3756: might crash when callback is not valid
Problem:    might crash when callback is not valid.
Solution:   Check for valid callback. (Yegappan Lakshmanan, closes vim/vim#9293)

4dc24eb5ad

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
42e44d6d33 vim-patch:8.2.3751: cannot assign a lambda to an option that takes a function
Problem:    Cannot assign a lambda to an option that takes a function.
Solution:   Automatically convert the lambda to a string. (Yegappan
            Lakshmanan, closes vim/vim#9286)

6409553b6e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
f91d200c05 vim-patch:8.2.3735: cannot use a lambda for 'imactivatefunc'
Problem:    Cannot use a lambda for 'imactivatefunc'.
Solution:   Add lambda support for 'imactivatefunc' and 'imstatusfunc'.
            (Yegappan Lakshmanan, closes vim/vim#9275)

7645da568c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 14:25:32 +08:00
wzy
b042f6d902 fix(clipboard): prefer xsel #20918
Problem:
xclip is not actively maintained compared to xsel, and it has a bug:

    $ touch a
    $ xsel -ib < a
    $ xsel -ob
    $ xclip -o -selection clipboard
    Error: target STRING not available

Years ago, the situation was reversed.
We originally preferred xsel 46bd3c0f77
but then swapped to xclip 799d9c3215
to work around https://github.com/neovim/neovim/issues/7237#issuecomment-443440633

Solution:
Prefer xsel again.

close #20862
ref #9302
ref https://github.com/astrand/xclip/issues/38
2022-11-06 19:46:58 -08:00
d337814906 feat: ":write ++p" creates parent dirs #20835
- `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if
   they do not exist
    - Note: `:foo ++…` is usually for options. No existing options have
      a single-char abbreviation (presumably by design), so it's safe to
      special-case `++p` here.
- Same for `writefile(…, 'foo/bar/baz.txt', 'p')`
- `BufWriteCmd` can see the ++p flag via `v:cmdarg`.

closes #19884
2022-11-06 19:31:50 -08:00
10fbda508c fix(tutor): failing to get buf name #20933
Error detected while processing function tutor#TutorCmd[38]..BufReadPost Autocommands for "*":
    Error executing lua callback: ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: Error ex
    ecuting lua: ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:22: Vim(let):E158: Invalid bu
    ffer name: .
    stack traceback:
            [C]: in function 'nvim_cmd'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:22: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:21>
            [C]: in function 'nvim_buf_call'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:10>
    stack traceback:
            [C]: in function 'nvim_buf_call'
            ...llar/neovim/HEAD-cc5b736/share/nvim/runtime/filetype.lua:21: in function <...llar/neovim/HE
    AD-cc5b736/share/nvim/runtime/filetype.lua:10>


Closes https://github.com/neovim/neovim/issues/20920
2022-11-06 19:18:30 -08:00
9f125371e0 refactor: click definition functions #20923
Need this part of `win_redr_custom()` in `drawline.c` for #20621.
Another refactor is pending in https://github.com/vim/vim/pull/11467
2022-11-06 19:10:09 -08:00
ce198102bd ci: add stale bot #20884
Stale strategy is to never automatically stale anything. Only mark stale
issues or PRs if they get the `needs:response` label. In that case close
after 30 days if there hasn't been any activity.
2022-11-06 19:05:51 -08:00
4fd876271a vim-patch:9.0.0756 #20680
Problem:    No autocmd event for changing text in a terminal window.
Solution:   Add TextChangedT. (Shougo Matsushita, closes vim/vim#11366)

4ccaedfcd7
2022-11-06 19:02:29 -08:00
c4f3d41d6b ci: install only necessary dependencies #20970 2022-11-06 17:35:27 -08:00
72f8613e97 fix(ui-ext): correct message kind in history before vim.ui_attach() 2022-11-07 10:20:27 +09:00
8045296e8b fix(stdpath): default to /tmp if stdpath('run') cannot be created #20952
Fix #20949
2022-11-06 17:08:25 -08:00
d6497c33b7 Merge pull request #20944 from zeertzjq/vim-8.2.3705
vim-patch:8.2.{3665,3705,3712,3725},9.0.{0246,0389}
2022-11-07 08:51:54 +08:00
897186f409 ci: request reviewers when PR is reopened #20972 2022-11-06 16:42:59 -08:00
84881674fd vim-patch:9.0.0389: crash when 'tagfunc' closes the window
Problem:    Crash when 'tagfunc' closes the window.
Solution:   Bail out when the window was closed.

ccfde4d028

Add docs for E1299 from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
595f7f37a9 vim-patch:9.0.0246: using freed memory when 'tagfunc' deletes the buffer
Problem:    Using freed memory when 'tagfunc' deletes the buffer.
Solution:   Make a copy of the tag name.

adce965162

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
1e4adf4b56 vim-patch:8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Problem:    Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution:   Implement lambda support. (Yegappan Lakshmanan, closes vim/vim#9257)
8658c759f0

Comment out Vim9 script in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
1508618d4c vim-patch:8.2.3712: cannot use Vim9 lambda for 'tagfunc'
Problem:    Cannot use Vim9 lambda for 'tagfunc'.
Solution:   Make it work, add more tests. (Yegappan Lakshmanan, closes vim/vim#9250)
05e59e3a9f

Omit Vim9 script in code and comment out in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
b3e9010f47 vim-patch:8.2.3705: cannot pass a lambda name to function() or funcref()
Problem:    Cannot pass a lambda name to function() or funcref(). (Yegappan
            Lakshmanan)
Solution:   Handle a lambda name differently.

eba3b7f664

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 08:24:48 +08:00
900dd2bdab vim-patch:8.2.3665: cannot use a lambda for 'tagfunc'
Problem:    Cannot use a lambda for 'tagfunc'.
Solution:   Use 'tagfunc' like 'opfunc'. (Yegappan Lakshmanan, closes vim/vim#9204)
19916a8c89

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 08:24:48 +08:00
9b9f84bc62 Merge pull request #20982 from zeertzjq/vim-8.2.2849
vim-patch:8.2.{2849,2856,2873}: buffer writing tests
2022-11-07 07:58:37 +08:00
7e1d9c560b vim-patch:8.2.2873: not enough tests for writing buffers
Problem:    Not enough tests for writing buffers.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8229)

46aa6f93ac

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 07:33:59 +08:00
bdf87efeb5 vim-patch:8.2.2856: get readonly error for device that can't be written to
Problem:    Get readonly error for device that can't be written to.
Solution:   Check for being able to write first. (closes vim/vim#8205)

50157ef1c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-07 07:33:59 +08:00
b0190f4543 vim-patch:8.2.2849: bufwrite not sufficiently tested
Problem:    Bufwrite not sufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8192)

36f96a5151

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-07 07:33:58 +08:00
3b3611a3d0 vim-patch:9.0.0841: deletebufline() does not always return 1 on failure (#20980)
Problem:    deletebufline() does not always return 1 on failure.
Solution:   Refactor the code to make it work more predictable. (closes vim/vim#11511)

7af3ee2b83
2022-11-07 07:03:31 +08:00
08d53633d4 Merge pull request #20968 from zeertzjq/vim-8.2.2570
vim-patch:8.2.{2570,2623,2627,4495}: tests fail when run as root
2022-11-07 06:18:16 +08:00
16eed6e766 fix: add lfs to luarc.json (#20979)
The sumneko lua language server keeps prompting me if I want to
"configure my workspace for lfs". These changes suppress that prompt.
2022-11-06 14:31:54 -07:00
8c454776f8 vim-patch:8.2.4495: help test fails in 24 line terminal
Problem:    Help test fails in 24 line terminal.
Solution:   Use up to 23 lines for text.

e4e1a1e1c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
bfa0be49ed vim-patch:8.2.2627: no need to check for BSD after checking for not root
Problem:    No need to check for BSD after checking for not root.
Solution:   Remove CheckNotBSD. (Ozaki Kiichi, closes vim/vim#7989)

4355894869
2022-11-06 23:08:40 +08:00
fbe2761b20 vim-patch:8.2.2623: some tests fail when run as root
Problem:    Some tests fail when run as root.
Solution:   Use CheckNotRoot.

17709e280a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
df71537a12 vim-patch:8.2.2570: tests fail when run as root
Problem:    Tests fail when run as root.
Solution:   Add a comment mentioning the expected failure. (issue vim/vim#7919)

f9a65505d1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 23:08:40 +08:00
de500095b1 vim-patch:8.2.2592: code coverage could be improved (#20969)
Problem:    Code coverage could be improved.
Solution:   Add a few more tests. (Dominique Pellé, closes vim/vim#7957)

6fd367a97c

Test case in test_viminfo.vim is applicable.
2022-11-06 23:07:57 +08:00
728c69bc8d vim-patch:8.2.1340: some tests fail on Cirrus CI and/or with FreeBSD (#20967)
Problem:    Some tests fail on Cirrus CI and/or with FreeBSD.
Solution:   Make 'backupskip' empty. Do not run tests as root. Check for
            directory when using viminfo. (Ozaki Kiichi, closes vim/vim#6596)

b86abadf87
2022-11-06 22:13:36 +08:00
da0fb43849 vim-patch:8.1.1200: old style comments in debugger source
Problem:    Old style comments in debugger source.
Solution:   Use new style comments. (Yegappan Lakshmanan, closes vim/vim#4286)

31fc39e47b
2022-11-06 21:56:37 +08:00
f3cea06d01 test(old): remove stray test42 files (#20966)
Forgot to remove in #17350.
2022-11-06 20:22:37 +08:00
1af4bd04f9 feat(ui): add support to display a title in the border of a float (#20184)
add "title" and "title_pos" keys to win config dict.
2022-11-06 11:59:43 +01:00
731cdde28e refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning.

Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
2022-11-06 11:44:10 +01:00
a79d28e4d7 vim-patch:9.0.0265: no good reason why the "gf" command isn't in the tiny version (#20964)
Problem:    No good reason why the "gf" command is not in the tiny version.
Solution:   Graduate the file_in_path feature.

f80f40a55c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 17:58:13 +08:00
c30226c28b Merge pull request #20962 from zeertzjq/vim-8.2.1736
vim-patch:8.2.{1736,3719,3744}
2022-11-06 17:11:25 +08:00
70843631fe vim-patch:8.2.3744: E854 is not tested; some spelling suggestions are not tested
Problem:    E854 is not tested; some spelling suggestions are not tested.
Solution:   Add a couple of tests. (Dominique Pellé, closes vim/vim#9279)

f645ee47c8

Add missing Test_signcolumn() from patch 7.4.2201.

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-11-06 16:49:17 +08:00
7add38233e vim-patch:8.2.3719: MS-Windows: test sometimes runs into existing swap file
Problem:    MS-Windows: test sometimes runs into existing swap file.
Solution:   Use a different file name.

f8bc0ce267

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 16:49:16 +08:00
cac576322d vim-patch:8.2.1736: failure to compile a pattern not tested much
Problem:    Failure to compile a pattern not tested much.
Solution:   Add tests where a pattern fails to compile. (Yegappan Lakshmanan,
            closes vim/vim#7004)

531be47ac5
2022-11-06 16:49:11 +08:00
c6af296cf8 Merge pull request #20961 from zeertzjq/vim-8.2.3055
vim-patch:8.2.3055,9.0.0355
2022-11-06 15:36:15 +08:00
ed01ef7fa5 vim-patch:9.0.0355: check for uppercase char in autoload name is wrong
Problem:    Check for uppercase char in autoload name is wrong, it checks the
            name of the script.
Solution:   Remove the check. (closes vim/vim#11031)

6c667bdc94

Co-authored-by: thinca <thinca@gmail.com>
2022-11-06 15:13:49 +08:00
7404c6010d vim-patch:8.2.3055: strange error for assigning to "x.key" on non-dictionary
Problem:    Strange error for assigning to "x.key" on non-dictionary.
Solution:   Add a specific error message. (closes vim/vim#8451)

3a3b10e87a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 15:13:45 +08:00
95c862095f refactor(eval): make get_lval() explicitly check for v:lua
Needed for Vim patch 8.2.3055.
2022-11-06 15:13:42 +08:00
850d7146fc fix(paste): feed keys as typed in cmdline mode (#20959) 2022-11-06 12:43:05 +08:00
eb55eba7e5 Merge pull request #20955 from zeertzjq/vim-8.2.2918
vim-patch:8.2.{2918,2920,2921},9.0.0836: variable can shadow builtin function
2022-11-06 11:16:54 +08:00
d4353c3645 vim-patch:9.0.0836: wrong error when using extend() with funcref
Problem:    Wrong error when using extend() with funcref.
Solution:   Better check the variable type. (closes vim/vim#11468, closes vim/vim#11455)

91c75d18d9
2022-11-06 10:01:50 +08:00
4740672b37 vim-patch:8.2.2921: E704 for script local variable is not backwards compatible
Problem:    E704 for script local variable is not backwards compatible.
            (Yasuhiro Matsumoto)
Solution:   Only give the error in Vim9 script.  Also check for function-local
            variable.

b54abeeafb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 10:01:50 +08:00
6b3db3f929 vim-patch:8.2.2920: still a way to shadow a builtin function
Problem:    Still a way to shadow a builtin function. (Yasuhiro Matsumoto)
Solution:   Check the key when using extend(). (issue vim/vim#8302)

6f1d2aa437

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 10:01:50 +08:00
7683199a9b vim-patch:8.2.2918: builtin function can be shadowed by global variable
Problem:    Builtin function can be shadowed by global variable.
Solution:   Check for builtin function before variable. (Yasuhiro Matsumoto,
            closes vim/vim#8302)

3d9c4eefe6

Cherry-pick Test_gettext() from patch 8.2.2886.
2022-11-06 10:01:50 +08:00
dc17df3190 fix(eval): change some tv_dict_add() usages back to hash_add()
Needed for Vim patch 8.2.2920.
2022-11-06 10:01:20 +08:00
be90bfbb00 Merge pull request #20954 from zeertzjq/vim-8.2.2918
vim-patch:8.2.{1274,1306,2722,2723,3016}: eval error message improvements
2022-11-06 08:53:24 +08:00
7d7208a88b vim-patch:8.2.3016: confusing error when expression is followed by comma
Problem:    Confusing error when expression is followed by comma.
Solution:   Give a different error for trailing text. (closes vim/vim#8395)

fae55a9cb0

Omit test_eval_stuff.vim and test_viminfo.vim: changes tests are N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 08:21:17 +08:00
fa2ed8ca1f vim-patch:8.2.2723: assignment test fails
Problem:    Assignment test fails.
Solution:   Adjust error number.

58fb7c39a0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 08:21:17 +08:00
a208a8b10e vim-patch:8.2.2722: Vim9: crash when using LHS with double index
Problem:    Vim9: crash when using LHS with double index.
Solution:   Handle lhs_dest which is "dest_expr". (closes vim/vim#8068)
            Fix confusing error message for missing dict item.

b9c0cd897a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 08:21:17 +08:00
1f0bf65ad6 vim-patch:8.2.1306: checking for first character of dict key is inconsistent
Problem:    Checking for first character of dict key is inconsistent.
Solution:   Add eval_isdictc(). (closes vim/vim#6546)

b13ab99908

Omit handle_subscript() change: only affects Vim9 script.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 08:21:17 +08:00
e03f23189d vim-patch:8.2.1274: Vim9: no error for missing white space at script level
Problem:    Vim9: no error for missing white space in assignment at script
            level.
Solution:   Check for white space. (closes vim/vim#6495)

63be3d4ba0

Cherry-pick Test_let_errors() change from patch 8.2.0633.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 08:21:08 +08:00
5b8d8a4c99 docs(news): add news blurb for tmux clipboard change (#20950) 2022-11-05 16:48:13 -06:00
a966347cab ci: replace deprecated feature set-output (#20834)
The new recommended way to share values between Github Actions steps is
to use environment files:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
2022-11-05 23:22:39 +01:00
9a52a8e1ec ci: remove ci/build.ps1 (#20891)
Main benefit is that this will return the correct exit code by default,
meaning the lengthy workarounds to properly fail a test aren't needed.
2022-11-05 22:57:11 +01:00
83ea9e23a2 vim-patch:9.0.0835: the window title is not redrawn when 'endoffile' changes (#20951)
Problem:    The window title is not redrawn when 'endoffile' changes.
Solution:   redraw the window title when 'endoffile' is changed. (Ken Takata,
            closes vim/vim#11488)

845bbb72ed

Co-authored-by: K.Takata <kentkt@csc.jp>
2022-11-06 05:47:57 +08:00
27ff59fb07 ci: fix incorrect asan_symbolize name (#20900) 2022-11-05 22:29:44 +01:00
01ff681f57 Merge pull request #20858 from dundargoc/build/lintsh
build: add more shell scripts to the `lintsh` target
2022-11-05 22:11:22 +01:00
5723b19210 revert: "ci(commitlint): use pull_request_target to avoid "skip ci"" (#20845)
This reverts commit d7e2229b41.

This workflow isn't required to pass to merge a PR any more. Using
pull_request_target to bypass the required check when using [skip ci] is
therefore no longer needed.
2022-11-05 22:09:50 +01:00
8765c7e288 Merge pull request #20732 from dundargoc/build/default-cmake-args
build: refactor cmake files
2022-11-05 22:07:25 +01:00
d5dd7573f3 vim-patch:8.2.3713: MS-Windows: no error if vimgrep pattern is not matching (#20947)
Problem:    MS-Windows: No error message if vimgrep pattern is not matching.
Solution:   Give an error message. (Christian Brabandt, closes vim/vim#9245,
            closes vim/vim#8762)

0b226f60be

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-11-06 05:02:57 +08:00
19729e2136 Merge pull request #20946 from zeertzjq/vim-8.2.1106
vim-patch:8.2.{0883,1106,1366,1383,1417}: Vim script tests
2022-11-05 21:58:18 +08:00
13381692cd vim-patch:8.2.1417: test 49 is old style
Problem:    Test 49 is old style.
Solution:   Convert more parts to new style test. (Yegappan Lakshmanan,
            closes vim/vim#6682)

efb6482949
2022-11-05 21:38:36 +08:00
8d6a217b9a vim-patch:8.2.1383: test 49 is old style
Problem:    Test 49 is old style.
Solution:   Convert test cases to new style. (Yegappan Lakshmanan,
            closes vim/vim#6638)

9470a4d88a

Cherry-pick AssertException() from patch 8.2.1146.
2022-11-05 21:38:36 +08:00
42e7c7fc9c vim-patch:8.2.1366: test 49 is old style
Problem:    Test 49 is old style.
Solution:   Convert several tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#6629)

a6296200bd
2022-11-05 21:38:36 +08:00
01ccfb40e3 vim-patch:8.2.1106: crash when trying to use s: variable in typed command
Problem:    Crash when trying to use s: variable in typed command.
Solution:   Don't use the script index when not set. (Ken Takata,
            closes vim/vim#6366)

8e6cbb7232
2022-11-05 21:38:36 +08:00
cb8bc9b33c vim-patch:8.2.0883: memory leak in test 49
Problem:    Memory leak in test 49.
Solution:   Free "sfile" from the exception.

5fbf3bc3f9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 21:38:29 +08:00
43681f2375 Merge pull request #17950 from zeertzjq/vim-8.2.4029
vim-patch:8.2.{4029,4093,4100,4501,4882}: breakindent patches
2022-11-05 19:57:15 +08:00
e0ec83a970 vim-patch:8.2.4882: cannot make 'breakindent' use a specific column
Problem:    Cannot make 'breakindent' use a specific column.
Solution:   Add the "column" entry in 'breakindentopt'. (Christian Brabandt,
            closes vim/vim#10362, closes vim/vim#10325)

e7d6dbc572

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-11-05 19:35:56 +08:00
6374120558 vim-patch:8.2.4501: with 'showbreak' set cursor displayed in wrong position
Problem:    With 'showbreak' set and after the end of the line the cursor
            may be displayed in the wrong position.
Solution:   Do not apply 'showbreak' after the end of the line. (closes vim/vim#9884)

21efafe4c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 19:35:56 +08:00
8b43091392 vim-patch:8.2.4100: early return when getting the 'formatlistpat' value
Problem:    Early return when getting the 'formatlistpat' value.
Solution:   Remove the first line. (Christian Brabandt)
04b871da80
2022-11-05 19:35:56 +08:00
b92ed35a0b vim-patch:8.2.4093: cached breakindent values not initialized properly
Problem:    Cached breakindent values not initialized properly.
Solution:   Initialize and cache formatlistpat. (Christian Brabandt,
            closes vim/vim#9526, closes vim/vim#9512)
c53b467473

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-11-05 19:35:56 +08:00
3e60b9f1cc vim-patch:8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Problem:    Debugging NFA regexp my crash, cached indent may be wrong.
Solution:   Fix some debug warnings in the NFA regexp code.  Make sure log_fd
            is set when used.  Fix breakindent and indent caching. (Christian
            Brabandt, closes vim/vim#9482)
b2d85e3784
2022-11-05 19:35:56 +08:00
da90be2308 build: always ignore user's cmake preset (#20935) 2022-11-05 12:31:15 +01:00
921101e076 Merge pull request #20774 from zeertzjq/vim-8.2.4679
vim-patch:8.2.{1506,1600,1624,1626,1751,2606,4679}
2022-11-05 18:51:03 +08:00
3c0651fb45 fix(eval): make error number of charidx() same as Vim 2022-11-05 18:06:00 +08:00
8e868d699a vim-patch:8.2.4679: cannot have expandcmd() give an error message for mistakes
Problem:    Cannot have expandcmd() give an error message for mistakes.
Solution:   Add an optional argument to give errors. Fix memory leak when
            expanding files fails. (Yegappan Lakshmanan, closes vim/vim#10071)
2b74b6805b

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-05 18:06:00 +08:00
781616bee5 vim-patch:8.2.2606: strchars() defaults to counting composing characters
Problem:    strchars() defaults to counting composing characters.
Solution:   Add strcharlen() which ignores composing characters.

70ce8a1561

Use docs from latest Vim instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
451850920b vim-patch:8.2.1626: test for strchars() fails with different error number
Problem:    Test for strchars() fails with different error number.
Solution:   Adjust the error number.

707be5f352

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
d857569dbd vim-patch:8.2.1624: Vim9: cannot pass "true" to split(), str2nr() and strchars()
Problem:    Vim9: cannot pass "true" to split(), str2nr() and strchars().
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6884, closes vim/vim#6885, closes vim/vim#6886)

3986b94b09

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
38c113ae84 vim-patch:8.2.1600: Vim9: cannot use "true" with deepcopy()
Problem:    Vim9: cannot use "true" with deepcopy().
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6867)

44b4a246b6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
e25193143b vim-patch:8.2.1751: using 2 where bool is expected may throw an error
Problem:    Using 2 where bool is expected may throw an error.
Solution:   Make this backwards compatible.

bade44e5ca

In legacy Vim script get_bool functions do the same thing as get_number
functions, so just add aliases using #define.

N/A patches for version.c:

vim-patch:8.2.1506: Vim9: no error when using a number other than 0 or 1 as bool

Problem:    Vim9: no error when using a number other than 0 or 1 as bool.
Solution:   Check the number is 0 or 1.

d70840ed68

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:06:00 +08:00
562d572926 vim-patch:8.1.1949: cannot scroll a popup window to the very bottom
Problem:    Cannot scroll a popup window to the very bottom.
Solution:   Scroll to the bottom when the "firstline" property was set to -1.
            (closes vim/vim#4577)  Allow resetting min/max width/height.
8c6173c7d3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 18:05:59 +08:00
1bcddd5b53 Merge pull request #20943 from zeertzjq/vim-8.2.4688
vim-patch:8.2.{4688,4693,4978},9.0.0053: regexp fixes
2022-11-05 16:32:58 +08:00
e33ffab1a7 vim-patch:9.0.0053: E1281 not tested with the old regexp engine
Problem:    E1281 not tested with the old regexp engine.
Solution:   Loop over the values of 'regexp'. (Dominique Pellé, closes vim/vim#10695)

3a393790a4

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-11-05 16:09:22 +08:00
b84666d2a0 vim-patch:8.2.4978: no error if engine selection atom is not at the start
Problem:    No error if engine selection atom is not at the start.
Solution:   Give an error. (Christian Brabandt, closes vim/vim#10439)

360da40b47

Co-authored-by: Christian Brabandt <cb@256bit.org>
2022-11-05 16:09:22 +08:00
77e25e56d8 vim-patch:8.2.4693: new regexp does not accept pattern "\%>0v"
Problem:    new regexp does not accept pattern "\%>0v".
Solution:   Do accept digit zero.

72bb10df1f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 16:09:22 +08:00
78e69412ac vim-patch:8.2.4688: new regexp engine does not give an error for "\%v"
Problem:    New regexp engine does not give an error for "\%v".
Solution:   Check for a value argument. (issue vim/vim#10079)

91ff3d4f52

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 16:09:21 +08:00
45a3e7f669 Merge pull request #20942 from zeertzjq/vim-8.2.5027
vim-patch:8.2.{3252,3919,5027}
2022-11-05 15:14:09 +08:00
30cfdd0ea1 vim-patch:8.2.5027: error for missing :endif when an exception was thrown
Problem:    Error for missing :endif when an exception was thrown. (Dani
            Dickstein)
Solution:   Do not give an error when aborting. (closes vim/vim#10490)

bf79a4e48d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 14:44:26 +08:00
48405df046 vim-patch:8.2.3919: Vim9: wrong argument for append() results in two errors
Problem:    Vim9: wrong argument for append() results in two errors.
Solution:   Check did_emsg.  Also for setline().  Adjust the help for
            appendbufline().

8b6256f6ec

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 14:44:26 +08:00
5731f406fa vim-patch:8.2.3252: duplicated code for adding buffer lines
Problem:    Duplicated code for adding buffer lines.
Solution:   Move code to a common function.  Also move map functions to map.c.
            (Yegappan Lakshmanan, closes vim/vim#8665)

4a15504e91

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-05 14:38:24 +08:00
86fe2c8d94 Merge pull request #20941 from zeertzjq/vim-8.2.1183
vim-patch:8.2.{partial:1183,1184,1199,1479,1484,1631,1632}: assert_fails() patches
2022-11-05 14:17:06 +08:00
6956971ec7 vim-patch:8.2.1632: not checking the context of test_fails()
Problem:    Not checking the context of test_fails().
Solution:   Add the line number and context arguments.  Give error if
            assert_fails() argument types are wrong.

44d6652d56

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:47:25 +08:00
02f80d9a8a vim-patch:8.2.1631: test_fails() does not check the context of the line number
Problem:    test_fails() does not check the context of the line number.
Solution:   Use another argument to specify the context of the line number.

9bd5d879c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:45:43 +08:00
8ba7a966a1 vim-patch:8.2.1484: flaky failure in assert_fails()
Problem:    Flaky failure in assert_fails().
Solution:   Only used fourth argument if there is a third argument.

9b02d64cff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:41:20 +08:00
0d8293364f vim-patch:8.2.1479: Vim9: error for list index uses wrong line number
Problem:    Vim9: error for list index uses wrong line number.
Solution:   Set source line number. (closes vim/vim#6724)  Add a way to assert the
            line number of the error with assert_fails().

1d634542cf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:41:20 +08:00
b33de61cc3 vim-patch:8.2.1199: not all assert functions are fully tested
Problem:    Not all assert functions are fully tested.
Solution:   Test more assert functions.

7177da9dd4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:31:31 +08:00
159d52b433 vim-patch:8.2.1184: some tests fail
Problem:    Some tests fail.
Solution:   Adjust tests for different assert_fails() behavior.  Remove unused
            variable.

2b6ef856fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:27:56 +08:00
8b0c5de4e0 vim-patch:partial:8.2.1183: assert_fails() checks the last error message
Problem:    assert_fails() checks the last error message.
Solution:   Check the first error, it is more relevant.  Fix all the tests
            that rely on the old behavior.

9b7bf9e98f

Skip test_listener.vim, test_textprop.vim, test_viminfo.vim.
Skip test_python2.vim: affected line fails and hasn't been ported.
Skip test_python3.vim: affected lines fail and haven't been ported.
Skip CHECK_LIST_MATERIALIZE.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 12:27:45 +08:00
a86295cd5c vim-patch:8.2.0615: regexp benchmark stest is old style (#20940)
Problem:    Regexp benchmark stest is old style.
Solution:   Make it a new style test.  Fix using a NULL list.  Add more tests.
            (Yegappan Lakshmanan, closes vim/vim#5963)

ad48e6c159

N/A patches:
vim-patch:9.0.0829: wrong counts in macro comment
2022-11-05 12:26:17 +08:00
daf9a63d67 version.c: update [skip ci] (#20825)
N/A patches:
vim-patch 9.0.0829: wrong counts in macro comment
2022-11-05 12:20:14 +08:00
5004805156 Merge pull request #20939 from zeertzjq/vim-8.2.0502
vim-patch:8.2.{0502,0612}
2022-11-05 12:00:26 +08:00
199c7c2898 vim-patch:8.2.0612: Vim9: no check for space before #comment
Problem:    Vim9: no check for space before #comment.
Solution:   Add space checks.

2c5ed4e330

Omit ends_excmd2(): the same as ends_excmd() in legacy Vim script.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 11:36:22 +08:00
45ca7d4a62 vim-patch:8.2.0502: Vim9: some code is not tested
Problem:    Vim9: some code is not tested.
Solution:   Add more tests.  Fix uncovered problems.

e8c4abbbd7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05 11:27:17 +08:00
81722896e4 feat(clipboard): copy to system clipboard in tmux when supported (#20936)
Since version 3.2 tmux has had the ability to read/write buffer contents
from/to the system clipboard, if the underlying terminal emulator
supports it. Enable this feature when we can detect that tmux supports
it.
2022-11-04 20:43:11 -06:00
5e86cf6c13 Merge pull request #20938 from zeertzjq/vim-8.2.0644
vim-patch:8.2.{0433,0644,0866,0958}: various tests
2022-11-05 09:49:52 +08:00
b002499c19 vim-patch:8.2.0958: not sufficient testing for buffer writing
Problem:    Not sufficient testing for buffer writing.
Solution:   Add a few tests. (Yegappan Lakshmanan, closes vim/vim#6238)

1de5f7c81d
2022-11-05 09:25:31 +08:00
40ca9b9528 vim-patch:8.2.0866: not enough tests for buffer writing
Problem:    Not enough tests for buffer writing.
Solution:   Add more tests. Use CheckRunVimInTerminal in more places.
            (Yegappan Lakshmanan, closes vim/vim#6167)

494e9069cb
2022-11-05 09:25:31 +08:00
e30929cda5 vim-patch:8.2.0644: insufficient testing for invalid function arguments
Problem:    Insufficient testing for invalid function arguments.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5988)

99fa721944

Omit test_listener.vim: changed again in patch 8.2.1183.
Omit test_textprop.vim: changed again in patch 8.2.1183.
Cherry-pick quickfix feature checks from patch 8.1.2373.
Omit Test_saveas() change: duplicate and removed in patch 8.2.0866.
2022-11-05 09:25:31 +08:00
b7b4914fe4 vim-patch:8.2.0433: INT signal not properly tested
Problem:    INT signal not properly tested.
Solution:   Add a test.  Also clean up some unnecessary lines. (Dominique
            Pelle, closes vim/vim#5828)

bad8804cdd
2022-11-05 09:25:31 +08:00
19a487bc86 fix(fileio): use first available directory in backupdir for backupcopy (#20655)
Fix backups failing for symlink files

Set backup to NULL prior to continuing & Clear backup prior to NULL set
to avoid leaking

Fixes #11349

Remove testing hacks in scripts for windows

Skip FreeBSD

Something appears up with these types of tests for FreeBSD on
Circus, see 2d6735d8ce
2022-11-05 09:24:34 +08:00
95f2f3cb5e fix(vim.diff): fix fastforward off-by-1 (#20937) 2022-11-05 00:58:01 +00:00
234b8c5f3d Merge pull request #20934 from zeertzjq/vim-8.2.0968
vim-patch:8.2.{0968,0976,1022,1810,2901}: various tests
2022-11-04 21:49:43 +08:00
2aafaa5992 vim-patch:8.2.2901: some operators not fully tested
Problem:    Some operators not fully tested.
Solution:   Add a few test cases. (Yegappan Lakshmanan, closes vim/vim#8282)

3e72dcad8b
2022-11-04 20:54:50 +08:00
26a9f786c4 vim-patch:8.2.1810: some code in normal.c not covered by tests
Problem:    Some code in normal.c not covered by tests.
Solution:   Add normal mode tests. (Yegappan Lakshmanan, closes vim/vim#7086)

d7e5e9430a
2022-11-04 20:54:50 +08:00
2476f41a4a vim-patch:8.2.1022: various parts of code not covered by tests
Problem:    Various parts of code not covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6300)

845e0ee594

Omit test_iminsert.vim: the commit that created this file was N/A.
Omit test_viminfo.vim: the added tests are N/A.
2022-11-04 20:54:50 +08:00
2b86ca81b4 vim-patch:8.2.0976: some 'cpoptions' not tested
Problem:    Some 'cpoptions' not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6253)

df7df59d85
2022-11-04 20:54:50 +08:00
32a2c556ab vim-patch:8.2.0968: no proper testing of the 'cpoptions' flags
Problem:    No proper testing of the 'cpoptions' flags.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#6251)

c9630d2658
2022-11-04 20:54:45 +08:00
0aba176171 ci: skip tests if build fails (#20908)
It's currently difficult to pinpoint the cause of a failure since all
tests are run even if the build steps fail. But since the build failed
the test will almost always fail as well as it's dependent on a
successful build, leading to many steps being marked as a failure even
though the real problem was the build step. Even worse, the default
behavior of GitHub Actions is to only automatically show the last failed
step, which is misleading if the build process fails since it'll show
the logs of the failing test step.

An easy solution would be to abort all subsequent steps if any steps
fail. This isn't optimal however, as we want all lint and test failures
to show on a single run instead of prematurely aborting on a single test
step.

We can solve both problems by dividing each job into two phases: the
build/installation phase and the test/lint phase, with a checkmark step
in between. The strategy is simple: if any step before the checkmark
step fails (the build phase), then abort all following steps. If any
step after the checkmark fails (the test phase), then show that test as
failed but continue running all tests.
2022-11-04 13:26:12 +01:00
dce3fc3e9a vim-patch:8.2.0540: regexp and other code not tested (#20930)
Problem:    Regexp and other code not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5904)

004a6781b3
2022-11-04 19:31:58 +08:00
b854f2ce09 fix(vim.diff): correctly apply hunk offsets with linematch (#20931) 2022-11-04 11:12:17 +00:00
f1c864cfe3 fix(diff): remove size_t underflow (#20929) 2022-11-04 10:31:09 +00:00
24fa5f70ed vim-patch:8.2.0448: various functions not properly tested (#20926)
Problem:    Various functions not properly tested.
Solution:   Add more tests, especially for failures. (Yegappan Lakshmanan,
            closes vim/vim#5843)

0e05de4622

Cherry-pick test changes from patch 8.2.0427 and skip Test_has().
Cherry-pick Test_complete_wildmenu() change from patch 8.2.4339.
2022-11-04 18:17:26 +08:00
04fbb1de44 Enable new diff option linematch (#14537)
Co-authored-by: Lewis Russell <me@lewisr.dev>
2022-11-04 09:07:22 +00:00
cc5b7368d6 fix(man.lua): set modifiable before writing page (#20914) 2022-11-03 09:13:29 +08:00
65f603f72c Merge pull request #20782 from dundargoc/docs/typos
docs: fix typos
2022-11-02 22:07:00 +08:00
4716a578ae docs: fix typos 2022-11-02 21:45:26 +08:00
44b88d8c31 Merge pull request #20904 from zeertzjq/vim-9.0.0822
vim-patch:9.0.{0822,0823,0824,0825}: window dragging fixes
2022-11-02 09:06:38 +08:00
419ee612e6 vim-patch:9.0.0825: cannot drag an entry in the tabpage line
Problem:    Cannot drag an entry in the tabpage line.
Solution:   Clear dragwin instead of got_click. (closes vim/vim#11483,
            closes vim/vim#11482)

8e0ccb6bc2

Omit Test_term_mouse_drag_to_move_tab(): covered by ui/mouse_spec.lua.
2022-11-02 08:06:44 +08:00
39f85cdf6b vim-patch:9.0.0824: crash when using win_move_separator() in other tab page
Problem:    Crash when using win_move_separator() in other tab page.
Solution:   Check for valid window in current tab page.
            (closes vim/vim#11479, closes vim/vim#11427)

873f41a018
2022-11-02 08:06:37 +08:00
20bd4d8997 vim-patch:9.0.0823: mouse drag test fails
Problem:    Mouse drag test fails.
Solution:   Only reset the mouse click flag when actually switching to another
            tab page.  Disable test that keeps failing.

7a7db047dc

Omit test_termcodes.vim change: reverted in patch 9.0.0825.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-02 08:06:23 +08:00
a600e73007 vim-patch:9.0.0822: crash when dragging the statusline with a mapping
Problem:    Crash when dragging the statusline with a mapping.
Solution:   Check for valid window pointer. (issue vim/vim#11427)

8ab9ca93ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-02 08:03:44 +08:00
41f308feab vim-patch:9.0.0826: if 'endofline' is set CTRL-Z may be written in a wrong place (#20903)
Problem:    If 'endofline' is set the CTRL-Z may be written in the wrong
            place.
Solution:   Write CTRL-Z at the end of the file.  Update the help to explain
            the possibilities better. (Ken Takata, closes vim/vim#11486)

3af982196b

Co-authored-by: K.Takata <kentkt@csc.jp>
2022-11-02 08:02:52 +08:00
502b5ee10f build(lint): add more shell scripts to lintsh 2022-11-01 18:37:21 +01:00
aeb87f8b4a build: add EXCLUDE option to add_glob_target
EXCLUDE filters out all elements containing regex, meaning it works on
both files and directories.

Also rename add_glob_targets to add_glob_target since only one target is
being created.
2022-11-01 18:34:14 +01:00
b05d1943f0 build(lint): remove clint.py rules for braces #20880
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-11-01 07:39:49 -07:00
582c044dbe build(deps): bump lua parser to v0.0.14 (#20897) 2022-11-01 13:38:47 +01:00
c46d46e9f1 vim-patch:8.2.2343: Vim9: return type of readfile() is any (#20896)
Problem:    Vim9: return type of readfile() is any.
Solution:   Add readblob() so that readfile() can be expected to always
            return a list of strings. (closes vim/vim#7671)

c423ad77ed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-01 20:21:48 +08:00
c3aba403c6 refactor: move do_mouse() and its helpers to mouse.c (#20895)
Vim moved it in patch 8.1.2062, and this is required for patch 9.0.0822.
Also change macros in mouse.h to enums.
2022-11-01 09:14:25 +08:00
d8dbf58b43 vim-patch:9.0.0821: crash with win_move_statusline() in another tabpage (#20894)
vim-patch:86e6717ace4f

Problem:    Crash when using win_move_statusline() in another tab page.
Solution:   Check for valid window pointer. (issue vim/vim#11427)

86e6717ace

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-01 07:29:55 +08:00
428ab6f24e fix(mark): do not restore view in op-pending mode (#20889) 2022-11-01 06:14:20 +08:00
bf3cbee630 Merge pull request #20489 from jpalus/memory-alignment
memory: fix memory alignment for dynamic allocation
2022-10-31 17:10:13 +01:00
8b7247af7d refactor(memory): simplify new alignment logic
In particular, we can assume the xmalloc-ed pointer is at least
double-aligned, otherwise nothing work work.
2022-10-31 11:12:55 +01:00
0240fd6d0f fix(memory): fix memory alignment for dynamic allocation
all pointers returned by arena_alloc residing in arena block should be
properly aligned

to meet neovim's alignment requirements but keeping it simple settle on
ARENA_ALIGN = MAX(sizeof(void *), sizeof(double)).
2022-10-31 09:42:40 +01:00
19dab2ead2 Merge #20873 from justinmk/checkhealth 2022-10-30 11:39:38 -04:00
cc7c378bf3 feat(checkhealth): check runtime ($VIMRUNTIME)
Move man/health.lua into the "runtime" check.

fix #20696
2022-10-30 16:23:58 +01:00
3213bc36c5 refactor(checkhealth): convert "nvim" check to Lua 2022-10-30 15:50:59 +01:00
c7a88a470f feat(checkhealth): improve treesitter report 2022-10-30 15:50:59 +01:00
6e84a46abc ci(stylua): explicitly set the version to latest (#20869)
This will silence the warning about needing to pin the version in the
Summary Page.
2022-10-30 11:08:59 +01:00
e0dff29adc fix(lsp/window_showDocument): correctly handle external resources #20867
- since cmd is a list, it runs directly ('no shell') and we shouldn't
  escape.
- typo: shellerror -> shell_error
2022-10-30 02:35:22 -07:00
cf0f53037c ci(windows): build dependencies with Ninja (#20800)
This will save around a minute of CI time for each run. Also clean up
build.ps1 by removing unnecessary code.
2022-10-30 10:06:13 +01:00
75ec1b7208 Merge pull request #20855 from zeertzjq/vim-fb0cf2357e0c
vim-patch:9.0.{0816,0819}: CTRL-Z at end of file is always dropped
2022-10-30 08:33:29 +08:00
4158ad38ec vim-patch:9.0.0819: still a build error, tests are failing
Problem:    Still a build error, tests are failing.
Solution:   Correct recent changes. Add missing init for 'eof'.

1577537f10

vim-patch:1577537f109d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-30 08:07:56 +08:00
feabc1c98c vim-patch:9.0.0816: CTRL-Z at end of file is always dropped
Problem:    CTRL-Z at end of file is always dropped.
Solution:   Add the 'endoffile' option, like the 'endofline' option.
            (closes vim/vim#11408, closes vim/vim#11397)

Cherry-pick test_fixeol.vim changes from patch 8.2.1432.
Cherry-pick 'endoffile' changes from latest Vim runtime update.

fb0cf2357e

vim-patch:f0b567e32a46

Revert unintended Makefile change

f0b567e32a

vim-patch:72c8e3c070b3

Fix wrong struct access for member.

72c8e3c070

vim-patch:3f68a4136eb9

Add missing entry for the 'endoffile' option.

3f68a4136e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-30 08:07:50 +08:00
8d38e1ad34 build(vim-patch.sh): checkout files with path for uncrustify (#20863) 2022-10-30 08:05:50 +08:00
2817411b7d fix(health): correct tmux rgb verification (#20868)
Current RGB verification parses `tmux server-info`. Despite it being a tmux default alias to `tmux show-messages -JT`, it may be unavailable. Use `tmux show-messages -JT` directly instead.
2022-10-30 07:37:47 +08:00
23080a4d7a fix(mouse): ensure no scrolling with "ver:0" in 'mousescroll' (#20861) 2022-10-30 07:10:39 +08:00
f2d9c330fc fix(path): don't remove trailing slash when getting absolute path (#20853)
Before Vim patch 8.2.3468 relative_directory is never used in the
resulting path name, so whether it has a trailing slash didn't matter.
Now path_full_dir_name() appends a non-existing relative directory to
the current directory name, so the trailing slash needs to be kept.
2022-10-30 07:10:04 +08:00
a7d100f052 fix: avoid unsigned overflow in home_replace() (#20854) 2022-10-30 06:49:39 +08:00
49fbcb5b82 ci: use GHA default clang for asan, tsan jobs #20846
Default is currently clang 14. GHA images are updated at least once per year, so
we don't need to manually install a newer clang version.

Also remove step for installing clang-13 since it's not needed anymore.
2022-10-29 12:11:56 -07:00
1d625a3cf7 build: remove python linting #20851
This includes both the `lintpy` make target and for CI. We're actively
trying to reduce our python usage, so this only seems to give warnings
for unimportant things such as exceeding the line after deleting python
code.
2022-10-29 10:42:10 -07:00
6884f017b5 vim-patch:partial:6ebe4f970b8b (#20860)
Update runtime files

6ebe4f970b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-29 17:41:22 +02:00
356244d50b fix(docs): nil as viable argument for goto_prev (#20852)
Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
2022-10-28 17:13:27 -06:00
49e32cbdf8 Merge pull request #20848 from zeertzjq/vim-8.2.1639
vim-patch:8.2.{1639,1642,1652,1663,1716}: optwin translations
2022-10-29 06:43:44 +08:00
3c0ad25854 vim-patch:8.2.1716: options window has duplicate translations
Problem:    Options window has duplicate translations.
Solution:   Make one entry for "global or local to buffer".  Fix wrong text.
            (closes vim/vim#6983)

b5cfff0b34

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 23:26:41 +08:00
fc6afdcf53 vim-patch:8.2.1663: options window entries cannot be translated
Problem:    Options window entries cannot be translated.
Solution:   Use AddOption() for all explanations. (closes vim/vim#6800)

14944c04bd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 23:26:41 +08:00
4dcc6409a8 vim-patch:8.2.1652: cannot translate lines in the options window
Problem:    Cannot translate lines in the options window.
Solution:   Use the AddOption() function to split descriptions where indicated
            by a line break. (issue vim/vim#6800)

a953b5cf4f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 22:57:44 +08:00
08b1055c09 vim-patch:8.2.1642: otions test fails
Problem:    Otions test fails.
Solution:   Correct call to OptionG().

4507f6ada5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 22:48:59 +08:00
a7912b190d vim-patch:8.2.1639: options window cannot be translated
Problem:    Options window cannot be translated.
Solution:   Get the translation for "local to" texts once and use them in many
            places. Fix that 'whichwrap' is not a local option. (issue vim/vim#6800)

64075b0ab1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 22:48:12 +08:00
d9dce2d955 build: make update-po support optwin.vim (#20840) 2022-10-28 22:35:48 +08:00
60427eb05f fix(diff.c): regression in diffgetput (#20843) 2022-10-28 13:22:10 +01:00
3de2a7f6df Merge pull request #20842 from zeertzjq/vim-8.2.1395
vim-patch:8.2.{1395,3407}
2022-10-28 14:15:49 +08:00
3afcc48a05 vim-patch:8.2.3407: using uninitialized memory with "let g:['bar'] = 2"
Problem:    Using uninitialized memory with "let g:['bar'] = 2".
Solution:   Initialize v_type of a new dict item.

3b31851356

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 13:28:18 +08:00
bfdf10d870 vim-patch:8.2.1395: Vim9: no error if declaring a funcref with lower case letter
Problem:    Vim9: no error if declaring a funcref with a lower case letter.
Solution:   Check the name after the type is inferred. Fix confusing name.

98b4f145eb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 11:44:30 +08:00
685ff3ee72 Merge pull request #20832 from zeertzjq/vim-8.2.1544
vim-patch:8.2.{1544,1585}: cannot translate messages in a Vim script
2022-10-28 11:25:29 +08:00
bbbcd5393d vim-patch:8.2.1585: messages in globals.h not translated
Problem:    Messages in globals.h not translated, xgettext on MS-Windows not
            fully supported.
Solution:   Add globals.h to list of input files.  Update MS-Windows makefiles
            to improve message translations. (Ken Takata, closes vim/vim#6858)

fa57335e53

Also update gettext() docs to match latest Vim.
2022-10-28 08:04:57 +08:00
5568267ccb vim-patch:8.2.1544: cannot translate messages in a Vim script
Problem:    Cannot translate messages in a Vim script.
Solution:   Add gettext().  Try it out for a few messages in the options
            window.

0b39c3fd4c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-28 08:03:31 +08:00
f44ad75380 docs(api): pattern is not expanded for autocommands (#20812)
Problem: Unlike `:autocmd`, `nvim_create_autocommand()` does not expand
environment variables in the `pattern`, which is unexpected.

Solution: Add a note to the documentation explaining this and suggesting
using `expand()` explicitly.
2022-10-27 22:31:58 +02:00
f3268652ab docs: .git-blame-ignore-revs (#20820) 2022-10-27 20:31:09 +02:00
d4ca5c22c9 Merge pull request #20796 from lewis6991/refactor/diff.c_memmove 2022-10-27 16:14:06 +01:00
57af2d6953 build: fix plural messages missing from .po files (#20830) 2022-10-27 21:59:46 +08:00
5cf820f384 Merge pull request #20828 from zeertzjq/vim-patch-null
build(vim-patch.sh): handle added/removed files properly
2022-10-27 06:57:40 -04:00
dab07be4d1 build(deps): bump vimdoc parser to v1.2.5 (#20829) 2022-10-27 09:16:16 +02:00
9f6502535b build(vim-patch.sh): handle added/removed files properly 2022-10-27 13:59:57 +08:00
c41873ab63 Merge pull request #20827 from zeertzjq/vim-8.2.4234
vim-patch:8.2.{2653,4234}
2022-10-27 13:32:47 +08:00
762ca67091 vim-patch:8.2.4234: test_garbagecollect_now() does not check v:testing
Problem:    test_garbagecollect_now() does not check v:testing as documented.
Solution:   Give an error if v:testing is not set.

b3d83980d2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 13:10:33 +08:00
25cf4f2fc7 vim-patch:8.2.2653: build failure
Problem:    Build failure.
Solution:   Add missing changes.

3a0f092ac0

Omit E1176: only applicable to Vim9 script.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 13:07:51 +08:00
1fe31651bc Merge pull request #20826 from zeertzjq/vim-8.2.4206
vim-patch:8.2.{4070,4206,4207}
2022-10-27 13:07:24 +08:00
e3acf913db vim-patch:8.2.4207: recursion test fails with MSVC
Problem:    Recursion test fails with MSVC.
Solution:   Use a smaller limit for MSVC.

50e0525445

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 12:47:44 +08:00
807c6bb909 vim-patch:8.2.4206: condition with many "(" causes a crash
Problem:    Condition with many "(" causes a crash.
Solution:   Limit recursion to 1000.

fe6fb267e6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 12:47:44 +08:00
b793395019 vim-patch:8.2.4070: using uninitialized memory when reading empty file
Problem:    Using uninitialized memory when reading empty file.
Solution:   Check for empty file before checking for NL. (Dominique Pellé,
            closes vim/vim#9511)

f5d639a8af

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-10-27 12:47:44 +08:00
7765f2bb83 build: copy each treesitter parser library individually #20797
Copying each .so file one by one, rather than the entire parser
directory, allows newer .so files to overwrite older .so files with the
same name. This is useful when bumping a parser version and rebuilding
neovim without needing to run `make distclean` beforehand.
2022-10-26 21:46:18 -07:00
0117c97e62 refactor(clint): convert short to int16_t (#20815) 2022-10-27 12:28:16 +08:00
72503a7a45 Merge pull request #20824 from zeertzjq/vim-8.2.3408
vim-patch:8.2.{partial:2881,3408}
2022-10-27 10:08:13 +08:00
acbfbbb649 vim-patch:8.2.3408: can delete a numbered function
Problem:    Can delete a numbered function. (Naohiro Ono)
Solution:   Disallow deleting a numbered function. (closes vim/vim#8760)

ddfc05100a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 09:45:56 +08:00
9eaae3d56b vim-patch:partial:8.2.2881: various pieces of code not covered by tests
Problem:    Various pieces of code not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8245)

611728f806

Only port the last two hunks of test_user_func.vim.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-10-27 09:40:45 +08:00
bce6891a69 Merge pull request #20823 from zeertzjq/vim-8.2.2100
vim-patch:8.2.{2100,2726,2727}
2022-10-27 08:56:48 +08:00
905bef7bd9 vim-patch:8.2.2727: function test fails
Problem:    Function test fails.
Solution:   Adjust expected error number.

e9b8b78e04

Cherry-pick colons from patch 8.2.1593.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 08:36:09 +08:00
1f438b2338 vim-patch:8.2.2726: confusing error message with white space before comma
Problem:    Confusing error message with white space before comma in the
            arguments of a function declaration.
Solution:   Give a specific error message. (closes vim/vim#2235)

86cdb8a4bd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 08:33:55 +08:00
bd122494cc vim-patch:8.2.2100: insufficient testing for function range and dict
Problem:    Insufficient testing for function range and dict.
Solution:   Add a few tests. (Dominique Pellé, closes vim/vim#7428)

67322bf74a
2022-10-27 08:30:16 +08:00
245e6c5b30 test(old): test_lambda.vim garbagecollect() -> test_garbagecollect_now() 2022-10-27 08:25:28 +08:00
23204c83ed Merge pull request #20822 from zeertzjq/vim-8.2.2837
vim-patch:8.2.{2837,3839}: various tests
2022-10-27 08:23:32 +08:00
c031547c8d vim-patch:8.2.3839: using \z() with \z1 not tested for syntax highlighting
Problem:    Using \z() with \z1 not tested for syntax highlighting.
Solution:   Add a test. (Dominique Pellé, closes vim/vim#9365)

354b23a9f8

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-10-27 08:01:38 +08:00
624f6a8ca0 vim-patch:8.2.2837: various code lines not covered by tests
Problem:    Various code lines not covered by tests.
Solution:   Add test cases. (Dominique Pellé, closes vim/vim#8178)

6d37e8e3ba

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2022-10-27 08:01:38 +08:00
c86371258c docs(usr_05): update sentence about Nvim default behavior of Q (#20817)
While the user guide correctly describes the mapping in Vim, the default
behaviour in NeoVim seems to be the one described here.
2022-10-27 07:43:50 +08:00
fef8ff9088 Merge pull request #20818 from zeertzjq/vim-8.2.0531
vim-patch:8.2.{0531,0534,0606,1113}: various tests
2022-10-27 05:57:07 +08:00
514e6bf07b vim-patch:8.2.1113: no test for verbose output of :call
Problem:    No test for verbose output of :call.
Solution:   Add a test.

a0d072ef82

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 00:14:02 +08:00
27436b733f vim-patch:8.2.0606: several syntax HL errors not checked
Problem:    Several syntax HL errors not checked.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5954)

fbf2122cf9
2022-10-27 00:14:02 +08:00
31758d032f vim-patch:8.2.0534: client-server test fails under valgrind
Problem:    Client-server test fails under valgrind.
Solution:   Use WaitForAssert().

25d5700952

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27 00:14:02 +08:00
5559cabf4d vim-patch:8.2.0531: various errors not tested
Problem:    Various errors not tested.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5895)

476a613135

Need to remove "F" flag from 'shortmess' as early as possible.
2022-10-27 00:14:02 +08:00
a8d454816a Merge pull request #20816 from zeertzjq/vim-8.1.1826
vim-patch:8.1.1826,9.0.0019
2022-10-26 22:38:25 +08:00
8f8205ffe4 vim-patch:9.0.0019: timers test not run where possible
Problem:    Timers test not run where possible.
Solution:   Adjust platform checks. (closes vim/vim#10645)

eb273cd7b0

Cherry-pick a line from patch 8.2.0183.
2022-10-26 22:16:58 +08:00
157baef026 vim-patch:8.1.1826: tests use hand coded feature and option checks
Problem:    Tests use hand coded feature and option checks.
Solution:   Use the commands from check.vim in more tests.

8c5a278fc5

Omit Test_wincolor(): there are later patches that touch that function.
Omit test_memory_usage.vim: a Lua test is used for that file.
Cherry-pick Test_issue_3969() from patch 8.1.0969.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 22:16:58 +08:00
c00e711d5a Merge pull request #20814 from zeertzjq/vim-8.2.0610
vim-patch:8.2.{0610,0619,1852}
2022-10-26 21:34:18 +08:00
46a54dd6a0 vim-patch:8.2.1852: map() returing zero for NULL list is unexpected
Problem:    map() returing zero for NULL list is unexpected.
Solution:   Return the empty list. (closes vim/vim#7133)

ffdf8adfa8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 20:53:39 +08:00
ef363ed37c vim-patch:8.2.0619: null dict is not handled like an empty dict
Problem:    Null dict is not handled like an empty dict.
Solution:   Fix the code and add tests. (Yegappan Lakshmanan, closes vim/vim#5968)

ea04a6e8ba

Nvim doesn't support modifying NULL list, so comment out a line.
2022-10-26 20:53:39 +08:00
cfccae9584 vim-patch:8.2.0610: some tests are still old style
Problem:    Some tests are still old style.
Solution:   Convert to new style tests. (Yegappan Lakshmanan, closes vim/vim#5957)

08f4157c5c

Fix missing error message when sort() compare function fails.
Cherry-pick a line in test_utf8.vim from patch 8.2.0448.
Cherry-pick builtin_function() change from patch 8.2.0595.
2022-10-26 20:53:39 +08:00
d60fa43466 Merge pull request #20813 from zeertzjq/vim-8.2.0163
vim-patch:8.2.{0162,0163}
2022-10-26 18:49:15 +08:00
19eca77af4 vim-patch:8.2.0163: test hangs on MS-Windows console
Problem:    Test hangs on MS-Windows console.
Solution:   use feedkeys() instead of test_feedinput(). (Ken Takata)

272ca95fc3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 18:22:49 +08:00
a0ade77353 vim-patch:8.2.0162: balloon test fails in the GUI
Problem:    Balloon test fails in the GUI.
Solution:   Skip test in the GUI.

7d8ea0b241

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 18:22:49 +08:00
fed86bc78a fix(spell): fix wrong cast (#20810)
Fix #20787
2022-10-26 17:18:05 +08:00
c00844aee4 Merge pull request #20806 from zeertzjq/vim-8.2.0401
vim-patch:7.4.{1081,1097},8.2.{0401,0418}: eval tests
2022-10-26 14:38:26 +08:00
7b39ce36a4 vim-patch:8.2.0418: code in eval.c not sufficiently covered by tests
Problem:    Code in eval.c not sufficiently covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5815)

8b63313510

Nvim does not have v:none, so comment out test for it.
2022-10-26 13:52:42 +08:00
d40739843c vim-patch:8.2.0401: not enough test coverage for evalvars.c
Problem:    Not enough test coverage for evalvars.c.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5804)

8dfcce3a78

Assert E475 instead of E474 in :redir test because a later patch changed
the error number.

Comment out the test for :echo with a deeply nested container as Nvim
implements :echo very differently.
2022-10-26 13:41:31 +08:00
b4c250d37b vim-patch:7.4.1097
Problem:    Looking up the alloc ID for tests fails.
Solution:   Fix the line computation.  Use assert_fails() for unlet test.

065ee9aebf

Use v:count and v:errmsg instead of count and errmsg.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 13:41:31 +08:00
0fb08f3539 vim-patch:7.4.1081
Problem:    No test for what previously caused a crash.
Solution:   Add test for unletting errmsg.

254b105b75

Use v:errmsg instead of errmsg.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 13:41:31 +08:00
ec33edc7b7 Merge pull request #20803 from zeertzjq/vim-8.2.0179
vim-patch:8.2.{0179,0211}: tests for range()
2022-10-26 12:53:45 +08:00
0aaef07224 vim-patch:8.2.0211: test for ANSI colors fails without an "ls" command
Problem:    Test for ANSI colors fails without an "ls" command.
Solution:   Use "dir". (Ken Takata, closes vim/vim#5582)

94255df057

Cherry-pick test_functions.vim change from patch 8.2.0186.
2022-10-26 12:08:50 +08:00
3c5b435801 vim-patch:8.2.0179: still a few places where range() does not work
Problem:    Still a few places where range() does not work.
Solution:   Fix using range() causing problems.

b09920203a

Code is mostly N/A.
Cherry-pick all of Test_range() from patch 8.2.0159.

- Use nvim_input() instead of test_feedinput()
- Assert a different result from json_encode()
- Assert a different error for sign_undefine()

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-26 12:08:42 +08:00
395a271253 refactor(diff.c): copy lines via memmove 2022-10-25 10:06:00 +01:00
49c2da432b refactor(diff.c): factor out diffblock deletion 2022-10-25 10:05:53 +01:00
40791f8e82 Merge pull request #20775 from shadmansaleh/fix/opt_tal_not_redrawing_tabline
fix: setting tabline option not redrawing tabline
2022-10-24 20:05:02 +02:00
a53998ae78 fix: setting tabline option not redrawing tabline
With #20374 tabline option is marked with 'statuslines' redraw flag.
But 'statuslines' doesn't redraw tabline. As a result, tabline doesn't
get redrawn when tabline option is set and statuslines get unnecessarily redrawn.

This patch fixes the issue by adding a new redraw flag P_RTABL to redraw
tabline.
2022-10-24 21:14:41 +06:00
6da2271a04 Merge pull request #20785 from lewis6991/refactor/diff.c_2 2022-10-24 14:56:06 +01:00
bf60b9134b refactor(diff.c): internal does not need diffstyle 2022-10-24 14:34:19 +01:00
b2011bae3e refactor(diff.c): simplify diff_buf_idx() 2022-10-24 14:31:57 +01:00
b15f7007eb refactor(diff.c): factor out hunk processing 2022-10-24 14:31:56 +01:00
69ffbda84d build: preprocess vim patches with uncrustify #20786
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes https://github.com/neovim/neovim/issues/6226
2022-10-24 06:27:52 -07:00
29f138d5ad refactor(diff.c): factor out hunk extraction 2022-10-24 13:57:26 +01:00
267494151b refactor(diff.c): allocate hunks directly in ga_array 2022-10-24 13:57:21 +01:00
a6e404b7d5 refactor(diff.c): remove char_u declarations 2022-10-24 13:54:31 +01:00
4573cfa3ad fix(lua): pesc, tbl_islist result types #20751
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-24 05:53:53 -07:00
1248c12666 ci(lintcommit): enforce common scope names #20393
This is useful to ensure related commits aren't spread out when
generating the changelog.
2022-10-24 04:24:08 -07:00
f445f6b003 Merge pull request #20791 from zeertzjq/vim-8.2.0908
vim-patch:8.2.0908: crash when changing the function table while listing it
2022-10-24 16:50:37 +08:00
0ed1429fcb test: add a test for a crash fixed by patch 8.2.0908 2022-10-24 16:29:28 +08:00
c5f280c522 vim-patch:8.2.0908: crash when changing the function table while listing it
Problem:    Crash when changing the function table while listing it.
Solution:   Bail out when the function table changes. (closes vim/vim#6209)

3fffa97159

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-24 16:29:28 +08:00
29fe3348ba build(deps): bump vimdoc parser and queries to v1.2.4 (#20788) 2022-10-24 09:35:00 +02:00
57fdfc1c90 refactor(diff.c): break up ex_diffgetput()
Problem: ex_diffgetput is too big
Solution: factor out main loop into function

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-23 12:41:00 +01:00
7718241286 docs: ":che" is ":checkhealth" #20147 2022-10-23 04:04:23 -07:00
144d7b37ac feat(vim-patch): mention original author #20772 2022-10-23 04:03:25 -07:00
3f80df368e docs(maintain): CI strategy #20778
It's only focused on GitHub Actions since that is the primary CI
provider we use at the moment.
2022-10-22 22:52:45 -07:00
1887d8d7d0 docs: fix typos (#20724)
Co-authored-by: Marco Lehmann <m99@posteo.de>
2022-10-23 09:45:39 +08:00
d70193c326 refactor(diff.c): reduce scope of variables (#20781)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-23 00:57:51 +01:00
2f9b94a268 fix(ui): send grid_resize events before triggering VimResized (#20760) 2022-10-22 07:53:39 +08:00
90138d5ed8 Merge pull request #20770 from dundargoc/refactor/lint
refactor: fix uncrustify lint errors
2022-10-21 17:45:10 +02:00
abf758a297 refactor: fix uncrustify lint errors 2022-10-21 16:46:03 +02:00
8371907203 vim-patch:9.0.0814: aws config files are not recognized (#20769)
vim-patch:436e5d395fd6 (since upstream tagged the wrong commit)

Problem:    Aws config files are not recognized.
Solution:   Use "confini" for aws config files. (Justin M. Keyes,
            closes vim/vim#11416)
436e5d395f
2022-10-21 16:36:43 +02:00
fa6556515f Merge pull request #20664 from dundargoc/refactor/uncrustify
refactor(uncrustify): improved formatting rules
2022-10-21 16:26:54 +02:00
a11e96edfc docs(dev-style): remove rules covered by uncrustify
There's no reason for contributors to learn rules that can be automated
away.
2022-10-21 16:23:33 +02:00
6ff245732a refactor(uncrustify): improved formatting rules 2022-10-21 16:23:32 +02:00
b967cb2e03 refactor(uncrustify): move macros definitions to enable formatting
Uncrustify struggles to format function-like macros which are defined in
deeply nested areas of the code. Un-nesting them unblocks useful
formatting rules from uncrustify.
2022-10-21 16:22:25 +02:00
784e498c4a refactor: clang-tidy fixes to silence clangd warning (#20683)
* refactor: readability-uppercase-literal-suffix

* refactor: readability-named-parameter

* refactor: bugprone-suspicious-string-compare

* refactor: google-readability-casting

* refactor: readability-redundant-control-flow

* refactor: bugprone-too-small-loop-variable

* refactor: readability-non-const-parameter

* refactor: readability-avoid-const-params-in-decls

* refactor: google-readability-todo

* refactor: readability-inconsistent-declaration-parameter-name

* refactor: bugprone-suspicious-missing-comma

* refactor: remove noisy or slow warnings
2022-10-21 20:47:44 +08:00
e554f5c545 fix(filetype): don't pass empty string to detect (#20766)
Problem: `*.db` files use empty string as default filetype, which is
inconsistent with the rest of the code which uses `nil` instead.
Solution: don't pass a default empty string
2022-10-21 14:04:53 +02:00
24c9561a68 vim-patch: bump VIM_VERSION from 8.0 => 8.1 #20762
There are 6 remaining 8.0.x patches, tracked in:
https://github.com/neovim/neovim/issues/5431
2022-10-21 03:56:09 -07:00
45c8679493 build: give example on complex regexes
This is just to allow the reader to get a quick understanding without
necessarily needing to know all the regex intricasies.
2022-10-21 11:57:10 +02:00
0f91139074 build(cmake): add modelines to enable syntax highlighting 2022-10-21 11:48:12 +02:00
bc7daddaf0 build: rely on default cmake installation if possible
The default cmake installation process for dependencies that use cmake
on all platforms is in general more robust and less verbose, so we rely
on that if possible.
2022-10-21 11:48:12 +02:00
a288b4f214 vim-patch:9.0.0806: 'langmap' works differently when there are modifiers (#20754)
Problem:    'langmap' works differently when there are modifiers.
Solution:   Only apply 'langmap' to a character where modifiers have no
            effect. (closes vim/vim#11395, closes vim/vim#11404)
49660f5139
2022-10-21 06:32:15 +08:00
45ae5c6dc5 vim-patch:9.0.0808: jsonnet filetype detection has a typo (#20753)
Problem:    jsonnet filetype detection has a typo.
Solution:   Change "libjsonnet" to "libsonnet". (Maxime Brunet, closes vim/vim#11412)
6c8bc37a10
2022-10-20 22:49:22 +02:00
ba887da977 Merge pull request #20748 from zeertzjq/vim-9.0.0804
vim-patch:partial:8.2.0418,9.0.0804: crash when trying to divide a number by -1
2022-10-20 22:47:46 +08:00
d1484b58ae vim-patch:9.0.0804: crash when trying to divide a number by -1
Problem:    Crash when trying to divice the largest negative number by -1.
Solution:   Handle this case specifically.
cdef1cefa2
2022-10-20 22:21:01 +08:00
be0f284ae1 vim-patch:partial:8.2.0418: code in eval.c not sufficiently covered by tests
Problem:    Code in eval.c not sufficiently covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5815)
8b63313510

Only port test_expr.vim and the first hunk of test_cmdline.vim.
Add missing test from patch 7.4.1755.
Cherry-pick test_expr.vim change from patch 8.2.2060.
2022-10-20 22:08:46 +08:00
e6917306f6 docs: update vimdoc parser #20747
Remove the user-manual ToC from help.txt, because:
1. it duplicates usr_toc.txt
2. it is not what most readers are looking for in the main help page.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/49
fix https://github.com/neovim/tree-sitter-vimdoc/issues/50
fix https://github.com/neovim/tree-sitter-vimdoc/issues/51
2022-10-20 06:20:02 -07:00
e33995e936 fix(build): duplicate version string "v0.8.0-v0.8.0" #20578
- Prevent duplicate version strings such as v0.8.0-v0.8.0.
- Change the format for git releases from v0.9.0-dev-67-g625ba79be to
  v0.9.0-dev-67+g625ba79be.

Nvim versions are now:
release                    : v0.9.0
prerelease without git info: v0.9.0-dev
prerelease with git info   : v0.9.0-dev-67+g625ba79be
2022-10-20 04:03:41 -07:00
10ab7489eb fix(docs-html): misaligned tabs after conceal #20690
Problem:
`gen_help_html.lua` does not properly handle tab characters after
"concealed" text (tags, taglinks, codespans). This causes misaligned
layout in "old" (preformatted) docs.

For text like `*tag*`, |tag_link|, and `code_span`, Vim hides the "*",
"|", "`" characters, but Vim still counts those characters for "virtual
column" when a tab character follows it. So if you have a tag of say
6 characters long, those two concealed character would lead to the tab
character after it start at column 8. gen_help_html.lua doesn't account
for that which leads to formatting flaws in the generated output.

Solution:
Add two spaces after concealed nodes that are followed by a tab char.
2022-10-20 03:22:46 -07:00
3b0777cfa5 docs(news): mention 'splitkeep' #20744 2022-10-20 03:04:32 -07:00
fad558b6af vim-patch:9.0.0798: clang format configuration files are not recognized (#20741)
Problem:    Clang format configuration files are not recognized.
Solution:   Use yaml for Clang format configuration files. (Marwin Glaser,
            closes vim/vim#11398)
3c708c4390
2022-10-19 11:08:01 -06:00
96cf385a7f vim-patch:9.0.0739: mouse column not correctly used for popup_setpos (#20729)
Problem:    Mouse column not correctly used for popup_setpos.
Solution:   Adjust off-by-one error and handle Visual line selection properly.
            (Yee Cheng Chin, closes vim/vim#11356)
17822c507c

The test_termcodes.vim test cannot be used. Use a Lua test instead.
2022-10-19 11:32:26 +08:00
a5d893bebd revert: "oldtests: wait 200ms on mac for timer test" (#20728)
This reverts commit 3bad76008e.
2022-10-19 09:24:18 +08:00
bcd25b2009 Merge pull request #20727 from zeertzjq/vim-9.0.0789
vim-patch:9.0.{0789,0790}
2022-10-19 08:16:53 +08:00
88eeb4d941 vim-patch:9.0.0790: test for dummy buffer does not always produce the E86 error
Problem:    Test for dummy buffer does not always produce the E86 error.
Solution:   Do not check if the error is produced.
53c5c9f50c
2022-10-19 07:15:27 +08:00
66933b45dc vim-patch:9.0.0789: dummy buffer ends up in a window
Problem:    Dummy buffer ends up in a window.
Solution:   Disallow navigating to a dummy buffer.
8f3c3c6cd0
2022-10-19 07:14:59 +08:00
22473672aa vim-patch:9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C (#20722)
Problem:    ModeChanged autocmd not executed when Visual mode is ended with
            CTRL-C.
Solution:   Do not trigger the autocmd when got_int is set. (closes vim/vim#11394)
61c4b04799

Cherry-pick removal of cmdwin feature check from patch 9.0.0663.
2022-10-19 07:05:54 +08:00
a5a5e27323 refactor(window.c): reduce scope of locals (#20301) 2022-10-18 23:06:10 +01:00
228a04070e vim-patch:9.0.0779: lsl and lm3 file extensions are not recognized (#20704)
Problem:    lsl and lm3 file extensions are not recognized.
Solution:   Add *.lsl and *.lm3 patterns. (Doug Kearns, closes vim/vim#11384)
4ac8e7948c
2022-10-18 20:05:50 +02:00
aa2f08a050 fix(highlight): link more treesitter groups by default (#20711)
Problem: Captures used by bundled parsers are not highlighted by default
Solution: Add links to default groups

A link is added for a capture if
* there is a default group of the same name (e.g., `@tag` -> `Tag`)
* it's used in a bundled query and doesn't have a reasonable fallback
  (e.g., `@text.literal`)

Also add all linked groups to the treesitter docs.
2022-10-18 18:46:09 +02:00
ef4c339fb9 feat(docs): update parser, HTML gen #20720
Note: although the tolerance in help_spec.lua increased, the actual
error count with the new parser decreased by about 20%. The difference
is that the old ignore_parse_error() ignored many more errors with the
old parser.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/37
fix https://github.com/neovim/tree-sitter-vimdoc/issues/44
fix https://github.com/neovim/tree-sitter-vimdoc/issues/47
2022-10-18 07:18:44 -07:00
4d896be681 vim-patch:9.0.0786: user command does not get number from :tab modifier (#20716)
Problem:    User command does not get number from :tab modifier.
Solution:   Include the number. (closes vim/vim#11393, closes vim/vim#6901)
208567e9d7
2022-10-18 20:46:42 +08:00
97164748b9 fix(intro): omit patch version in ":help news" item #20713
Because maintenance releases share the same news.txt as the last
non-maintenance release.
2022-10-18 03:42:32 -07:00
72b2353ab2 ci: add reviewers based on labels (#20703) 2022-10-18 11:13:58 +02:00
bd7ca10fdd fix(qflist): avoid read of uninitialized memory (#20709)
If the call to `qf_setup_state()` in `qf_init_ext()` fails, control flow jumps
to label `qf_init_end` where a call to `qf_update_buffer()` is made with
`old_last` as a function call argument.

Prior to this patch, `old_last` would not yet have been initialized to its
default value of `NULL`, resulting in `qf_update_buffer()` attempting to compare
against its uninitialized value (quickfix.c:3882) then later forwarding it to
`qf_fill_buffer()` where the address is dereferenced and repeatedly read from/
written to for performing core qflist operations.

Depending on what the default value of `old_last` was, the results may range
from a best case scenario of neovim terminating with SIGSEGV from an attempt to
dereference an invalid pointer (quickfix.c:4056) to memory corruption if it
contained some other value that results in `qfp` being initialized from
`old_last->qf_next` (after which it is subsequently written to and read from in
a fairly arbitrary fashion).

Though extremely unlikely, it's possible for there to be security considerations
as a user can ensure that the next call to `qf_setup_state()` fails.

This patch ensures that `old_last` is NULL-assigned before control flow jumps to
`qf_init_end`.

Closes #20639.
2022-10-18 10:15:24 +08:00
be43cf16cc ci: bump ubuntu and macos to latest stable versions (#20479) 2022-10-17 19:40:54 +02:00
e427313545 vim-patch:9.0.0782: OpenVPN files are not recognized (#20702)
Problem:    OpenVPN files are not recognized.
Solution:   Add patterns for OpenVPN files. (closes vim/vim#11391)
4bf67ec52e
2022-10-17 18:36:10 +02:00
5046b4b4ad ci: add cirrus to isCI function to skip tests (#20526)
The environment variable CIRRUS_CI is manually passed to RunTests.cmake
as it doesn't get passed when using cmake script mode.
2022-10-17 17:16:31 +02:00
b9632e58e3 fix(runtime): use g:terminal_color_{0-15} in colorschemes (#20637) 2022-10-17 15:24:37 +01:00
8ebf234533 Merge pull request #20685 from luukvbaal/scroll
fix: 'scroll' is not set correctly for floats with 'splitkeep'
2022-10-17 22:04:26 +08:00
14a84ec169 test: add a test for #20684 2022-10-17 21:39:49 +08:00
46eabe1ac1 fix: 'scroll' is not set correctly for floats with 'splitkeep'
vim-patch:9.0.0780: 'scroll' value computed in unexpected location

Problem:    'scroll' value computed in unexpected location.
Solution:   Compute 'scroll' when the window height is changed. (Luuk van
            Baal, closes vim/vim#11387)
a1a46da87d
2022-10-17 21:28:30 +08:00
637ab296cb feat(api): nvim_select_popupmenu_item support cmdline pum (#20652) 2022-10-17 21:00:50 +08:00
39911d76be fix(man): handle absolute paths as :Man targets (#20624)
* fix(man): handle absolute paths as :Man targets

Previously, attempting to provide `:Man` with an absolute path as the name would
cause neovim to return the following error:

```
Error detected while processing command line:
/usr/local/share/nvim/runtime/lua/man.lua:690: /usr/local/share/nvim/runtime/lua/man.lua:683: Vim:E426: tag not found: nil(nil)
Press ENTER or type command to continue
```

..because it would try to validate the existence of a man page for the provided
name by executing `man -w /some/path` which (on at least some Linux machines
[0]) returns `/some/path` instead of the path to the nroff files that would be
formatted to satisfy the man(1) lookup.

While man pages are not normally named after absolute paths, users shouldn't be
blamed for trying. Given such a name/path, neovim would **not** complain that
the path didn't have a corresponding man file but would error out when trying
to call the tag function for the null-propagated name-and-section `nil(nil)`.
(The same underlying error existed before this function was ported to lua, but
did not exhibit the lua-specific `nil(nil)` name; instead a tag lookup for `()`
would fail and error out.)

With this patch, we detect the case where `man -w ...` returns the same value as
the provided name to not only prevent invoking the tag function for a
non-existent/malformed name+sect but also to properly report the non-existence
of a man page for the provided lookup (the absolute path).

While man(1) can be used to directly read an nroff-formatted document via `man
/path/to/nroff.doc`, `:Man /path/to/nroff.doc` never supported this behavior so
no functionality is lost in case the provided path _was_ an nroff file.

[0]: `man -w /absolute/path` returning `/absolute/path` observed on an Ubuntu
18.04 installation.

* test: add regression test for #20624

Add a functional test to `man_spec.lua` to check for a regression for #20624 by
first obtaining an absolute path to a random file and materializing it to disk,
then attempting to query `:Man` for an entry by that same name/path.

The test passes if nvim correctly reports that there is no man page
correspending to the provided name/path and fails if any other error (or no
error) is shown.
2022-10-17 10:37:44 +01:00
190019dd79 Merge pull request #20665 from lewis6991/fix/decor_redraw 2022-10-17 10:19:26 +01:00
042eb74ff1 feat(runtime)!: remove filetype.vim (#20428)
Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
2022-10-17 08:52:40 +02:00
9701c9dc9f vim-patch:3c053a1a5ad2 (#20679)
Update runtime files
3c053a1a5a
2022-10-17 08:19:48 +02:00
d44f088834 vim-patch:9.0.0771: cannot always tell the difference beween tex and … (#20687)
vim-patch:9.0.0771: cannot always tell the difference beween tex and rexx files

Problem:    Cannot always tell the difference beween tex and rexx files.
Solution:   Recognize tex by a leading backslash. (Martin Tournoij,
            closes vim/vim#11380)
bd053f894b
2022-10-17 08:18:57 +02:00
8617101b6b docs: "supported platforms" matrix #19615
Inspired by libuv's own SUPPORTED_PLATFORMS.md:
https://github.com/libuv/libuv/blob/v1.x/

https://neovim.io/doc/user/support.html
2022-10-16 15:31:51 -07:00
8f31a730c0 fix(lsp): reporting bogus capabilities in CodeActionKind #20678
Problem:
LSP client provides bogus capabilities in CodeActionKind.
LSP logs show this in the "initialize" message:
    codeActionKind = { valueSet = { "Empty", "QuickFix",
    "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite",
    "Source", "SourceOrganizeImports", "", "quickfix", "refactor",
    "refactor.extract", "refactor.inline", "refactor.rewrite", "source",
    "source.organizeImports" }

Solution:
Only the values from the CodeActionKind table should be presented, not also the
keys.

fix #20657
2022-10-16 15:24:39 -07:00
935e1ca743 feat: mention ":help news" in intro #20674 2022-10-16 14:55:18 -07:00
0b71960ab1 Merge pull request #20677 from zeertzjq/vim-9.0.0761
vim-patch:9.0.{0761,0762,0764}: 'lispoptions'
2022-10-16 08:56:26 +08:00
c8fbf39d47 vim-patch:9.0.0764: indent and option tests fail
Problem:    Indent and option tests fail.
Solution:   Change OP_INDENT.  Add entry to options test table.
c8b6735573
2022-10-16 08:34:55 +08:00
19eb7054ff vim-patch:9.0.0761: cannot use 'indentexpr' for Lisp indenting
Problem:    Cannot use 'indentexpr' for Lisp indenting.
Solution:   Add the 'lispoptions' option.
49846fb1a3

vim-patch:9.0.0762: build failure

Problem:    Build failure.
Solution:   Add missing change.
4b082c4bd0
2022-10-16 08:34:55 +08:00
bc798dfd8c vim-patch:9.0.0765: with a Visual block a put command column may go negative (#20676)
Problem:    With a Visual block a put command column may go negative.
Solution:   Check that the column does not become negative.
36343ae0fb
2022-10-16 08:01:44 +08:00
2921de6a96 fix(decoration): call providers in win_update() earlier
Fixes #20651
2022-10-15 18:06:59 +01:00
80161ec7d6 refactor(drawscreen.c): reduce scopes of locals (#20668) 2022-10-15 18:01:52 +01:00
d4841e24da Merge pull request #20140 from dundargoc/refactor/char_u/12
refactor: replace char_u with char 12: remove `STRLEN` part 2
2022-10-15 18:17:07 +02:00
0434f732a6 Merge pull request #20670 from zeertzjq/vim-9.0.0737
vim-patch:9.0.{partial:0737,0754}: lisp indent fixes
2022-10-15 20:27:34 +08:00
1ba9d63d77 refactor(shada.c): clint (#20599) 2022-10-15 12:45:57 +01:00
32ced1f08f vim-patch:9.0.0754: 'indentexpr' overrules lisp indenting in one situation
Problem:    'indentexpr' overrules lisp indenting in one situation.
Solution:   Add "else" to keep the lisp indent. (issue vim/vim#11327)
a79b35b578
2022-10-15 19:44:03 +08:00
eaac095825 vim-patch:partial:9.0.0737: Lisp word only recognized when a space follows
Problem:    Lisp word only recognized when a space follows.
Solution:   Also match a word at the end of a line.  Rename the test.  Use a
            compiled function to avoid backslashes.
d26c5805bc

Keep the old Test_lisp_indent().
2022-10-15 19:42:03 +08:00
04cdea5f4a refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-10-15 13:18:46 +02:00
433818351b Merge pull request #20663 from zeertzjq/vim-9.0.0753
vim-patch:partial:{3e79c97c18c5,9da17d7c5707,9.0.0753}
2022-10-15 19:07:30 +08:00
d52e3b97c5 Merge #20634 fix(windows): set console icon later in startup 2022-10-15 06:22:47 -04:00
9cb2a69039 docs(dev-style): remove rule about variable declarations (#20446)
The other style rules such as "initialize variables in the declaration" should already take care of this rule automatically.
2022-10-15 11:55:55 +02:00
09b0f7cd08 vim-patch:partial:9.0.0753: some Ex commands are not in the help index
Problem:    Some Ex commands are not in the help index.
Solution:   Add the missing commands.  Add a script to check all Ex commands
            are in the help index. (Yee Cheng Chin, closes vim/vim#11371)
b77bdce120

Only port index.txt docs for :star and :horizontal.
2022-10-15 17:44:56 +08:00
6f5426edf6 vim-patch:partial:9da17d7c5707
Update runtime files
9da17d7c57

Only port index.txt, syntax.txt and uganda.txt.
2022-10-15 17:42:45 +08:00
3e5e12482c vim-patch:partial:3e79c97c18c5
Update runtime files; use compiled functions
3e79c97c18

Only port uganda.txt.
2022-10-15 17:39:32 +08:00
9d05b28f75 Merge pull request #20662 from zeertzjq/vim-9.0.0614
vim-patch:8.1.0342,9.0.{0614,0616}: SpellFileMissing autocmd may delete buffer
2022-10-15 16:52:25 +08:00
a9452cf3d5 vim-patch:9.0.0616: spell test fails because error message changed
Problem:    Spell test fails because error message changed.
Solution:   Adjust expected error message.
371951d0c3
2022-10-15 16:28:36 +08:00
6bc2d6b66b vim-patch:9.0.0614: SpellFileMissing autocmd may delete buffer
Problem:    SpellFileMissing autocmd may delete buffer.
Solution:   Disallow deleting the current buffer to avoid using freed memory.
ef976323e7
2022-10-15 16:28:36 +08:00
65cbe0cc35 vim-patch:8.1.0342: crash when a callback deletes a window that is being used
Problem:    Crash when a callback deletes a window that is being used.
Solution:   Do not unload a buffer that is being displayed while redrawing the
            screen. Also avoid invoking callbacks while redrawing.
            (closes vim/vim#2107)
94f01956a5

Omit parse_queued_messages(): N/A.
Cherry-pick a break statement from patch 8.1.0425.
2022-10-15 16:28:31 +08:00
e26b48bde6 vim-patch:9.0.0752: Rprofile files are not recognized (#20658)
Problem:    Rprofile files are not recognized.
Solution:   Recognize Rprofile files as "r". (closes vim/vim#11369)
7e120ffccb
2022-10-15 10:12:25 +02:00
1c478391ca vim-patch:9.0.0750: crash when popup closed in callback (#20659)
Problem:    Crash when popup closed in callback. (Maxim Kim)
Solution:   In syntax_end_parsing() check that syn_block is valid.
0abd6cf62d
2022-10-15 07:24:03 +08:00
cb7da02701 Merge pull request #20645 from lewis6991/fix/decor_redraw_same_id
fix(decoration): redraw correctly when re-using ids
2022-10-14 20:46:26 +01:00
1ca3a3749f refactor(windows): move os_icon_xx functions 2022-10-14 17:17:35 +02:00
ffc6d14af5 fix(windows): set console icon later in startup
Problem:
Windows console icon is set early in startup, but there are some cases
where `os_exit` is called and we don't restore the original icon.

Solution:
- Move `os_icon_init()` later in the startup sequence, and only if
  `use_builtin_ui==true`.
- Rename functions: use `os_` prefix for platform-specific code.
2022-10-14 17:13:38 +02:00
e6f7e038b8 fix(completion): set pum_size even if ext_popupmenu is used (#20648)
This allows CompleteChanged event to get the correct `v:event.size`.
It should be harmless and more consistent to also set `pum_array`.
2022-10-14 23:08:00 +08:00
e5cb3104d0 docs: fix/remove invalid URLs #20647 2022-10-14 08:01:13 -07:00
0a19c16778 build: fix incorrect clang-tidy identifier rules (#20650)
Also remove identifier rules that are C++ only.
2022-10-14 15:15:10 +02:00
546b294e74 fix(decoration): redraw correctly when re-using ids
00cfc1d (from #20249) reduced the amount of unnecessary redraws. This
surfaced an issue where if and extmark with a specific ID is
repositioned to a different row, the decorations from the old row were
not redrawn and removed. This change fixes that by redrawing the
old row.
2022-10-14 13:03:03 +01:00
81986a7349 fix(lua): on_yank error with blockwise multibyte region #20162
Prevent out of range error when calling `str_byteindex`.
Use `vim.str_byteindex(bufline, #bufline)` to cacluate utf length of `bufline`.
fix #20161
2022-10-14 02:12:46 -07:00
9931db2e3f Merge pull request #20545 from lewis6991/remove_cscope 2022-10-14 09:53:15 +01:00
d339b4aad7 build(deps): bump vimdoc (help) parser to v1.2.1 #20642 2022-10-13 18:36:25 -07:00
0578c67767 vim-patch:9.0.0747: too many #ifdefs (#20641)
Problem:    Too many #ifdefs.
Solution:   Gradudate the +cmdline_info feature. (Martin Tournoij,
            closes vim/vim#11330)
ba43e76fcd
2022-10-14 07:29:58 +08:00
7f11dfdef8 refactor(tag): remove return type from do_tag() 2022-10-13 16:37:24 +01:00
288208257c feat(cscope)!: remove 2022-10-13 16:37:23 +01:00
eb123b565e docs: fix typos (#20509)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-13 21:18:48 +08:00
730228f6db feat(windows): show icon in terminal titlebar, taskbar #20607
closes #20071
2022-10-13 05:48:12 -07:00
06dfedc87a vim-patch:9.0.0738: cannot suppress completion "scanning" messages (#20633)
Problem:    Cannot suppress completion "scanning" messages.
Solution:   Add the "C" flag in 'shortmess'. (Bjorn Linse, closes vim/vim#11354)
91ccbad5de
2022-10-13 20:46:23 +08:00
4fbf41dfb4 vim-patch:8.2.4735: quickfix tests can be a bit hard to read (#20631)
Problem:    Quickfix tests can be a bit hard to read.
Solution:   Use heredoc instead of strings and line continuation. (Yegappan
            Lakshmanan, closes vim/vim#10145)
4a7724a440

Cherry-pick a typo fix from patch 8.2.3637.
2022-10-13 14:31:10 +08:00
b55742fafd Merge pull request #20630 from zeertzjq/vim-9.0.0260
vim-patch:9.0.{0260,0286}: quickfix fixes
2022-10-13 12:18:51 +08:00
f72ae4514c vim-patch:9.0.0286: using freed memory when location list changed in autocmd
Problem:    Using freed memory when location list changed in autocmd.
Solution:   Return QF_ABORT and handle it. (Yegappan Lakshmanan,
            closes vim/vim#10993)
6d24a51b94
2022-10-13 11:47:59 +08:00
5740b3e076 vim-patch:9.0.0260: using freed memory when using 'quickfixtextfunc' recursively
Problem:    Using freed memory when using 'quickfixtextfunc' recursively.
Solution:   Do not allow for recursion.
d6c67629ed

Cherry-pick Test_qflist_statusmsg() from patch 8.2.4617.
2022-10-13 11:47:59 +08:00
186c489fd6 Merge pull request #20629 from zeertzjq/vim-8.2.4453
vim-patch:8.2.{4453,4462}
2022-10-13 10:46:42 +08:00
cd1e0bb87d vim-patch:8.2.4462: not enough testing for quickfix code
Problem:    Not enough testing for quickfix code.
Solution:   Add more tests. Fix uncovered problem. (Yegappan Lakshmanan,
            closes vim/vim#9839)
9c9be05b17

Omit Test_helpgrep_vim9_restore_cpo().
Cherry-pick test_quickfix.vim change from patch 8.2.0644.
2022-10-13 10:20:42 +08:00
73bdfdd382 vim-patch:8.2.4453: :helpgrep may free an option that was not allocated
Problem:    :helpgrep may free an option that was not allocated. (Yegappan
            Lakshmanan)
Solution:   Check if the value was allocated.
4791fcd825
2022-10-13 10:09:09 +08:00
34c7007c32 vim-patch:9.0.0727: help in the repository differs from patched version too much (#20627)
Problem:    Help in the repository differs from patched version too much.
Solution:   Make a patch for a few help files.
7c6cd44375
2022-10-13 07:49:48 +08:00
0ef6aaa3a7 refactor: clint (#20600) 2022-10-12 14:53:40 +01:00
024f6880b5 fix(clint): disable whitespace/newline #20619
This rule is already mostly covered by uncrustify.
2022-10-12 06:31:32 -07:00
4f305fba14 vim-patch:9.0.0731: clang-tidy configuration files are not recognized (#20620)
Problem:    clang-tidy configuration files are not recognized.
Solution:   Recognize clang-tidy files as yaml. (closes vim/vim#11350)
af40f9af33
2022-10-12 15:23:42 +02:00
eeeb6c80d8 refactor(search.c): clint (#20598) 2022-10-12 10:59:06 +01:00
d5db93b8aa build: add clang-tidy configuration file (#15601)
Add a project-style compliant clang-tidy configuration file in the root directory. This configuration will take priority over users own configuration files, so noisy warnings have been removed even though they may be useful, at least for the time being.
2022-10-12 10:49:53 +02:00
f175ca9f7c Merge pull request #20606 from zeertzjq/vim-8.2.4523
vim-patch:8.2.4523: when gvim is started maximized the 'window' option isn't set
2022-10-12 12:20:14 +08:00
9115f66555 test: add a test for #20605 2022-10-12 11:50:40 +08:00
3b562535c3 vim-patch:8.2.4523: when gvim is started maximized the 'window' option isn't set
Problem:    When gvim is started maximized the 'window' option isn't set
            properly. (Christian J. Robinson)
Solution:   Check if 'windows' was already set or not. (Ken Takata,
            closes vim/vim#9904)
6ca883dd8a
2022-10-12 07:48:25 +08:00
45cc5fd765 fix(runtime): properly rely on t_Co for colorschemes (#20602)
Problem: check for available colors failed
Solution: simply trust t_Co, which is always available
2022-10-11 23:35:35 +02:00
760b399f6c Merge pull request #20593 from lewis6991/fix/man_macos13 2022-10-11 16:18:18 +01:00
6e11db2301 refactor/mark.c (#20596) 2022-10-11 16:15:44 +01:00
b126b11840 fix(man): support MacOS 13
MacOS 13 has changed its version of `man` to an version that doesn't
properly support `man -w` (without arguments). In order to workaround
this we simply fallback to $MANPATH.

Fixes #20579
2022-10-11 15:38:15 +01:00
cba05c541d refactor(man): pass env directly to spawn() (#20591) 2022-10-11 13:25:42 +01:00
c5347d47e1 Merge pull request #20570 from lewis6991/refactor/lua2dox
refactor: lua2dox
2022-10-11 08:28:36 +01:00
d9a80b8e29 Merge pull request #20584 from Fuzzier/type-cast-conin
refactor: explicitly convert HANDLE to intptr_t for _open_osfhandle()
2022-10-11 11:30:00 +08:00
63ab3337e0 refactor: explicitly convert HANDLE to intptr_t for _open_osfhandle()
Problem:
The first parameter of "_open_osfhandle()" is an intptr_t; however, a HANDLE is passed.
The official documentation of [_open_osfhandle](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/open-osfhandle) suggests to cast the HANDLE to intptr_t.
MSVC/cl is able to perform an implicit type cast.
However, LLVM/clang-cl will generate an compilation error.

Solution:
Explicitly convert HANDLE to intptr_t for _open_osfhandle().
2022-10-11 10:58:11 +08:00
8f0b94b36d build(deps): disable shared library for libvterm. (#20566)
build(deps): disable shared library for libvterm

Problem:
Cannot build both static and share libraries for libvterm under Windows.
The static and shared library would have the same name "vterm.lib", thus there would be multiple rules to build the same target.

Solution:
Disable shared library for libvterm.

This makes it possible to use Ninja on Windows to build dependencies (2x speedup!).
But not for Release builds yet.

Co-authored-by: Wei Tang <gauchyler@uestc.edu.cn>
2022-10-10 17:46:34 -07:00
26c6537180 Merge pull request #20574 from zeertzjq/vim-8.2.2184
vim-patch:8.2.{1465,2184,2670,2671},9.0.{0712,partial:0715}
2022-10-11 00:24:52 +08:00
62a0c9f8c2 vim-patch:partial:9.0.0715: wrong argument for append() gives two error messages
Problem:    Wrong argument for append() gives two error messages.
Solution:   When getting an error for a number argument don't try using it as
            a string. (closes vim/vim#11335)
801cd35e7e

Skip test as it depends on too many previous patches.
2022-10-10 23:54:51 +08:00
2cc64dca92 fix: change did_emsg back to int 2022-10-10 23:54:51 +08:00
249cb8345d vim-patch:9.0.0712: wrong column when calling setcursorcharpos() with zero lnum
Problem:    Wrong column when calling setcursorcharpos() with zero lnum.
Solution:   Set the line number before calling buf_charidx_to_byteidx().
            (closes vim/vim#11329)
79f234499b
2022-10-10 23:54:51 +08:00
5c9f6bdd8c vim-patch:8.2.2671: error for line number in legacy script
Problem:    Error for line number in legacy script.
Solution:   Check for number type.
f6bdd82c7e

N/A patches for version.c:

vim-patch:8.2.2670: Vim9: error for append(0, text)

Problem:    Vim9: error for append(0, text).
Solution:   Check for negative number. (closes vim/vim#8022)
b2ac7d0663
2022-10-10 23:54:51 +08:00
9c272b75ec vim-patch:8.2.2184: Vim9: no error when using "2" for a line number
Problem:    Vim9: no error when using "2" for a line number.
Solution:   Give an error message if the line number is invalid. (closes vim/vim#7492)
9a963377b4

N/A patches for version.c:

vim-patch:8.2.1465: Vim9: subscript not handled properly

Problem:    Vim9: subscript not handled properly.
Solution:   Adjust error message.  Remove dead code.  Disallow string to
            number conversion in scripts.
56acb0943e
2022-10-10 23:54:51 +08:00
8781213f00 vim-patch:9.0.0711: SubStation Alpha files are not recognized (#20577)
Problem:    SubStation Alpha files are not recognized.
Solution:   Add patterns for SubStation Alpha files. (closes vim/vim#11332)
084f2620ec
2022-10-10 17:51:31 +02:00
3ddd99ec64 build(deps): add build type for libuv (#20575)
Problem:
Build type is not set in BuildLibuv.cmake, so libuv is always built for Debug type.

Solution:
Add build type for libuv.
2022-10-10 17:51:10 +02:00
121f052d1f Merge pull request #20576 from lewis6991/manhealth 2022-10-10 16:21:40 +01:00
4ccc57fd7a feat(man): add health check
Fixes #20432
2022-10-10 15:58:44 +01:00
81058119df vim-patch:9.0.0713: <amatch> of MenuPopup event is expanded like a file name (#20572)
Problem:    <amatch> of MenuPopup event is expanded like a file name.
Solution:   Do not expand <amatch> for MenuPopup. (closes vim/vim#11328)
c601d988b6
2022-10-10 21:26:18 +08:00
3b6c7f9c7f refactor(lua2dox_filter): format 2022-10-10 12:21:40 +01:00
c401b06fe9 refactor(lua2dox): tidy 2022-10-10 12:21:19 +01:00
a6d889eae1 refactor(lua2dox): format with stylua 2022-10-10 12:10:57 +01:00
d4e749f1b2 vim-patch:9.0.0700: there is no real need for a "big" build (#20563)
Problem:    There is no real need for a "big" build.
Solution:   Move common features to "normal" build, less often used features
            to the "huge" build. (Martin Tournoij, closes vim/vim#11283)
25f3a146a0
2022-10-10 11:34:53 +08:00
a5597d1fc0 fix(lua): assert failure with vim.regex() error inside :silent! (#20555)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-10 08:04:08 +08:00
9d0ed754d5 Merge #20558 feat(docs-html): fixes; ToC tags 2022-10-09 19:40:04 -04:00
3010469562 vim-patch:9.0.0706: :help in a narrow window always opens at the top (#20559)
Problem:    :help in a narrow window always opens at the top.
Solution:   Respect 'splitbelow'. (closes vim/vim#11319)
28f7e701b7
2022-10-10 07:16:15 +08:00
6b01e9bf87 feat(docs-html): try to use tags for ToC headings
Problem:
The generated ToC (table of contents) uses anchors derived from the
heading title, e.g. the "Global Plugins" heading yields:
https://neovim.io/doc/user/usr_05.html#_global-plugins-
so if the heading title changes, then the old URL (anchor) is broken.

Solution:
:help tags change less often than heading titles, so if a heading
contains a *tag*, use that as its anchor name instead. Example:
https://neovim.io/doc/user/usr_05.html#standard-plugin
2022-10-10 01:05:18 +02:00
a7a83bc4c2 fix(docs-html): update parser
- Improve generated HTML by updating parser which includes fixes for
  single "'" and single "|":
  https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
  queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
  NOT including whitespace in nodes.
  - But this means we need to restore the getws() function which scrapes
    leading whitespace from the original input (buffer).
2022-10-10 01:05:18 +02:00
2bce99b978 build(deps): bump vimdoc parser to v1.2.0 #20557 2022-10-09 14:06:32 -07:00
09dffb9db7 docs: various #12823
- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
2022-10-09 05:21:52 -07:00
de7be43acc Merge pull request #20554 from zeertzjq/vim-9.0.0697
vim-patch:9.0.{0697,0702}: cursor in wrong position with 'linebreak'
2022-10-09 19:45:32 +08:00
7cdaa74b36 vim-patch:9.0.0702: incomplete testing cursor position with 'linebreak' set
Problem:    Incomplete testing cursor position after change with 'linebreak'
            set.
Solution:   Add a test and move test cases together. (closes vim/vim#11313)
30c0c467d6
2022-10-09 19:09:32 +08:00
c93fd83df2 vim-patch:9.0.0697: cursor in wrong position with Visual substitute
Problem:    Cursor in wrong position with Visual substitute.
Solution:   When restoring 'linebreak' mark the virtual column as invalid.
            (closes vim/vim#11309, closes vim/vim#11311)
16dab41537

N/A patches for version.c:

vim-patch:9.0.0699: tiny build fails

Problem:    Tiny build fails.
Solution:   Add #ifdef.
bf499c0e6f
2022-10-09 18:58:30 +08:00
603c6b6996 Merge pull request #20552 from dundargoc/build/cmake/compilation-database
build: generate compilation database for older cmake versions
2022-10-09 06:45:31 -04:00
8c2226fc30 fix(lua): properly configure luacheck and remove local vim = ... lines (#20551) 2022-10-09 12:40:56 +02:00
c422046e43 build: generate compilation database for older cmake versions
Fall back to the older method of setting CMAKE_EXPORT_COMPILE_COMMANDS
for cmake versions less than 3.20. This isn't recommended as it's not
possible to exclude targets from generating a compilation database,
which may cause some tools like clang-tidy to do unnecessary work. But
having an unoptimized compilation database is still useful enough that
it's worth having.
2022-10-09 11:44:47 +02:00
edc8a1f046 Merge pull request #20544 from lewis6991/exitfreedebug
build: remove EXITFREE for debug builds
2022-10-08 18:06:43 +01:00
93117b3587 docs(news): add news.txt and link from README (#20426) 2022-10-08 17:49:09 +02:00
b05e10ef72 vim-patch:9.0.0692: PoE filter files are not recognized (#20542)
Problem:    PoE filter files are not recognized.
Solution:   Add a pattern to detect PoE filter files. (closes vim/vim#11305)
b7f52f5659
2022-10-08 17:46:31 +02:00
1d4840a13a build: remove EXITFREE for debug builds
When EXITFREE is defined, uv handles are not closed on exit in order to
better detect memory leaks. However the cost of this is that by not
closing the handles there can be lag when exiting nvim.

This change removes EXITFREE from debug builds in order to avoid this
exit lag for regular debug builders who are not running ASAN.
2022-10-08 16:06:32 +01:00
9207ad5c84 Merge pull request #20528 from mliszcz/build-appimage-in-container
ci: Use ubuntu docker container to build appimage
2022-10-08 10:02:54 -04:00
56182b5e97 Merge pull request #20543 from dundargoc/ci/backport
ci(backport): bump version to v0
2022-10-08 09:58:17 -04:00
048baa92be ci(backport): bump version to v0
backport-action now uses "v0" tag to point to the latest stable version.
This helps us avoid having to manually bump the version to get bug
fixes.
2022-10-08 14:24:03 +02:00
fad1022caf fix(tui): resume main thread if suspending isn't implemented (#20523)
Not doing anything is better than hanging.
2022-10-08 20:17:53 +08:00
2a12faaec1 fix(api): dynamically allocate line buffer for nvim_out_write (#20537) 2022-10-08 20:10:00 +08:00
0773a9ee3a feat(lsp): support window/showDocument (#19977) 2022-10-08 10:22:25 +02:00
f2cab9b5b4 ci: use ubuntu docker container to build appimage
Switch back to Ubuntu 18.04 for buliding the appimage. This allows for
using the appimage on older systems that do not provide GLIBC_2.29.

Fixes #19711.
Fixes #20113.
2022-10-07 15:13:40 +02:00
cfdb4cbada fix: find multibyte file name in line (#20519)
And remove unnecessary unsigned casts in fold marker comparison.
2022-10-07 09:43:16 +08:00
d191070913 fix(ui): setting 'cmdheight' with global statusline (#20515) 2022-10-07 08:52:51 +08:00
bcef006da6 vim-patch:9.0.0678: using exclamation marks on :function (#20518)
Problem:    Using exclamation marks on :function.
Solution:   Use :func and :endfunc as usual.
97f0eb169b

Add a missing change from patch 8.1.1875.
2022-10-07 07:06:38 +08:00
09325845b9 vim-patch:9.0.0666: spacing-combining characters handled as composing (#20501)
Problem:    Spacing-combining characters handled as composing, causing text to
            take more space than expected.
Solution:   Handle characters marked with "Mc" not as composing.
            (closes vim/vim#11282
7beaf6a720
2022-10-07 06:44:29 +08:00
6cd643dbf9 ci: update which paths to ignore (#20510)
Skipping the CI on documentation-only changes is no longer appropriate
as we now rely on CI to test parts of documentation, e.g.
test/functional/lua/help_spec.lua.

Ignore changes in contrib/ as it's for non-essential user contributions
that we don't need to test.
2022-10-06 18:45:42 +02:00
d48ea0e3ea Merge pull request #20378 from folke/shared_annotations 2022-10-06 16:04:34 +01:00
1da7b4eb69 feat: added support for specifying types for lua2dox 2022-10-06 15:42:21 +01:00
24a1c7f556 feat: added support for optional params to lua2dox 2022-10-06 15:38:28 +01:00
453fffde16 feat: added support for @generic to lua2dox.lua 2022-10-06 15:38:28 +01:00
c8d1b9a2d6 docs: added proper annotations to functions in shared.lua 2022-10-06 15:38:27 +01:00
f7b175e049 fix(docs-html): keycodes, taglinks, column_heading #20498
Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
  their table columns/contents because the leading whitespace is not
  emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.

Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
  - supports `keycode`
  - fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297

fix https://github.com/neovim/neovim.github.io/issues/297
2022-10-06 06:16:00 -07:00
61da959bb4 build(deps): restore support for USE_EXISTING_SRC_DIR (#20491)
59d5f692f removed cmake.deps/cmake/DownloadAndExtractFile.cmake and
support for USE_EXISTING_SRC_DIR.  The Ubuntu nightly PPA still relies
on USE_EXISTING_SRC_DIR functionality since it can't access the network
during the build.

Supplying an empty value for ExternalProject_Add()'s URL value appears
to provide the needed mechanism to avoid re-downloading when the sources
are already present.  This is undocumented behavior, though, so it may
break in the future.

Now, if USE_EXISTING_SRC_DIR is set, the ExternalProject's URL variable
is unset, preventing the download and erroring out if the source doesn't
actually exist.
2022-10-06 15:14:38 +02:00
25dea99ce5 vim-patch:9.0.0670: no space for command line when there is a tabline (#20512)
Problem:    No space for command line when there is a tabline.
Solution:   Correct computation of where the command line should be.
            (closes vim/vim#11295)
c9f5f73206
2022-10-06 20:03:59 +08:00
2c08ab5369 docs: fix incorrect :help tag (#20511)
vim.lsp.format() doesn't exist, which causes functionaltest to fail.
Change to vim.lsp.buf.format().
2022-10-06 19:00:13 +08:00
de47b4b901 docs(lsp): add formatting APIs to deprecated.txt (#20487)
Add vim.lsp.buf.formatting() to deprecated.txt.
Add vim.lsp.buf.range_formatting() to deprecated.txt.
2022-10-06 10:07:04 +02:00
1cb858b355 vim-patch:9.0.0657: too many #ifdefs (#20506)
Problem:    Too many #ifdefs.
Solution:   Graduate the +cmdwin feature.  Now the tiny and small builds are
            equal, drop the small build.  (Martin Tournoij, closes vim/vim#11268)
7904fa420e

Accidentally forgot to mark as ported:

vim-patch:9.0.0471: no test for what patch 9.0.0469 fixes

Problem:    No test for what patch 9.0.0469 fixes.
Solution:   Add a test. (closes vim/vim#11140)
12167d8b84
2022-10-06 15:47:50 +08:00
5acf52e19b feat(window/ui): add splitkeep option (#19243)
vim-patch:9.0.0445: when opening/closing window text moves up/down

Problem:    When opening/closing window text moves up/down.
Solution:   Add the 'splitscroll' option.  When off text will keep its
            position as much as possible.
29ab524358

vim-patch:9.0.0455: a few problems with 'splitscroll'

Problem:    A few problems with 'splitscroll'.
Solution:   Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117)
5ed391708a

vim-patch:9.0.0461: 'scroll' is not always updated

Problem:    'scroll' is not always updated.
Solution:   Call win_init_size() at the right place.
470a14140b

vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution:   Temporarily set 'splitscroll' when jumping back to the original
            window. (closes vim/vim#11128)
e697d48890

vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution:   Skip win_fix_cursor if called when cmdwin is open or closing.
            (Luuk van Baal, closes vim/vim#11134)
3735f11050

vim-patch:9.0.0478: test for 'splitscroll' takes too much time

Problem:    Test for 'splitscroll' takes too much time.
Solution:   Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139)
594f9e09cd

vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help

Problem:    Text scrolled with 'nosplitscroll', autocmd win opened and help
            window closed.
Solution:   Skip win_fix_scroll() in more situations. (Luuk van Baal,
            closes vim/vim#11150)
d5bc762dea

vim-patch:9.0.0505: various problems with 'nosplitscroll'

Problem:    Various problems with 'nosplitscroll'.
Solution:   Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166)
faf1d412f5

vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin

Problem:    Scrolling with 'nosplitscroll' in callback changing curwin.
Solution:   Invalidate w_cline_row in the right place. (Luuk van Baal,
            closes vim/vim#11185)
20e58561ab

vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly

Problem:    With 'nosplitscroll' folds are not handled correctly.
Solution:   Take care of closed folds when moving the cursor. (Luuk van Baal,
            closes vim/vim#11234)
7c1cbb6cd4

vim-patch:9.0.0605: dump file missing

Problem:    Dump file missing.
Solution:   Add the missing dump file. (issue vim/vim#11234)
439a2ba174

vim-patch:9.0.0647: the 'splitscroll' option is not a good name

Problem:    The 'splitscroll' option is not a good name.
Solution:   Rename 'splitscroll' to 'splitkeep' and make it a string option,
            also supporting "topline". (Luuk van Baal, closes vim/vim#11258)
13ece2ae1d

vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"

Problem:    ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution:   Check the botline is not too large. (Luuk van Baal,
            closes vim/vim#11293, closes vim/vim#11292)
346823d3e5
2022-10-06 14:57:52 +08:00
4bfbac05c9 vim-patch:9.0.0422: not enough testing of the :all command (#20503)
Problem:    Not enough testing of the :all command.
Solution:   Add more testing. (Yegappan Lakshmanan, closes vim/vim#11091)
0dc2fd307f
2022-10-06 12:50:34 +08:00
bc64aa435b vim-patch:9.0.0665: setting 'cmdheight' has no effect if last window was resized (#20500)
Problem:    Setting 'cmdheight' has no effect if last window was resized.
Solution:   Do apply 'cmdheight' when told to.  Use the frame height instead
            of the cmdline_row.  (closes vim/vim#11286)
0816f473ab
2022-10-06 09:03:49 +08:00
6ae4a6e071 Merge pull request #20374 from bfredl/notype
screen: refactor old curwin-heavy logic and graduate "msgsep" feature
2022-10-05 21:50:12 +02:00
ede85dda2e Merge pull request #20496 from ehllie/runtime_annotations
docs(docstrings): fix runtime type annotations
2022-10-05 20:21:30 +02:00
7746f641b8 fix(options): no matter what is said, 'cmdheight' is tab-local (susy baka) 2022-10-05 20:12:59 +02:00
6ae144a921 feat(messages)!: graduate the 'msgsep' feature
The old behaviour (e.g. via `set display-=msgsep`) will not be available.
Assuming that messages always are being drawn on msg_grid
(or not drawn at all, and forwarded to `ext_messages` enabled UI)
will allows some simplifcations and enhancements moving forward.
2022-10-05 20:12:59 +02:00
cce0840cbf refactor(redraw): various simplifications 2022-10-05 20:12:58 +02:00
6679687bb3 refactor(redraw): no type argument in update_screen()
This was used in the past with assumption that curwin/curbuf
is "special" but this has not been true since basically forever
at this point.

Reduce NOT_VALID/CLEAR panic in options.lua . These should not
be set if an effect of the option is causing something
which by itself invokes redraw_later().
2022-10-05 20:11:13 +02:00
28e228d60d Merge pull request #20497 from zeertzjq/vim-8.2.2413
vim-patch:8.2.{2413,2421,2463,3884,3885,3886},9.0.0388: arglist patches
2022-10-05 23:11:36 +08:00
4ebcc6f822 vim-patch:9.0.0388: the do_arg_all() function is too long
Problem:    The do_arg_all() function is too long.
Solution:   Split the function in smaller parts. (Yegappan Lakshmanan,
            closes vim/vim#11062)
8894761daf
2022-10-05 22:40:28 +08:00
42afb9153a vim-patch:8.2.3886: can define autocmd for every event by using "au!"
Problem:    Can define autocmd for every event by using "au!".
Solution:   Check if a command is present also for "au!".
b6db146762
2022-10-05 22:40:28 +08:00
824a31cd0d vim-patch:8.2.3885: arglist test fails
Problem:    Arglist test fails.
Solution:   Adjust for locking the arglist for ":all".
679140c56b
2022-10-05 22:40:28 +08:00
dcdb7dca6a vim-patch:8.2.3884: crash when clearing the argument list while using it
Problem:    Crash when clearing the argument list while using it.
Solution:   Lock the argument list for ":all".
6f98371532
2022-10-05 22:40:28 +08:00
a66b12378b vim-patch:8.2.2463: using :arglocal in an autocommand may use freed memory
Problem:    Using :arglocal in an autocommand may use freed memory.
            (houyunsong)
Solution:   Check if the arglist is locked.
6bcb877ec1
2022-10-05 22:40:28 +08:00
0ae47000e0 vim-patch:8.2.2421: double free when using autocommand with "argdel"
Problem:    Double free when using autocommand with "argdel". (Houyunsong)
Solution:   Add the arglist_locked flag.
5ed58c7b70
2022-10-05 22:40:28 +08:00
c64acad4e2 vim-patch:8.2.2413: crash when using :all while using a cmdline window
Problem:    Crash when using :all while using a cmdline window. (Zdenek Dohnal)
Solution:   Disallow :all from the cmdline window.
bb4b93ed85

Use test from lastest Vim instead.
2022-10-05 22:40:23 +08:00
548a4e2587 docs(docstrings): fix runtime type annotations 2022-10-05 15:25:03 +02:00
1f2ded459a Merge pull request #20494 from bfredl/shadatest
test(shada): fix shada syntax definitions test.
2022-10-05 14:58:27 +02:00
18afacee1d feat(docs): format parameters as a list #20485
Problem:
The {foo} parameters listed in `:help api` and similar generated docs,
are intended to be a "list" but they aren't prefixed with a list symbol.
This prevents parsers from understanding the list, which forces
generators like `gen_help_html.lua` to use hard-wrapped/preformatted
layout instead of a soft-wrapped "flow" layout.

Solution:
Modify gen_vimdoc.py to prefix {foo} parameters with a "•" symbol.
2022-10-05 05:15:55 -07:00
9d8546e0c5 test(shada): fix shada syntax definitions test
These tests contained errors due to synstack() and friends do not ensure
syntax state is fully synced. Actually expecting what the user will
see with a screen test does ensure it is fully synced.
2022-10-05 13:46:52 +02:00
f572718480 Merge pull request #20493 from bfredl/windowtest
test(api): migrate screenchar() test in in window API to screen test
2022-10-05 12:10:40 +02:00
fc1f84c4c5 test(api): migrate screenchar() test in in window API to screen test
This produces actual output in case of regressions.
2022-10-05 11:32:13 +02:00
06f4edc864 vim-patch:partial:f269eabc6c4f (#20470)
Update runtime files
f269eabc6c
2022-10-05 10:56:53 +02:00
759259e8af Merge pull request #20490 from zeertzjq/vim-9.0.0656
vim-patch:9.0.{0656,0661}: 'fillchars' "lastline"
2022-10-05 07:25:30 +08:00
98bb2c1930 vim-patch:9.0.0661: multi-byte "lastline" in 'fillchars' does not work properly
Problem:    Multi-byte "lastline" item in 'fillchars' does not work properly
            when the window is two columns wide.
Solution:   Compute the text length correctly. (closes vim/vim#11280)
18b3500b8c
2022-10-05 06:59:05 +08:00
ddc363dce9 vim-patch:9.0.0656: cannot specify another character to use instead of '@'
Problem:    Cannot specify another character to use instead of '@' at the end
            of the window.
Solution:   Add "lastline" to 'fillchars'. (Martin Tournoij, closes vim/vim#11264,
            closes vim/vim#10963)
4ba5f1dab6

Use latest code in drawscreen.c instead.
2022-10-05 06:59:05 +08:00
6abb481051 fix(docs): missing "(" in :help HTML
Problem:
Since eba7b5b646
any opening paren and its leading whitespace " (" are missing in the
generated HTML. Example:

    Use ":qa!<Enter>" (careful, all changes are lost!).
                     ^^missing
    Position the cursor on a tag (e.g. bars) and hit CTRL-].
                                ^^missing

Solution:
The main recursive loop only processes named children, so check
named_child_count() instead of child_count().  Then anonymous nodes
won't get lost.
2022-10-04 21:15:06 +02:00
b075f49d92 feat(lsp): add bufnr option to lsp.start (#20473) 2022-10-04 20:44:19 +02:00
c651152a9d fix(build): "make clean" fails
Problem:
"make clean" fails since 03bc23de36.

    make -C runtime/doc clean
    make[1]: *** No rule to make target `clean'.  Stop.
    make: *** [clean] Error 2

Solution:
Update the "clean" target.
2022-10-04 18:37:59 +02:00
179d2d67d8 Merge #20412 feat(docs): HTML generator 2022-10-04 11:16:07 -04:00
03bc23de36 feat(gen_help_html.lua): remove old AWK scripts
These files are no longer needed since gen_help_html.lua is working
fairly well.

ref https://github.com/neovim/neovim/pull/11967
2022-10-04 16:49:17 +02:00
088abbeb6e feat(docs): nested lists in HTML, update :help parser
- Docs HTML: improvements in https://github.com/neovim/tree-sitter-vimdoc
  allow us to many hacks in `gen_help_html.lua`.
- Docs HTML: support nested lists.
- Docs HTML: avoid extra newlines (too much whitespace) in old
  (preformatted) layout.
- Docs HTML: disable golden-grid for narrow viewport.
- Workaround for https://github.com/neovim/neovim/issues/20404

closes https://github.com/neovim/neovim/issues/20404
2022-10-04 16:49:17 +02:00
28fbdd3385 fix(ui): msg_ext_set_kind for nvim_echo (#20476) 2022-10-04 15:22:42 +02:00
04f763b208 build(deps): bump LuaJIT to HEAD - 6c4826f12 (#20478) 2022-10-04 14:00:27 +02:00
a93ff5fc69 Merge pull request #20467 from zeertzjq/vim-8.2.2316
vim-patch:8.2.2316: Vim9: cannot list a lambda function
2022-10-04 07:54:42 +08:00
71497c164d test: add test for :function followed by <lambda> 2022-10-04 07:31:48 +08:00
0f2ead02c8 vim-patch:8.2.2316: Vim9: cannot list a lambda function
Problem:    Vim9: cannot list a lambda function.
Solution:   Support the <lambda>9 notation, like :disassemble. (closes vim/vim#7634)
b657198cb3
2022-10-04 07:16:40 +08:00
51d379d40d docs(shell): mention "&" for piping with powershell #20459
New behaviour since PR #19438
2022-10-03 13:14:18 -07:00
56998feebd Merge #20154 build: cmake cleanup 2022-10-02 19:20:40 -04:00
67e57d21b3 docs: refer to vim.lsp.start() in LSP issue template #20422
The nvim-lspconfig minimal_init.lua is not exactly minimal.
2022-10-02 16:08:42 -07:00
085fa68b5e feat(l10n): update Turkish translations (#20444) 2022-10-02 18:14:47 +02:00
2f80839cfe build: only generate compilation database for the nvim target (#20449)
Some tools like clang-tidy get confused and repeat unnecessary work if
there are multiple entries with the same name.

This will only generate a compilation database for cmake version 3.20
and above. Generating a compilation database is only necessary for
development, so we don't need to maintain compatibility with the minimum
required version.

Closes https://github.com/neovim/neovim/issues/10632
2022-10-02 17:17:40 +02:00
fbc66d798c build: define EP_PREFIX property
This is just to avoid the boilerplate of definining PREFIX for
each dependency.
2022-10-02 12:47:14 +02:00
59d5f692f8 build: rely on builtin cmake downloading rather than custom script
DownloadAndExtractFile.cmake was initially introduced as a workaround to
avoid the massive amounts of logs generated by the download progress.
This is not a problem anymore as ExternalProject_Add has had the
DOWNLOAD_NO_PROGRESS option since cmake version 3.1.
2022-10-02 12:39:48 +02:00
913651d1f1 build: remove unnecessary translation-related code
The commands run in cmake script mode (-P) can simply be run in the main
cmake run instead.
2022-10-02 12:39:20 +02:00
543f939773 build: remove url for 32-bit winyank
We don't support 32bit Windows anymore, so it's not needed. Also remove
TargetArch.cmake and related code as we don't need architecture
detection for the same reason.
2022-10-02 12:39:20 +02:00
3ce325cfa2 build: remove code for cross-compilation
We don't support cross-compilation at the moment, so these can be safely
removed.
2022-10-02 12:39:20 +02:00
06addcfaa9 build: remove unused variable CMAKE_C_COMPILER_ARG1
It was set in file cmake/i386-linux-gnu.toolchain.cmake which has been
removed since we don't use Travis anymore.
2022-10-02 12:39:20 +02:00
dd35bc2840 build(deps): bump Luv to HEAD - 80c8c00ba (#20433) 2022-10-02 12:19:42 +02:00
816026ba10 build(deps): bump libuv to HEAD - f610339f7 (#20445)
also remove libuv-disable-shared patch
2022-10-02 12:08:29 +02:00
0643645d5c fix(folds): fix fold marker multibyte comparison (#20439) 2022-10-02 16:32:33 +08:00
dd1c613d0b Merge pull request #20429 from zeertzjq/vim-9.0.0620
vim-patch:9.0.{0620,0622}: matchaddpos() can only add up to 8 matches
2022-10-02 07:53:41 +08:00
cb310d2901 vim-patch:9.0.0622: matchaddpos() can get slow when adding many matches
Problem:    matchaddpos() can get slow when adding many matches.
Solution:   Update the next available match ID when manually picking an ID and
            remove check if the available ID can be used. (idea by Rick Howe)
9f573a8df0
2022-10-02 07:28:38 +08:00
85c7d4f7a9 vim-patch:9.0.0620: matchaddpos() can only add up to 8 matches
Problem:    matchaddpos() can only add up to 8 matches.
Solution:   Allocate the array of positions. (closes vim/vim#11248)
50faf02f43
2022-10-02 07:28:38 +08:00
01721aaa66 Merge #19438 from 3N4N/fix/pwsh
Reverts #16271
Fixs #15913

Problem:
Since #16271, `make_filter_cmd` uses `Start-Process` cmdlet to execute the user
provided shell command for `:%!`. `Start-Process` requires the command to be
split into the shell command and its arguments. This was implemented in #19268
by parsing (splitting the user-provided command at the first space) which didn't
handle cases such as --
  - commands with escaped space in their filepath
  - quoted commands with space in their filepath

Solution: Use piping.

The total shell command formats (excluding noise of unimportant parameters):

1. Before #16271
    ```powershell
    pwsh -C "(shell_cmd) < tmp.in | 2>&1 Out-File -Encoding UTF8 <tmp.out>"
    # not how powershell commands work
    ```
2. Since #16271
    ```powershell
    pwsh -C "Start-Process shell_cmd -RedirectStandardInput <tmp.in> -RedirectStandardOutput <tmp.out>"
    # doesn't handle executable path with space in it
    # doesn't write error to <tmp.out>
    ```
3. This PR
    ```powershell
    pwsh -C "& { Get-Content <tmp.in> | & 'path\with space\to\shell_cmd.exe' arg1 arg2 } 2>&1 | Out-File -Encoding UTF8 <tmp.out>"
    # also works with forward slash in the filepath
    # also works with double quotes around shell command
    ```

After this PR, the user can use the following formats:

    :%!c:\Program` Files\Git\usr\bin\sort.exe
    :%!'c:\Program Files\Git\usr\bin\sort.exe'
    :%!"c:\Program Files\Git\usr\bin\sort.exe"
    :%!"c:\Program` Files\Git\usr\bin\sort.exe"

They can even chain different commands:

    :%!"c:\Program` Files\Git\usr\bin\sort.exe" | sort.exe -r

But if they want to call a stringed executable path, they have to provide the
Invoke-Command operator (&). In fact, the first stringed executable path also
needs this & operator, but this PR adds that behind the scene.

    :%!"c:\Program` Files\Git\usr\bin\sort.exe" | sort.exe -r | & 'c:\Program Files\Git\usr\bin\sort.exe'

## What this PR solves

- Having to parse the user-provided bang ex-command (for splitting into shell
  cmd and its args).
- Removes a lot of human-unreadable `#ifdef` blocks.
- Accepting escaped spaces in executable path.
- Accepting quoted string of executable path.
- Redirects error and exception to tmp.out (exception for when `wrong_cmd.exe
  not found`)

## What this PR doesn't solve

- Handling wrongly escaped path to executable, which the user may pass because
  of cmdline tab-completion. #18592

## Edge cases
- (Not handled) If the user themself provides the `&` sign (means `call
  this.exe` in powershell)
- (Not handled) Use `-Encoding utf8` parameter for `Get-Content`?
- (Handled) Doesn't write to tmp.out if shell command is not found.
    - fix: use anonymous function (`{wrong_cmd.exe}`).

## Changes other than `make_filter_cmd()` function

- Encoding for piping to external executables. See BOM-less UTF8:
  https://github.com/PowerShell/PowerShell/issues/4681
2022-10-01 17:29:15 -04:00
618d21fcc9 ci(publish-winget): use versioned tags for action #20417 2022-10-01 10:13:44 -07:00
a5e347ce1d refactor(diagnostic): remove deprecated function (#20423) 2022-10-01 09:36:11 -06:00
9353e2f7ef vim-patch:8.2.2542: highlight of char beyond line end is not correct (#20424)
Problem:    Highlight of char beyond line end is not correct. (Chuan Wei Foo)
Solution:   Fix counting NUL as one cell.  Draw one more character if the EOL
            is part of the match. (closes vim/vim#7883)
41f0895c6e

Reorder test_search.vim to match Vim.
2022-10-01 21:29:54 +08:00
e54541f7f9 refactor(lsp): remove deprecated lsp functions (#20421) 2022-10-01 11:35:36 +02:00
afb7efb373 Merge pull request #20414 from dundargoc/ci/release/matrix
ci(release): remove unnecessary matrix strategy
2022-09-30 13:57:54 -04:00
47e60da721 build(nix): change the pkgs to final, add new version of libvterm (#20410) 2022-09-30 19:25:12 +02:00
4396c3ef2c version bump 2022-09-30 17:26:25 +02:00
d367ed9b23 NVIM v0.8.0
BREAKING CHANGES
- Remove 'insertmode' 'remap' and 'terse' options
- highlight: Rename attributes to match Vim (#19159)
- highlight: Error on invalid names and allow '.' and '@'
- terminal: Drop winpty, require Windows 10 #18253
- treesitter: Use @foo.bar style highlight groups
- treesitter: Do not merge queries by default (#20105)

FEATURES
- runtime: Enable filetype.lua by default (#19216)
- Add `undo!`
- Add "prerelease" to version dict
- Click support for 'statusline', 'winbar' #18650
- Add preview functionality to user commands
- allow cmdheight=0 (EXPERIMENTAL) #16251
- Stdpath('run'), /tmp/nvim.user/ #18993
- Add 'mousescroll' option (#12355)
- Allow :wincmd to accept a count (#19815)
- Multibuffer preview support for inccommand
- Man: Port to Lua (#19912)
- api: Ui options relevant for remote TUI
- api: Add `nvim_parse_cmd` And `nvim_cmd`
- api: Support handling stdin stream in remote ui
- api: Add `group_name` to `nvim_get_autocmds`
- api: Enable nvim_exec_autocmds to pass arbitrary data (#18613)
- api: Support pattern array for exec_autocmds
- api: Add `unsilent` to command APIs
- api: Add replace_keycodes to nvim_set_keymap (#19598)
- api: Add support for :horizontal modifier
- api: Add "move" to nvim_input_mouse
- api/ui: "ui_watched" option for ui-side extmarks
- build: Add_glob_target runs only on changed files #19070
- checkhealth: Check for slow shell #17829
- defaults: Session data in $XDG_STATE_HOME #15583
- defaults: Search selection by * and # in visual mode (#18538)
- defaults: Nnoremap & :&&<CR> #19365
- defaults: enable mouse by default (set mouse=nvi)  #19290
- diagnostic: Pass diagnostics as data to DiagnosticChanged autocmd (#20173)
- docs: Gen_help_html.lua
- edit: Insert an unsimplified key using CTRL-SHIFT-V
- treesitter: Full support for spelling
- filetype: Convert more patterns to filetype.lua
- filetype: Remove side effects from vim.filetype.match (#18894)
- filetype: Expand environment variables in filetype patterns (#20145)
- fs: Add vim.fs functions: parents() dirname() basename() dir() find() normalize()
- highlight: Implement CurSearch highlight
- highlight: Support scoped @spam.eggs.baked_beans groups
- input: Delay all simplifications
- l10n: Turkish translations #19441
- l10n: Improve zh_CN translations (#19483)
- lsp: Remove capabilities sanitization (#17814)
- lsp: Show feedback on empty hover response (#18308)
- lsp: Options to filter and auto-apply code actions (#18221)
- lsp: Add vim.lsp.buf.format (#18193)
- lsp: Add logging level "OFF" (#18379)
- lsp: Add LspAttach and LspDetach autocommands
- lsp: Add filter to vim.lsp.get_active_clients()
- lsp: Option to reuse_win for jump actions (#18577)
- lsp: Add a start function (#18631)
- lsp: Send didChangeConfiguration after init (#18847)
- lsp: Defaults: tagfunc, omnifunc, formatexpr (#19003, #19677)
- lsp: Allow passing custom list handler to LSP functions that return lists (#19213)
- lsp: Provide feedback if server can't compute rename result (#19546)
- lsp: Add range option to code_action; deprecate range_code_action (#19551)
- lsp: Disable exit_timeout by default (#19672)
- lsp: Add tcp support
- lua: Vim.deprecate() #18320
- lua: Vim.cmd() with kwargs acts like nvim_cmd() #18523
- lua: Allow some vim script functions to run in fast callbacks
- lua: Measure require in --startuptime
- lua: Allow vim.cmd to be indexed (#19238)
- lua: Print source locations of lua callbacks (#19597)
- lua: Add vim.iconv (#18286)
- lua: Vim.ui_attach to get ui events from lua (EXPERIMENTAL)
- man.vim: List command flags in "gO" outline #17558
- mappings: Do not replace existing mapping for simplified form
- mappings: Allow special keys and modifiers in <Cmd> mapping
- mapset: Support restoring "replace_keycodes" and "desc"
- mapset: Support restoring Lua callback (#20024)
- marks: Restore viewport on jump #15831
- nvim_create_user_command: Pass structured modifiers to commands
- pum: Pretend 'mousemoveevent' is set when showing right-click menu
- server: Set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
- server: Instance "name", store pipes in stdpath(state)
- term: Add support for libvterm >= 0.2
- terminal: Implement <c-\><c-o> for terminal mode
- terminal: Recognize underdouble and undercurl
- terminfo: Bump built-in terminfo entries (#18570)
- treesitter: Allow customizing language symbol name
- treesitter: Add ability to retreive a tree/node given a range
- treesitter: Upstream node methods from nvim-treesitter
- treesitter: Include language in invalid query error (#14053)
- treesitter: Bundle Lua parser and queries
- treesitter: Add viml parser and queries
- treesitter: Add injections
- treesitter: Add vim.treesitter.start(), enable for Lua
- treesitter: Bundle :help parser and queries
- tui: Query terminal for CSI u support (#18181)
- tui: Recognize keypad keys when using kitty keyboard protocol
- tui: Try terminfo for [re]set_cursor_color OSC #19255
- tui: Allow grid and host to disagree on ambiguous-width chars (#19686)
- tui: Recognize sidescroll events (#19992)
- tui: Support 'mousemoveevent'
- ui: Add `'winbar'`
- ui: Clear message history explicitly with msg_history_clear event
- ui: Make right-click menu work properly with ext_multigrid
- ui: Allow to set the highlight namespace per window
- ui: Use msg_grid based implementation for cmdheight=0
- ui-ext: Make 'mousemoveevent' a ui_option
- eval: Make Lua Funcref work as method and in substitute() (#20217)
- eval: Input() support any type for "cancelreturn" in a dict (#19357)

BUG FIXES
- Show autocmd output when F is in shortmess (#18251)
- Has() should preserve v:shell_error #18280
- Suppress "is a directory" messages with shortmess 'F' (#18296)
- Display global statusline correctly with ext_messages
- Correct nlua_wait error message #18867
- Right-click in clickable statusline #19252
- Remote UI may get invalid 'pumblend' value #19379
- Assertion failure when requiring missing module in autocmd
- api: Nvim_eval_statusline should validate input #18347
- api: Check error after getting win/buf handle (#19052)
- api: Check for inclusive buffer line index out of bounds correctly (#19056)
- api: Change default value of 'pattern' in nvim_exec_autocmds (#19115)
- api: Do not switch win/buf if getting option in current win/buf (#19383)
- api: Make nvim_set_hl(ns=0, ...) redraw screen properly
- api: Nvim_set_hl bail out on invalid group name (#20021)
- api: Notify dict watchers on nvim_set_var and vim.g setter
- api/command: Fargs behavior when no arguments are passed (#19862)
- autocmds: Separate command from desc (#18617)
- buffer: Disable buffer-updates before removing from window #18933
- build: Missing definitions for sizeof macros #16393
- build: Only pass -municode if MINGW #19049
- build: Strip trailing newline from variable (#19084)
- build: Don't disable byte precompilation on debug builds
- build: Fails if git is missing #19366
- charclass: Make behavior with empty str match latest Vim (#19749)
- checkhealth: Skip vim.health #18816
- ci: Remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
- cmd: Make :-tabmove work with modifiers (#18447)
- cmdheight=0: Various issues part3 #19816
- cmdline: Fix passing -1 as char
- cmdline: Trigger CmdlineEnter and ModeChanged earlier (#19474)
- cmdline: Do not trigger completion at wrong time (#19920)
- cmdline: Don't send invalid cursor with incsearch and cmdheight=0
- column: Move sign sentinel after inserting/deleting lines (#20400)
- completion: Remove wrong FUNC_ATTR_NONNULL_ALL (#19627)
- diagnostic: Use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
- diagnostic: Check for negative column value (#18868)
- diagnostic: Remove buf from cache on `BufWipeout` (#20099)
- diagnostic: Populate data key in DiagnosticChanged autocmd in reset (#20207)
- docs: Correct obsolete note about 'writedelay' in dev docs
- docs: Remove internal function from docs
- edit.c: Indentkeys double indent after "!" #12894
- eval: Check for v:lua when calling callback (#19855)
- eval/f_getmatches: Return empty list for invalid win argument (#18893)
- events: Make CursorHold behave as documented
- ex_cmds: Correct flags for :const (#19387)
- exceptions: Restore `did_throw` (#20000)
- exmode: Do not throttle messages when pressing enter to print line
- extmarks: Make virt_lines always start at 0 virtcol
- filetype: Fix and improve filetype patterns
- fillchars: Change fallback after setcellwidths()
- float: Make `screen*()` functions respect floating windows
- float: Fix glitch when making float window with border a split
- float: Fix mouse drag position if float window turned to a split
- folds: Fix fold regression with :move (#18685)
- folds: Fix fold remains when :delete makes buffer empty (#19673)
- ftdetect: Source plugins in autogroup (#18237)
- gen_vimdoc.py: Handle missing luajit
- getchar: Flush screen before doing a blocking wait
- handlers: More specific error messages (#16772)
- health: Correct shada file path #18603
- health: Handle non-existent log file #18610
- highlight: Use ctermbg/fg instead of bg/fg when use_rgb=false #18982
- highlight: Add missing 'nocombine' to nvim_get_hl apis (#19586)
- highlight: Set the window namespace when redrawing statusline
- hl: Set Normal hl group sg_attr value #18820
- hl: Return cterm fg/bg even if they match Normal #18981
- inccommand: Do not try to preview an ambiguous command (#18827)
- inccommand: Avoid crash if callback changes inccommand option (#18830)
- inccommand: Clear cmdpreview state if preview is not shown (#18923)
- inccommand: Skip split window if not enough room #18937
- inccommand: Never preview if parsing command failed (#18944)
- inccommand: Parse the command to check if it is previewable
- inccommand: Deal with unsynced undo (#20041)
- input: Allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885)
- input: Fix macro recording with ALT and special key (#18917)
- input: Use correct grid when restoring cursor for <expr> mapping (#19047)
- input: Do no reinterpret mouse keys with ALT modifiers
- input: Use click number of last click for mouse drag (#20300)
- inspect: Escape identifiers that are lua keywords (#19898)
- keywordprg: Default to :help if set to empty string (#19983)
- l10n: Improve zh_CN and zh_TW translations (#19969)
- log: Back even again
- logging: Skip recursion, fix crash #18764
- logging: Make logmsg() thread-safe again
- logging: Try harder to resolve Nvim "name" #19016
- lsp: Unify progress message handling (#18040)
- lsp: Fix unnecessary buffers being added on empty diagnostics (#18275)
- lsp: Fix infinite loop in resolved_capabilities deprecation message (#18333)
- lsp: Add missing bufnr argument (#18382)
- lsp: Fix rename capability checks and multi client support (#18441)
- lsp: Detach spawned LSP server processes (#18477)
- lsp: Perform client side filtering of code actions (#18392)
- lsp: Only send diagnostics from current buffer in code_action() (#18639)
- lsp: Respect global syntax setting in open float preview (#15225)
- lsp: Include cancellable in progress message table (#18809)
- lsp: Adjust offset encoding in lsp.buf.rename() (#18829)
- lsp: Set buflisted before switching to buffer (#18854)
- lsp: Fix multi client handling in code action (#18869)
- lsp: Small bugs in snippet-parser #18998
- lsp: Pcall nvim_del_augroup_by_name (#19302)
- lsp: Abort pending changes after flush when debouncing (#19314)
- lsp: Don't attach a client in lsp.start() if there is none (#19328)
- lsp: Account for initializing servers in vim.lsp.start (#19329)
- lsp: Move augroup define to if statement (#19406)
- lsp: Set workspace.configuration capability (#19548)
- lsp: Send didOpen if name changes on write (#19583)
- lsp: Prevent unexpected position jumps (#19370)
- lsp: Avoid  ^M character in hover window on Windows (#19640)
- lsp: Set end_col in formatexpr (#19676)
- lsp: Handle multiple clients with incremental sync (#19658)
- lsp: Fix some type annotations in lsp.rpc (#19714)
- lsp: Avoid pipe leaks if lsp cmd isn't executable (#19717)
- lsp: Handle nil client in onexit callback (#19722)
- lsp: Fix nil value error in get_group (#19735)
- lsp: Clean the diagnostic cache when buffer delete (#19449)
- lsp: When buffer detach remove buffer from client attached buffers (#20081)
- lsp: Schedule removal of client object (#20148)
- lsp: Support `false` result in handlers (#20252)
- lsp: Out of bounds error in lsp.util.apply_text_edits (#20137)
- lsp: Use correct function name in deprecated message (#20308)
- lsp: Create missing directory before creating file (#19835)
- lua: Don't mutate opts parameter of vim.keymap.del (#18227)
- lua: Stop pending highlight.on_yank timer, if any (#18824)
- lua: Highlight.on_yank can close timer in twice #18976
- lua: Clear got_int when calling vim.on_key() callback (#18979)
- lua: Don't leak memory on error
- lua: Double entries in :lua completion #19410
- lua: Make it possible to cancel vim.wait() with Ctrl-C (#19217)
- lua: Make ui_attach()/ui_detach() take effect immediately (#20037)
- lua: Make vim.str_utfindex and vim.str_byteindex handle NUL bytes
- lua: Free vim.ui_attach callback before lua close (#20205)
- lua: Fix architecture-dependent behavior in usercmd "reg" (#20384)
- mac: Use same $LANG fallback mechanism as Vim
- mac: Add CoreServices to flake.nix #18358
- man.vim: Q in "$MANPAGER mode" does not quit #18443
- maparg: Remove double allocation (#20033)
- mappings: Fix double-free when unmapping simplifiable Lua mapping
- mapset: Remove existing abbreviation of same lhs (#20320)
- mark: Set mark fnum from buffer (#19195)
- mark: Mark without a view restores at topline #19224
- mark: Fix unexpected cursor movements (#19253)
- mark: Give correct error message when mark is in another buffer (#19454)
- menu: Make :menu still print header when there are no menus
- messages: Add color when showing nvim_echo in :messages history
- messages: Do not crash on cmdheight=0 and g< redisplay
- messages: Validate msg_grid before silent! message with cmdheight=0
- mksession: Don't store floats in session #18635
- mouse: Click on global statusline with splits (#19390)
- mouse: Fix using uninitialized memory with K_MOUSEMOVE (#19480)
- mpack: Make sure a `bool` always is a `bool`
- normal: Fix segfault with bracket command jumping to a mark
- options: Properly free string options (#19510)
- options: Mark `winhighlight` as list style  (#19477)
- packaging: Remove excess forward slash in Wix Patch (#18121)
- paste: Ignore mappings in Cmdline mode (#18114)
- path: Path_is_url returns false for "foo:/" #19797
- powershell: Filter ":!" commands with args #19268
- pum: Make right drag in anchor grid to select work in multigrid UI (#19382)
- query: Fix unnatural order for inherits in treesitter queries (#20298)
- redraw: Make sure :redraw! redraws command line
- redraw: Handle switching to a tabpage with larger p_ch value
- redraw: Avoid unnecessary redraws and glitches with floats+messages
- redraw: Make redrawdebug=nodelta handle all the cases
- rpc: Break nvim_error_event feedback loop between two nvim instances
- runtime/genvimvim: Omit s[ubstitute] from vimCommand #18480
- screen: Restart win_update() if a decor provider changes signcols (#18768)
- screen: Check for col instead of vcol when drawing fold (#19572)
- session: Respect sessionoptions=terminal #19497
- shared: Avoid indexing unindexable values in vim.tbl_get() (#18337)
- signs: Priority of extmark signs (#19718)
- source: Make changing 'shellslash' change expand() result
- source: Fix expand('<sfile>') no longer works for Lua
- spell: Make setting 'encoding' clear word list
- spell: Correct spell move behavior without "noplainbuffer" (#20386)
- startup: Nvim with --clean should not load user rplugins
- substitute: Subtract number of backslashes later
- tabpage: Check if ROWS_AVAIL changed for resize (#19620)
- terminal: Invalid pointer comparison #18453
- terminal: Do not trim whitespace that is actually in the terminal (#16423)
- terminal: Scrollback delete lines immediately #18832
- terminal: Coverity USE_AFTER_FREE #18978
- terminal: Crash if TermClose deletes own buffer #19222
- terminal: Avoid reading over the end of cell.chars (#19580)
- terminal: Skip aucmd_win when checking terminal size (#19668)
- terminal: Adopt altscreen test for libvterm 0.2 changes
- terminfo: Disable smglr for vtpcon and conemu (#18855)
- termopen: Avoid ambiguity in URI when CWD is root dir (#16988)
- tests: Fix some screen.lua warnings
- tests: Fix some issues with ui/inccommand_spec.lua causing slowness
- tests: Unreliable parser_spec #18911
- tests: Check for EOF on exit of nvim properly
- tests: Missing clear() #18927
- tests: Remove misleading $TEST_PATH segment #19050
- tests: Remove irrelevant usage of display-=msgsep
- tests: Use pending_c_parser when needed
- tests: Indicate in test logs when nvim exit times out
- tmpdir: Invalid tempname() if username has slashes #19323
- treesitter: Create new parser if language is not the same as cached parser (#18149)
- treesitter: Bump match limit up
- treesitter: Offset directive associates range with capture (#18276)
- treesitter: Correct region for string parser (#18794)
- treesitter: New iter if folded
- treesitter: Don't error when node argument of predicate is nil (#19355)
- treesitter: Free memory on removing parser (#19933)
- treesitter: More efficient node:root()
- treesitter: Make it get_captures_at_position
- treesitter: Do not link @error by default
- treesitter: Don't support legacy syntax in start()
- treesitter: Use the right loading order for base queries (#20117)
- treesitter: Prevent endless loop on self-inheritence
- treesitter: Return full metadata for get_captures_at_position (#20203)
- ts: Do not clobber spelloptions (#20095)
- tui: Update modifyOtherKeys reporting (#18158)
- tui: Disable extended keys before exiting alternate screen (#18318)
- tui: Piping nodejs to nvim breaks input handling #18932
- tui: Resize at startup #17795
- tui: Add fixups for hterm family #19078
- tui: Handle padding requirements for visual bell (#20238)
- ui: Require window-local value to show winbar on floating windows (#18773)
- ui: Do not call showmode() when setting window height (#18969)
- ui: Set redraw_cmdline when setting window height (#19630)
- ui: Don't allow decor provider with ns_id==0
- ui: Ui compositor does not correctly free event callbacks
- ui: Allow redrawing statusline when msgsep is used (#20337)
- ui: Redraw end of buffer if last line is modified (#20354)
- unittests: Coredump when running unit tests #18663
- usercmd: Also check for whitespace after escaped character (#19942)
- version.c: Mark N/A vim patches #18587
- vim.ui.input: Accept nil or empty "opts"  #19109
- window: Close floats first when closing buffer in other tab (#20284)
- window: Fix equalization with cmdheight=0 (#20369)
- windows: Stdpath("state") => "nvim-data" #18546
- windows: Exepath, stdpath return wrong slashes #19111
- winhl: Do not crash when unsetting winhl in just opened window
- Make :undo! notify buffer update callbacks (#20344)
- eval: Make Vim functions return inner window width and height (#19743)

BUILD SYSTEM
- Bump Doxyfile to minimum required version 1.9.0 #18118
- Bump msgpack to 4.0.0
- Enable EXITFREE on Debug builds (#17783)
- Add formatting targets for c and lua files (#19488)
- clang-format: Align with project style #18192
- clint: Remove all python2-isms with pyupgrade
- clint: Remove "function size is too large" warning
- clint: Remove rules for includes, whitespace, tabs #18611
- cmake: Simplify and speed up the uninstall target
- cmake: Simplify def_cmd_target function
- cmake: Use glob_wrapper instead of file(GLOB in main CMakeLists
- cmake: Fix static `libintl` test on macOS
- deps: Bump LuaJIT, Luv and libuv
- deps: Support universal builds on macOS
- deps: Bump tree-sitter to v0.20.7 (#20067)
- deps: Bump tree-sitter parsers
- deps: Bump required libvterm to v0.3 (#20222)
- deps: Require libtermkey version 0.22
- deps: update neovim-qt, win32tools.zip

PERFORMANCE
- Only redraw for CurSearch when it is currently in use
- highlight: Allocate permanent names in an arena for fun and cache locality
- highlight: Use binary search to lookup RGB color names
- map: Visit only one hash bucket instead of all, like an actual hash table
- memory: Get rid of extraneous heap allocations
- memory: implement arena memory allocation with a shared freelist
- memory: Use an arena for RPC decoding and some API return values
- messages: Don't call ui_flush() per message line in various places
- treesitter: Use a reuse list for query cursors
- ui: Reduce allocations when encoding and decoding "redraw" events
- ui: Avoid ui_flush() work in headless mode

REFACTOR
- checkhealth: Rename to vim.health, move logic to Lua #18720
- Add pure attribute to pure functions
- Replace char_u variables and functions with char
- Enable -Wconversion warning for all Nvim source files
- Add warnings for deprecated functions (#18662)
- Change type of linenr_T from long to int32_t
- Use nvim_get/set_option_value for vim.{b,w}o
- Remove functions marked for deprecation in 0.8 (#19299)
- Rename function prefix mb to the more accurate utf_cp (#19590)
- Remove some unused includes
- Change remaining sourcing_name/sourcing_lnum to exestack
- Change FALSE/TRUE to false/true
- api: Use a hashy hash for looking up api method and event names
- api: Use a unpacker based on libmpack instead of msgpack-c
- api: restructure api/vim.c and api/private/helpers.c code in separate files
- api: Remove redundant fields of CmdParseInfo
- aucmd: Call define_autocmd() directly for default autocmds
- ci: Cleanup release.yml #19132
- cmd: Format do_one_cmd()
- cmd: Hoist out some code into functions
- cmd: Unify execute_cmd with do_one_cmd
- decor: Use decor levels properly
- drawline.c: Factor out utf8 multibyte check
- eval: Use Hashy McHashFace instead of gperf
- eval.c: Resolve all clint issues (#19774)
- eval/funcs.c: Resolve all clint errors
- events: Remove unnecessary fudging of updating_screen
- ex_cd: Add an early return to fix clint warning
- ex_docmd.c: Resolve most clint errors (#19775)
- filetype: Allow vim.filetype.match to accept buf and filename (#19114)
- highlight: Make hlattrs2dict always use pre-allocated dict
- log: Simplify log_path_init #18898
- log: Use msg_schedule_semsg #18950
- lsp: Remove redundant client cleanup (#18744)
- lsp: Make the use of local aliases more consistent
- lsp: Use autocmd api (#19407)
- lsp: Factor out read_loop function
- lsp: Encapsulate rpc uv handle
- lsp: Extract rpc client from rpc.start
- lua: Replace hard-coded gsub with vim.pesc() (#18407)
- lua: Reformat with stylua 0.14.0 (#19264)
- lua: Git-blame-ignore stylua update PR (#19273)
- lua: Replace vim.cmd use with API calls (#19283)
- map: Simplify free_all_mem handling
- map: Statically initialize maphash array
- map: Simplify add_map params
- normal: Convert function comments to doxygen format
- object: Get rid of redundant FIXED_TEMP_ARRAY
- ops: Doxygen docstrings #17743
- option: DRY get/set option value #19038
- plines: Use a struct for chartabsize state
- provider: Use list comprehension #19027
- regexp_nfa.c: Match where Vim calls fopen() (#18778)
- runtime: Convert dist#ft functions to lua (#18247)
- runtime: Convert more dist#ft functions to lua (#18430)
- runtime: Convert the remaining dist#ft functions to lua (#18623)
- runtime: Port remaining patterns from filetype.vim to filetype.lua (#18814)
- runtime: Refactor filetype.lua (#18813)
- runtime: Port scripts.vim to lua (#18710)
- setcellwidths: Use TV_LIST_ITEM_NEXT properly
- signs: Handle non-sign attrs separately (#19784)
- tests: Introduce testprg()
- treesitter: Get_{nodes,captures}_at_{position,cursor}
- typval: Change FC_CFUNC abstraction into FC_LUAREF
- ui: Simplify stdin handling
- uncrustify: Format all c code under /src/nvim/
- vim.opt: Remove del arg
- vim.opt: Unify vim.bo/wo building
- vim.opt: Optimize append/prepend/remove
- Format runtime with stylua
2022-09-30 17:15:13 +02:00
f2482b3b53 fix: :! pwsh redirection for command not found
Problem:
If the shell command passed to the filtered bang command isn't found,
the error isn't redirected to the temp.out file when shell is set to
powershell.

Solution: Use anonymous function with Invoke-Command operator (&).
2022-09-30 21:08:45 +06:00
b4d42bb905 fix: make_filter_cmd for :! powershell
Problem:
`Start-Process` requires the command to be split into the shell
command and its arguments. Previously it was done by parsing, which
didn't handle cases such as
  - commands with escaped space in their filepath
  - quoted commands with space in their filepath

Solution:
Use
  - `pwsh -Command` instead of `Start-Process`
  - `Get-Content` instead of `-RedirectStandardInput`
  - `Out-File` instead of `-RedirectStandardOutput`
2022-09-30 21:07:45 +06:00
892da763bb fix(dist): update neovim-qt, win32tools.zip #20413
- fix regression by #20411
  - `diff.exe` is required for non-default 'diffopt' (diffopt=filler, diffopt=context, …)
  - the names of some required nvim-qt DLLs changed
2022-09-30 07:53:10 -07:00
63aea857a9 ci(release): remove unnecessary matrix strategy
We only have one Windows release job, so the matrix setup isn't needed.
2022-09-30 16:40:44 +02:00
ad6af3c1a9 dist(win): update neovim-qt, win32tools.zip #20411
- update curl.exe (+ ca bundle), tee.exe, xxd.exe
- remove diff.exe because `diffopt=internal` is now the default
- update neovim-qt
2022-09-30 04:24:46 -07:00
1839848808 Merge pull request #20409 from bfredl/unicode-tables
feat: update unicode tables
2022-09-30 11:08:38 +02:00
37a1c0914d feat: update unicode tables 2022-09-30 10:45:51 +02:00
5399513fd0 Merge pull request #20343 from zeertzjq/virt-lines-vcol
fix(extmarks): make virt_lines always start at 0 virtcol
2022-09-30 10:15:51 +02:00
b414e9fdbb Merge pull request #20364 from zeertzjq/parse-cmd-omit
fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported
2022-09-30 09:59:45 +02:00
df646572c5 docs: fix typos (#20394)
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-30 09:53:52 +02:00
9cf252e121 Merge pull request #20387 from famiu/feat/nvim_cmd/buffer-args
feat(nvim_cmd)!: allow using first argument as count
2022-09-30 09:43:18 +02:00
cb62592bcb fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported 2022-09-30 11:24:23 +08:00
33dd917d7f fix(filetype): add missing return to changelog detection function (#20403) 2022-09-29 16:26:19 +02:00
94718e479d fix(query): fix unnatural order for inherits in treesitter queries (#20298)
close #20297
2022-09-29 16:25:07 +02:00
e46eef75ac feat(nvim_cmd): allow using first argument as count
Allows `nvim_cmd` to use the first argument as count for applicable
commands. Also adds support for non-String arguments to `nvim_cmd`.
2022-09-29 19:31:40 +06:00
f9228577e8 ci: convert CRLF to LF (#20389) 2022-09-29 14:31:12 +02:00
d9f5940997 Merge #20402 feat(docs): improve :help HTML generator 2022-09-29 07:46:14 -04:00
563bc39aac feat(docs): fixes for :help HTML generator
Generate correct leading whitespace for argument, taglink, tag, etc.
2022-09-29 13:26:12 +02:00
561c99c86a feat(treesitter): update :help parser 2022-09-29 13:08:43 +02:00
c7cc6591c1 Merge pull request #20381 from cryptomilk/asn-vterm
build(deps): require libvterm version 0.3
2022-09-29 07:00:44 -04:00
0f04c14c0d Merge pull request #20382 from cryptomilk/asn-termkey
build(deps): require libtermkey version 0.22
2022-09-29 06:59:28 -04:00
45707c1eae fix(api): fix nvim_cmd crash with filename expansion (#20397) 2022-09-29 16:04:14 +08:00
1cf44d6f57 fix(column): move sign sentinel after inserting/deleting lines (#20400) 2022-09-29 15:48:39 +08:00
a80ab395aa test: add a Lua test for #17501 (#20392) 2022-09-29 08:56:00 +08:00
e8ff432922 Merge pull request #20390 from bfredl/doc2
docs: mark cmdheight=0 and vim.ui_attach as experimental
2022-09-28 19:00:54 +02:00
268bad4798 Merge #20352 feat(gen_help_html.lua): adapt to new parser 2022-09-28 12:55:52 -04:00
16336c486e feat(gen_help_html.lua): adapt to new parser
- adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16
- numerous other generator improvements
2022-09-28 18:34:20 +02:00
7b4c49888a feat(gen_help_html.lua): put commit-id in footer 2022-09-28 17:31:59 +02:00
d9ed8d1110 feat(treesitter): update :help parser and queries 2022-09-28 17:31:56 +02:00
cd96fe06e1 build(deps): bump treesitter-vimdoc to v1.0.0 2022-09-28 16:39:42 +02:00
a5effcedd2 build(deps): bump help parser and queries (#20388) 2022-09-28 16:29:35 +02:00
47b821eccf docs: mark cmdheight=0 and vim.attach_ui as experimental
These will require further work for user experience out of the box
during the 0.9 cycle.
2022-09-28 16:18:04 +02:00
bafeb32b95 fix(spell): correct spell move behavior without "noplainbuffer" (#20386) 2022-09-28 21:55:22 +08:00
3965210055 Merge pull request #20375 from famiu/refactor/get_option
refactor: replace unnecessary helper functions in optionstr.c
2022-09-28 14:28:12 +02:00
9ca313fb96 vim-patch:9fbdbb814f4a (#20376)
Update runtime files
9fbdbb814f

Skip ftplugin/vim.vim (vim9script change)
Drop indent/vim.vim and autoload/dist/vimindent.vim (vim9script rewrite)
2022-09-28 12:48:36 +02:00
35e2c4a2ed fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384)
I don't think using an integer as a NUL-terminated string can work on
big-endian systems, at least.

This is also not tested. Add a test.

Also fix a mistake in the docs of nvim_parse_cmd.
2022-09-28 18:27:59 +08:00
eb4844b5ed build(macos): restore and test universal build (#20383)
Build tree-sitter parsers for arm64 as well as x86
Check that all created binaries contain both architectures
2022-09-28 11:06:11 +02:00
d7358118aa fix: compiler warnings from clang 15 (#20321)
Add -Wno-strict-prototypes flag to external dependencies to suppress
cjson warnings. These needs to be fixed upstream first.
2022-09-28 10:53:44 +02:00
6917a2e569 build(deps): require libvterm version 0.3 2022-09-28 10:13:48 +02:00
6427dc8ab6 build(deps): require libtermkey version 0.22
Reduces #ifdef code.
2022-09-28 09:41:18 +02:00
4b7904d16b refactor: replace unnecessary helper functions in optionstr.c
Replaces unnecessary helper functions in `optionstr.c` such as
`get_option_flags()`, `get_option_fullname()`, `set_option_flag()`,
`is_global_option()`, etc. with a single `get_option()` helper function
that allows direct access to the `options` array.

Also refactors `f_exists()` to use `get_varp_scope` instead of using
`get_option_tv`. This opens up the path for removing `getoptions_T`
altogether later down the line since the hidden option logic is no
longer needed.
2022-09-28 09:29:43 +06:00
e6c214033a fix(window): fix equalization with cmdheight=0 (#20369) 2022-09-28 06:22:11 +08:00
d84abfeb1d Merge pull request #15373 from smolck/lua-notify-dictwatcher
fix(nvim): notify dict watchers on nvim_set_var and vim.g setter
2022-09-27 18:16:58 +02:00
f46060c4cb vim-patch:9.0.0604: luacheckrc file is not recognized (#20371)
Problem:    Luacheckrc file is not recognized.
Solution:   Use lua filetype for luacheckrc. (closes vim/vim#11236)
49c311c9b1
2022-09-27 16:10:19 +02:00
6afe5cce79 ci(backport): bump to backport-action@v0.0.8 #20366
Primary bug fix is allowing backports with empty PR description.
2022-09-27 05:53:48 -07:00
c7d30c152d fix(api): notify dict watchers on nvim_set_var and vim.g setter
Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-09-27 14:47:53 +02:00
4278a2d359 Merge pull request #20368 from clason/vim-9.0.0599
vim-patch:9.0.0602: new TypeScript extensions are not recognized

Problem:    New TypeScript extensions are not recognized.
Solution:   Recognize .mts and .cts files. (closes vim/vim#11237)
7fc6c0e4da

vim-patch:9.0.0600: GYP files are not recognized

Problem:    GYP files are not recognized.
Solution:   Recognize GYP files. (closes vim/vim#11242)
d324742292

vim-patch:9.0.0599: latexmkrc files are not recognized

Problem:    Latexmkrc files are not recognized.
Solution:   Use Perl filetype for latexmkrc files. (closes vim/vim#11241)
cde0319385
2022-09-27 14:02:10 +02:00
fe0727a1bf vim-patch:9.0.0602: new TypeScript extensions are not recognized
Problem:    New TypeScript extensions are not recognized.
Solution:   Recognize .mts and .cts files. (closes vim/vim#11237)
7fc6c0e4da
2022-09-27 13:04:34 +02:00
e176f9dacf vim-patch:9.0.0600: GYP files are not recognized
Problem:    GYP files are not recognized.
Solution:   Recognize GYP files. (closes vim/vim#11242)
d324742292
2022-09-27 12:39:09 +02:00
760a8754c0 vim-patch:9.0.0599: latexmkrc files are not recognized
Problem:    Latexmkrc files are not recognized.
Solution:   Use Perl filetype for latexmkrc files. (closes vim/vim#11241)
cde0319385
2022-09-27 12:37:44 +02:00
1d337d4e2f vim-patch:9.0.0595: extra newline in messages after a verbose shell message (#20359)
Problem:    Extra newline in messages after a verbose shell message.
Solution:   Output the newline with msg_putchar_attr(). (closes vim/vim#11233)
            Make it possible to filter a screendump before comparing it.
1190139ed0

Cherry-pick Test_message_more_scrolledback() from patch 9.0.0592 because
Nvim already behaves as intended.
2022-09-27 08:29:21 +08:00
7e98821e56 fix(ui): redraw end of buffer if last line is modified (#20354) 2022-09-27 06:33:48 +08:00
9a5ac06509 fix(docs): invalid :help links #20353
ref #20159
2022-09-26 06:56:07 -07:00
be693462d5 fix(ui): allow redrawing statusline when msgsep is used (#20337) 2022-09-26 21:23:43 +08:00
c7e74f7889 Merge pull request #20351 from bfredl/cmdfix2
fix(cmdline): don't send invalid cursor with incsearch and cmdheight=0
2022-09-26 13:30:19 +02:00
be72af2f9b fix(cmdline): don't send invalid cursor with incsearch and cmdheight=0
fixes #20306
2022-09-26 13:29:55 +02:00
c815aadfcc docs: fix typos (#20150)
Co-authored-by: Miguel Carneiro <mcarneiromorenas@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-26 17:43:23 +08:00
fe045bfd5f Merge pull request #20350 from bfredl/cmdfix
fix(messages): validate msg_grid before silent! message with cmdheight=0
2022-09-26 11:25:15 +02:00
db0ea1ab44 fix(messages): validate msg_grid before silent! message with cmdheight=0
fixes #20316
2022-09-26 10:50:49 +02:00
6596f7e136 Merge pull request #20277 from reiver-dev/term-more-underline
feat(terminal): recognize underdouble and undercurl
2022-09-26 09:20:58 +02:00
4bb1d1df79 feat(terminal): recognize underdouble and undercurl 2022-09-26 11:53:20 +08:00
63be765182 fix(docs): invalid :help links #20345
Fix those naughty single quotes.

closes #20159
2022-09-25 16:58:27 -07:00
9ffa041a9a vim-patch:9.0.0586: missing change in test (#20347)
Problem:    Missing change in test.
Solution:   Add the test change.
124af71a28

vim-patch:9.0.0585: when long message test fails the error message is not visible

Problem:    When long message test fails the error message is not visible.
Solution:   Dump more lines.
6a879878f4
2022-09-26 07:46:58 +08:00
ac66f5af06 fix!: make :undo! notify buffer update callbacks (#20344)
When :undo! was introduced to Nvim the implementation of 'inccommand'
preview callback hasn't been fully decided yet, so not notifying buffer
update callbacks made sense for 'inccommand' preview callback in case it
needs to undo the changes itself.
Now it turns out that the undo-and-forget is done automatically for
'inccommand', so it doesn't make sense for :undo! to avoid notifying
buffer update callbacks anymore.
2022-09-26 07:15:07 +08:00
a6c9764eda fix(inccommand): deal with unsynced undo (#20041) 2022-09-26 07:00:37 +08:00
f8a1cadccf fix(filetype): use :setf instead of nvim_buf_set_option (#20334) 2022-09-25 16:29:25 +02:00
fded344f38 fix(extmarks): make virt_lines always start at 0 virtcol 2022-09-25 21:44:01 +08:00
91e912f8d4 refactor: move klib out of src/nvim/ #20341
It's confusing to mix vendored dependencies with neovim source code. A
clean separation is simpler to keep track of and simpler to document.
2022-09-25 06:26:37 -07:00
4686bda06c Merge #20331 refactor(treesitter)!: rename x_position => x_pos 2022-09-25 08:37:05 -04:00
1b60b5ec94 fix(gen_vimdoc.py): handle missing luajit 2022-09-25 14:31:33 +02:00
2a5692c646 vim-patch:9.0.0583: only recognizing .m3u8 files is inconsistent (#20342)
Problem:    Only recognizing .m3u8 files is inconsistent.
Solution:   Also matc .m3u files. (issue vim/vim#11204)
b9725bc7f6
2022-09-25 13:59:11 +02:00
3169fc54a1 refactor(treesitter): rename x_position => x_pos
"pos" has a long precedent as "position" in vim, and there is no reason
to use a verbose name here.
2022-09-25 13:46:15 +02:00
2a3cb0893b feat: ":write!" skips "file changed" warning #18665
Problem:
Cannot opt-out of "WARNING: The file has been changed since reading
it!!!", even with ":write!".

Solution:
Change ":write!" to skip the warning.

closes #7270
2022-09-24 18:57:10 -07:00
c7cf1232a7 vim-patch:8.2.4467: running filetype test leaves file behind (#20335)
Problem:    Running filetype test leaves file behind.
Solution:   Delete the file.
0e71b7d4ce

vim-patch:8.2.4466: MS-Windows: illegal memory access in installer

Problem:    MS-Windows: illegal memory access in installer when using
            "create-directories" as the final argument.
Solution:   Check the argument count. (Cam Sinclair, closes vim/vim#9844)
5c6edf41f9
2022-09-25 09:49:21 +08:00
b0fcdf9f09 vim-patch:9.0.0576: unused loop variables (#20326)
Problem:    Unused loop variables.
Solution:   Use a while loop instead. (closes vim/vim#11214)
b2209f213e
2022-09-25 06:07:59 +08:00
8317b9199e fix(input): use click number of last click for mouse drag (#20300) 2022-09-24 22:28:41 +08:00
dfc6c973a3 Merge pull request #20322 from zeertzjq/vim-9.0.0567
vim-patch:9.0.{0567,0572}: 'completeopt' "longest" is not used for complete()
2022-09-24 21:42:18 +08:00
0c77dba9a4 vim-patch:9.0.0572: insert complete tests leave a mapping behind
Problem:    Insert complete tests leave a mapping behind.
Solution:   Use a buffer-local mapping. (closes vim/vim#11211)
75f4bafabd
2022-09-24 21:17:03 +08:00
57b731818d vim-patch:9.0.0567: 'completeopt' "longest" is not used for complete()
Problem:    'completeopt' "longest" is not used for complete().
Solution:   Also use "longest" for complete(). (Bjorn Linse, closes vim/vim#11206)
87af60c915
2022-09-24 21:16:43 +08:00
291a649632 fix(mapset): remove existing abbreviation of same lhs (#20320) 2022-09-24 21:07:18 +08:00
db056de29a vim-patch:9.0.0568: autocmd code is indented more than needed (#20318)
Problem:    Autocmd code is indented more than needed.
Solution:   Break out sooner. (Yegappan Lakshmanan, closes vim/vim#11208)
            Also in user function code.
e9dcf13a30
2022-09-24 19:20:03 +08:00
f8b656c582 vim-patch:9.0.0566: Nim files are not recognized (#20317)
Problem:    Nim files are not recognized.
Solution:   Add patterns for Nim files. (Nbiba Bedis, closes vim/vim#11205)
9fd1583c83
2022-09-24 12:59:37 +02:00
caf5738fa9 fix(lsp): create missing directory before creating file (#19835)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-09-24 12:46:21 +02:00
24b5449b3d vim-patch:9.0.0562: HSL playlist files are not recognized (#20307)
Problem:    HSL playlist files are not recognized.
Solution:   Add a pattern to recognize HSL palylist files. (Benoît Ryder,
            closes vim/vim#11204)
35fdd9a67d
2022-09-24 10:16:30 +02:00
14610332b2 fix(lsp): use correct function name in deprecated message (#20308)
fix: use correct function name in deprecated message
2022-09-23 19:20:56 -06:00
f3c842058e vim-patch:9.0.0559: timer test may get stuck at hit-enter prompt (#20312)
Problem:    Timer test may get stuck at hit-enter prompt.
Solution:   Feed some more characters.
4ecf16bbf9
2022-09-24 08:10:49 +08:00
ede66a0b85 fix: cleanup contrib/ #20304
- YouCompleteMe is unnecessary since Nvim LSP works well.
- vim-addon-local-vimrc is not needed since we added `.editorconfig`.
- Inline flake8 arguments. Eventually we will remove all python code,
  don't need a top-level `.flake8` file meanwhile.
2022-09-23 09:02:16 -07:00
3fe43917cb ci: remove contrib/doxygen/ #20303
Problem:
- The layout of the doxygen HTML "dev docs" has been broken for 1+ years.
- There is no evidence that anyone uses the doxygen HTML.
- In the meantime since we introduced the doxygen HTML pages, the Nvim
  C docstrings have been surfaced in other ways:
  - Nvim LSP client
  - Generated :help docs like ":help api" and ":help ui".

Solution:
- Remove `contrib/doxygen/` from neovim repo.
  - Note: keep `src/Doxyfile`, it is used by `scripts/gen_vimdoc.py`. ☠️
- Remove `doc/dev/` from website. https://github.com/neovim/neovim.github.io/pull/291
- Remove doxygen job from the neovim/doc repo. https://github.com/neovim/doc/pull/28
- Future/ongoing: ":help dev" and other :help docs will continue to be
  improved as the "source of truth" for developer-related docs.

ref https://github.com/neovim/neovim/pull/824
2022-09-23 08:36:36 -07:00
600136cfb6 revert: "build: remove unnecessary policy related code" #20289
This partially reverts commit 42aeb5c5b1.

Setting cmake policies is normally not required as
cmake_minimum_required automatically sets these. One exception is cmake
script mode (-P) since it automatically resets all policy changes.

Closes: https://github.com/neovim/neovim/issues/20286
2022-09-23 07:16:17 -07:00
fcd3e53720 ci(cirrus): set clone depth to 2 instead of 1 (#20295)
Setting CIRRUS_CLONE_DEPTH to 1 occasionally results in "Failed to checkout"
error for unknown reasons. Set it to 2 as a workaround.
2022-09-23 12:57:18 +02:00
7a70e9587c test(tabpage_spec): actually test for nvim_win_hide 2022-09-23 10:17:44 +08:00
9aead1f670 Merge pull request #20299 from zeertzjq/vim-9.0.0550
vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
2022-09-23 08:02:12 +08:00
d7052e8e1f test: add tests for #13549 #20285 #20290 2022-09-23 07:38:22 +08:00
c28f00b101 vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
Problem:    Crash when closing a tabpage and buffer is NULL.
Solution:   Adjust how autocommands are triggered when closing a window.
            (closes vim/vim#11198, closes vim/vim#11197)
62de54b48d
2022-09-23 07:38:22 +08:00
0760379b41 ci(stylua): change action version to v1 (#20273)
Changing the action version to v1 allows us to automatically get patch
updates as it points to the latest stable version.
2022-09-22 20:19:38 +02:00
a867aa45f7 Merge #11967 generate :help HTML with treesitter 2022-09-22 10:03:38 -04:00
09b64d75bd feat(docs): gen_help_html.lua
Problem:
The :help docs HTML generated is driven by an old awk script
`runtime/doc/makehtml.awk` that is hard to maintain (ad hoc parser and
no one has touched it in decades) and has bugs like:
- https://github.com/neovim/neovim.github.io/issues/96
- https://github.com/neovim/neovim.github.io/issues/97

Solution:
Use Lua + treesitter (https://github.com/vigoux/tree-sitter-vimdoc) to
generate :help docs HTML.  Also validates tag links.

fix https://github.com/neovim/neovim.github.io/issues/96
fix https://github.com/neovim/neovim.github.io/issues/97

TODO:
- delete doc_html build task
- delete runtime/doc/Makefile
- delete makehtml.awk
- delete maketags.awk

OUTPUT:

    $ nvim -V1 -es --clean +"lua require('scripts.gen_help_html')"
    output dir: /…/neovim.github.io/_site/doc/
    generated (207  errors): api.txt         => api.html
    generated (122  errors): arabic.txt      => arabic.html
    generated (285  errors): autocmd.txt     => autocmd.html
    generated (641  errors): builtin.txt     => builtin.html
    generated (623  errors): change.txt      => change.html
    generated (65   errors): channel.txt     => channel.html
    generated (353  errors): cmdline.txt     => cmdline.html
    generated (3    errors): debug.txt       => debug.html
    generated (28   errors): deprecated.txt  => deprecated.html
    generated (193  errors): dev_style.txt   => dev_style.html
    generated (460  errors): develop.txt     => develop.html
    generated (19   errors): diagnostic.txt  => diagnostic.html
    generated (57   errors): diff.txt        => diff.html
    generated (818  errors): digraph.txt     => digraph.html
    generated (330  errors): editing.txt     => editing.html
    generated (368  errors): eval.txt        => eval.html
    generated (184  errors): fold.txt        => fold.html
    generated (61   errors): ft_ada.txt      => ft_ada.html
    generated (0    errors): ft_ps1.txt      => ft_ps1.html
    generated (20   errors): ft_raku.txt     => ft_raku.html
    generated (5    errors): ft_rust.txt     => ft_rust.html
    generated (41   errors): ft_sql.txt      => ft_sql.html
    generated (110  errors): gui.txt         => gui.html
    generated (79   errors): hebrew.txt      => hebrew.html
    generated (17   errors): help.txt        => index.html
    generated (104  errors): helphelp.txt    => helphelp.html
    generated (0    errors): if_cscop.txt    => if_cscop.html
    generated (23   errors): if_perl.txt     => if_perl.html
    generated (16   errors): if_pyth.txt     => if_pyth.html
    generated (9    errors): if_ruby.txt     => if_ruby.html
    generated (216  errors): indent.txt      => indent.html
    generated (634  errors): index.txt       => vimindex.html
    generated (320  errors): insert.txt      => insert.html
    generated (265  errors): intro.txt       => intro.html
    generated (9    errors): job_control.txt => job_control.html
    generated (0    errors): lsp-extension.txt => lsp-extension.html
    generated (214  errors): lsp.txt         => lsp.html
    generated (311  errors): lua.txt         => lua.html
    generated (592  errors): luaref.txt      => luaref.html
    generated (798  errors): luvref.txt      => luvref.html
    generated (663  errors): map.txt         => map.html
    generated (228  errors): mbyte.txt       => mbyte.html
    generated (228  errors): message.txt     => message.html
    generated (0    errors): mlang.txt       => mlang.html
    generated (761  errors): motion.txt      => motion.html
    generated (4    errors): nvim.txt        => nvim.html
    generated (226  errors): nvim_terminal_emulator.txt => nvim_terminal_emulator.html
    generated (988  errors): options.txt     => options.html
    generated (567  errors): pattern.txt     => pattern.html
    generated (15   errors): pi_gzip.txt     => pi_gzip.html
    generated (10   errors): pi_health.txt   => pi_health.html
    generated (27   errors): pi_msgpack.txt  => pi_msgpack.html
    generated (2177 errors): pi_netrw.txt    => pi_netrw.html
    generated (41   errors): pi_paren.txt    => pi_paren.html
    generated (9    errors): pi_spec.txt     => pi_spec.html
    generated (218  errors): pi_tar.txt      => pi_tar.html
    generated (0    errors): pi_tutor.txt    => pi_tutor.html
    generated (235  errors): pi_zip.txt      => pi_zip.html
    generated (265  errors): print.txt       => print.html
    generated (31   errors): provider.txt    => provider.html
    generated (335  errors): quickfix.txt    => quickfix.html
    generated (572  errors): quickref.txt    => quickref.html
    generated (109  errors): recover.txt     => recover.html
    generated (14   errors): remote.txt      => remote.html
    generated (14   errors): remote_plugin.txt => remote_plugin.html
    generated (351  errors): repeat.txt      => repeat.html
    generated (23   errors): rileft.txt      => rileft.html
    generated (12   errors): russian.txt     => russian.html
    generated (6    errors): scroll.txt      => scroll.html
    generated (106  errors): sign.txt        => sign.html
    generated (347  errors): spell.txt       => spell.html
    generated (784  errors): starting.txt    => starting.html
    generated (1499 errors): syntax.txt      => syntax.html
    generated (23   errors): tabpage.txt     => tabpage.html
    generated (257  errors): tagsrch.txt     => tagsrch.html
    generated (31   errors): term.txt        => term.html
    generated (0    errors): testing.txt     => testing.html
    generated (96   errors): tips.txt        => tips.html
    generated (57   errors): treesitter.txt  => treesitter.html
    generated (71   errors): uganda.txt      => uganda.html
    generated (74   errors): ui.txt          => ui.html
    generated (87   errors): undo.txt        => undo.html
    generated (17   errors): userfunc.txt    => userfunc.html
    generated (1    errors): usr_01.txt      => usr_01.html
    generated (89   errors): usr_02.txt      => usr_02.html
    generated (293  errors): usr_03.txt      => usr_03.html
    generated (46   errors): usr_04.txt      => usr_04.html
    generated (96   errors): usr_05.txt      => usr_05.html
    generated (54   errors): usr_06.txt      => usr_06.html
    generated (20   errors): usr_07.txt      => usr_07.html
    generated (241  errors): usr_08.txt      => usr_08.html
    generated (130  errors): usr_09.txt      => usr_09.html
    generated (50   errors): usr_10.txt      => usr_10.html
    generated (33   errors): usr_11.txt      => usr_11.html
    generated (32   errors): usr_12.txt      => usr_12.html
    generated (22   errors): usr_20.txt      => usr_20.html
    generated (75   errors): usr_21.txt      => usr_21.html
    generated (8    errors): usr_22.txt      => usr_22.html
    generated (3    errors): usr_23.txt      => usr_23.html
    generated (163  errors): usr_25.txt      => usr_25.html
    generated (13   errors): usr_26.txt      => usr_26.html
    generated (84   errors): usr_27.txt      => usr_27.html
    generated (173  errors): usr_28.txt      => usr_28.html
    generated (285  errors): usr_29.txt      => usr_29.html
    generated (280  errors): usr_30.txt      => usr_30.html
    generated (11   errors): usr_31.txt      => usr_31.html
    generated (13   errors): usr_32.txt      => usr_32.html
    generated (156  errors): usr_40.txt      => usr_40.html
    generated (134  errors): usr_41.txt      => usr_41.html
    generated (35   errors): usr_42.txt      => usr_42.html
    generated (19   errors): usr_43.txt      => usr_43.html
    generated (60   errors): usr_44.txt      => usr_44.html
    generated (13   errors): usr_45.txt      => usr_45.html
    generated (1    errors): usr_toc.txt     => usr_toc.html
    generated (69   errors): various.txt     => various.html
    generated (68   errors): vi_diff.txt     => vi_diff.html
    generated (437  errors): vim_diff.txt    => vim_diff.html
    generated (296  errors): visual.txt      => visual.html
    generated (181  errors): windows.txt     => windows.html
    generated 119 html pages
    total errors: 23862
    invalid tags: 537
2022-09-22 15:36:27 +02:00
40f0851bd8 docs: deprecate :checkhealth vimscript interface 2022-09-22 15:36:27 +02:00
bde6176c91 feat(treesitter): bundle :help parser and queries
parser from https://github.com/vigoux/tree-sitter-vimdoc
queries from nvim-treesitter
2022-09-22 15:36:27 +02:00
11f91ac304 Merge pull request #20287 from zeertzjq/vim-9.0.0540
vim-patch:9.0.{0540,0544}: assigning stack variable to argument confuses Coverity
2022-09-22 21:34:46 +08:00
5c1b8d7bf8 docs(lua): correct docs for option accessor metatables (#20256) 2022-09-22 14:17:49 +01:00
4371886293 vim-patch:9.0.0544: minor issues with setting a string option
Problem:    Minor issues with setting a string option.
Solution:   Adjust the code, add a test. (closes vim/vim#11192)
fcba86c031
2022-09-22 21:09:31 +08:00
33f1471472 vim-patch:9.0.0540: assigning stack variable to argument confuses Coverity
Problem:    Assigning stack variable to argument confuses Coverity.
Solution:   Use a local pointer, also makes the code simpler.
6f98114e4a
2022-09-22 21:07:54 +08:00
679f3072f6 Merge pull request #20103 from lewis6991/refactor/vim_opt 2022-09-22 13:59:04 +01:00
2083c1771a fix(window): close floats first when closing buffer in other tab (#20284) 2022-09-22 20:25:34 +08:00
a7f6f0e2dd vim-patch:9.0.0539: long message test can be flaky (#20282)
Problem:    Long message test can be flaky.
Solution:   Wait for more prompt instead of ruler.
21d393a12b

Comment N/A lines out instead of deleting in buftype tests.
2022-09-22 20:18:06 +08:00
7fc5f6605f Merge pull request #20249 from bfredl/cmdmessage
fix(redraw): avoid unnecessary redraws and glitches with floats+messages
2022-09-22 11:09:33 +02:00
02f8ca59a8 fix(tests): indicate in test logs when nvim exit times out
When it happens it wastes 2 seconds which is NOT included in the
normal busted timing info. It is hard to correct this, but we
can at least print a warning when this happens.
2022-09-22 10:38:11 +02:00
93b30582db fix(redraw): make redrawdebug=nodelta handle all the cases
Before only win_line lines were considered. this applies nodelta
to all screen elements. Causes some failures, which might indeed
indicate excessive redraws.
2022-09-22 10:38:10 +02:00
00cfc1dceb fix(redraw): avoid unnecessary redraws and glitches with floats+messages
fixes #20106
fixes #20229
2022-09-22 10:36:23 +02:00
8d13b08a03 Merge pull request #20278 from zeertzjq/vim-8.2.3428
vim-patch:8.2.{3428,3567,3568,4074,4677}
2022-09-22 13:44:42 +08:00
477cf2a6b1 vim-patch:8.2.4677: the Athena GUI support is outdated
Problem:    The Athena GUI support is outdated.
Solution:   Remove the Athena GUI code.
0b962e5685
2022-09-22 13:23:58 +08:00
1bced9bf94 vim-patch:8.2.4074: going over the end of NameBuff
Problem:    Going over the end of NameBuff.
Solution:   Check length when appending a space.
de05bb2573
2022-09-22 13:17:43 +08:00
a636e24280 vim-patch:8.2.3568: ctrl-hat test fails with Athena and Motif
Problem:    Ctrl-hat test fails with Athena and Motif. (Elimar Riesebieter)
Solution:   Run the test only with GTK. (Dominique Pellé, closes vim/vim#9069)
8753c1dd2c
2022-09-22 13:15:40 +08:00
320e56a4e0 vim-patch:8.2.3567: CTRL-I in Insert mode is not tested
Problem:    CTRL-I in Insert mode is not tested
Solution:   Add a test case. (Dominique Pellé, closes vim/vim#8866)
9cd063e319
2022-09-22 13:15:12 +08:00
3f4030e171 vim-patch:8.2.3428: using freed memory when replacing
Problem:    Using freed memory when replacing. (Dhiraj Mishra)
Solution:   Get the line pointer after calling ins_copychar().
35a9a00afc

This patch is N/A as it only applies to non-UTF-8 encoding.
2022-09-22 13:13:11 +08:00
d76017c613 Merge pull request #20276 from zeertzjq/vim-8.2.2979
vim-patch:8.2.{0712,2979,2994,3155}: options tests
2022-09-22 13:10:20 +08:00
800cda2164 vim-patch:8.2.3155: some option related code not covered by tests
Problem:    Some option related code not covered by tests.
Solution:   Add a few test cases. (Dominique Pellé, closes vim/vim#8552)
042414fa00
2022-09-22 12:40:26 +08:00
88099c1122 vim-patch:8.2.2994: various code is not fully tested
Problem:    Various code is not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8378)
2d6d718dde

Nvim does not support encoding=latin1 or compatible mode.
The two paste tests are applicable.
2022-09-22 12:40:26 +08:00
dd2b7586f3 vim-patch:8.2.2979: not all options code is covered by tests
Problem:    Not all options code is covered by tests.
Solution:   Add more tests for options. (Yegappan Lakshmanan, closes vim/vim#8369)
5958549760
2022-09-22 12:40:26 +08:00
5d1cb73e7f vim-patch:8.2.0712: various code not fully tested
Problem:    Various code not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6049)
0ff5dedf0f

Nvim does not support encoding=latin1 or setting keycodes/termcaps.
2022-09-22 12:40:26 +08:00
71e70d0c99 vim-patch:9.0.0537: the do_set() function is much too long (#20274)
Problem:    The do_set() function is much too long.
Solution:   Move setting of a string option to a separate function.
4740394f23

Cherry-pick some tests from Vim patch 8.2.0540.
2022-09-22 09:43:37 +08:00
b4b05f160d feat(filetype): expand environment variables in filetype patterns (#20145) 2022-09-21 15:58:57 -06:00
37a71d1f28 vim-patch:9.0.0018: going over the end of the typahead (#20269)
Problem:    Going over the end of the typahead.
Solution:   Put a NUL after the typeahead.
27efc62f5d

check_termcode() is N/A.
2022-09-21 11:06:39 +08:00
ad1f353fe1 vim-patch:9.0.0517: when at the command line :redrawstatus does not work well (#20266)
Problem:    When at the command line :redrawstatus does not work well.
Solution:   Only update the statuslines instead of the screen. (closes vim/vim#11180)
320d910064
2022-09-21 06:47:29 +08:00
585ab2564a refactor: suppress PVS false positives (#20264)
Some V512 warnings have changed to V1086, and PVS apparently does not
know `uv_run()` can change `*timeout_expired`.
2022-09-21 06:02:53 +08:00
ec94014cd1 fix(lsp): out of bounds error in lsp.util.apply_text_edits (#20137)
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2022-09-20 22:14:58 +02:00
62db91f06c Merge pull request #20263 from notomo/refactor-remove-unused
refactor(message): remove unused function
2022-09-20 16:38:31 +02:00
cfdc93e8ac vim-patch:9.0.0511: unnecessary scrolling for message of only one line (#20261)
Problem:    Unnecessary scrolling for message of only one line.
Solution:   Only set msg_scroll when needed. (closes vim/vim#11178)
bdedd2bcce
2022-09-20 21:58:39 +08:00
86c5d761c4 Merge pull request #20262 from zeertzjq/vim-9.0.0507
vim-patch:9.0.{0507,0512}: cmdline cleared when using :redrawstatus
2022-09-20 21:26:24 +08:00
b5a21ad8ff refactor(message): remove unused function 2022-09-20 13:07:48 +00:00
2e4532bea5 vim-patch:9.0.0512: cannot redraw the status lines when editing a command
Problem:    Cannot redraw the status lines when editing a command.
Solution:   Only postpone the redraw when messages have scrolled.
            (closes vim/vim#11170)
c14bfc31d9
2022-09-20 21:01:00 +08:00
9413f7544b vim-patch:9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Problem:    Command line cleared when using :redrawstatus in CmdlineChanged
            autocommand event.
Solution:   Postpone the redraw. (closes vim/vim#11162)
bcd6924245

Cherry-pick Test_redraw_in_autocmd() from Vim patch 8.2.4789.
2022-09-20 21:00:45 +08:00
ae30e388de vim-patch:9.0.0510: Chatito files are not recognized (#20260)
Problem:    Chatito files are not recognized.
Solution:   Add a pattern for Chatito files. (closes vim/vim#11174)
7c046ae99b
2022-09-20 14:10:00 +02:00
054c27075b vim-patch:9.0.0509: confusing error for "saveas" command with "nofile" buffer (#20258)
Problem:    Confusing error for "saveas" command with "nofile" buffer.
Solution:   Give a clearer error message. (closes vim/vim#11171)
500a1f9972
2022-09-20 19:49:00 +08:00
abe2d90693 feat(lua): move compat module from runtime to test (#20257) 2022-09-20 11:15:32 +01:00
e762158305 docs(lua): opts in vim.keymap.{set,del} can be optional (#20255) 2022-09-20 10:42:45 +01:00
10196f1b46 fix(lsp): support false result in handlers (#20252)
Closes https://github.com/neovim/neovim/issues/20111
2022-09-20 09:28:23 +02:00
a0e6e767a6 fix(tui): handle padding requirements for visual bell (#20238) 2022-09-20 11:47:04 +08:00
875b58e094 build: add basic cmake-presets integration (#19128)
This allows a more declarative way of defining targets which may be easier to those not familiar with cmake quirks.

Example usage:

# get a list of pre-configured presets
cmake --list-presets

# configure a preset
cmake . --preset=default

# build it
cmake --build --preset=default
2022-09-19 10:58:26 +02:00
7a091fdfaf ci(publish-winget): fix errors that prevents release (#20232) 2022-09-19 10:48:05 +02:00
7bd4c8e8ee fix(inccommand): avoid unnecessary redraw when not showing (#20244) 2022-09-19 12:37:25 +08:00
647da34bbd fix: assert failure when changing 'ut' while waiting for CursorHold (#20241) 2022-09-18 22:55:30 +08:00
67df3347fd vim-patch:9712ff1288f9 (#20240)
Update runtime files
9712ff1288
2022-09-18 15:20:20 +02:00
8dc61713d9 vim-patch:9.0.0497: LyRiCs files are not recognized (#20239)
Problem:    LyRiCs files are not recognized.
Solution:   Add a pattern to detect LyRiCs files. (closes vim/vim#11155)
65ee49decf
2022-09-18 14:16:24 +02:00
e63538f21c Merge pull request #20198 from zeertzjq/cursorhold
fix(events): make CursorHold behave as documented
2022-09-18 11:37:22 +02:00
6d557e324f vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
4f97475d32
2022-09-18 09:17:15 +08:00
644a3f48b1 fix(events): make CursorHold behave as documented 2022-09-17 21:48:44 +08:00
3c3f3e7353 test(remote_spec): reduce flakiness in waiting for client exit (#20230)
It is less likely for client to exit between jobstart() and jobwait() if
they are invoked in the same RPC request instead of two separate ones.
2022-09-17 16:17:51 +08:00
18139a69bc vim-patch:8.2.0690: line number of option set by modeline is wrong (#20228)
Problem:    Line number of option set by modeline is wrong.
Solution:   Do not double the line number. (Ozaki Kiichi, closes vim/vim#6035)
5125874951
2022-09-17 15:39:04 +08:00
72e1041429 vim-patch:9.0.0483: illegal memory access when replacing in virtualedit mode (#20225)
Problem:    Illegal memory access when replacing in virtualedit mode.
Solution:   Check for replacing NUL after Tab.
c249913edc

Cherry-pick Test_virtualedit_mouse() from patch 9.0.0177.
2022-09-17 10:20:06 +08:00
26b54d5c16 test(old): add a function roughly equivalent to test_setmouse() (#20224)
Mouse movement events usually have no effect, so passing "move" to
nvim_input_mouse() works in most cases.
2022-09-17 09:40:19 +08:00
c126c1f73a ci(release-winget): publish nightly winget prerelease #20209 2022-09-16 15:33:06 -07:00
6cc03b9c90 build(deps): bump libvterm to v0.3 (#20222) 2022-09-16 19:30:04 +02:00
e512d3ecf2 vim-patch:9.0.0479: in :def function all closures in loop get the sam… (#20220)
vim-patch:9.0.0479: in :def function all closures in loop get the same variables

Problem:    In a :def function all closures in a loop get the same variables.
Solution:   Use a separate list of variables for LOADOUTER and SAVEOUTER.
1aea184a0d

(note: patch description is wrong)
2022-09-16 17:52:08 +02:00
6b2f0f43b5 fix(eval)!: make Lua Funcref work as method and in substitute() (#20217)
BREAKING CHANGE: When using a Funcref converted from a Lua function as
a method in Vim script, the result of the base expression is now passed
as the first argument instead of being ignored.

vim-patch:8.2.5117: crash when calling a Lua callback from a :def function

Problem:    Crash when calling a Lua callback from a :def function. (Bohdan
            Makohin)
Solution:   Handle FC_CFUNC in call_user_func_check(). (closes vim/vim#10587)
7d149f899d
2022-09-16 23:09:26 +08:00
a0642ec75e feat(tui): support undercurl when Konsole version >= 221170 (#20219)
Support was added in 76f879cd70
2022-09-16 22:40:04 +08:00
622968d7b3 vim-patch:9.0.0476: varargs does not work for replacement function of substitute() (#20216)
Problem:    Varargs does not work for replacement function of substitute().
Solution:   Check the varargs flag of the function. (closes vim/vim#11142)
48db5dafec
2022-09-16 19:40:52 +08:00
3dda52d860 vim-patch:8.2.3796: the funcexe_T struct members are not named consistently (#20214)
Problem:    The funcexe_T struct members are not named consistently.
Solution:   Prefix "fe_" to all the members.
851f86b951

Omit fe_check_type: always NULL in legacy Vim script.
2022-09-16 17:31:42 +08:00
754822a066 fix(lua): free vim.ui_attach callback before lua close (#20205) 2022-09-16 11:06:37 +02:00
0c0071548b Merge pull request #20213 from bfredl/redisplay
fix(messages): do not crash on cmdheight=0 and g< redisplay
2022-09-16 11:04:04 +02:00
b98de0e0e5 vim-patch:8.2.0067: ERROR_UNKNOWN clashes on some systems (#20212)
Problem:    ERROR_UNKNOWN clashes on some systems.
Solution:   Rename ERROR_ to FCERR_. (Ola Söder, closes vim/vim#5415)
ef140544f6

Remove ERROR_BOTH which was removed from Vim in patch 7.4.1582.
2022-09-16 16:37:37 +08:00
b616458af9 fix(messages): do not crash on cmdheight=0 and g< redisplay
fixes #20153
2022-09-16 10:33:12 +02:00
0b7a3c173c Merge pull request #20188 from bfredl/zerocmdline
feat(ui): use msg_grid based implementation for cmdheight=0
2022-09-16 10:07:50 +02:00
279c7b11fb build(deps): bump tree-sitter-lua to v0.0.13 (#20210) 2022-09-16 09:26:37 +02:00
0f93aa12fd docs(autocmds): re-add buffer param to docstring (#20204) 2022-09-16 09:18:42 +02:00
9ec4b20be6 fix(treesitter): return full metadata for get_captures_at_position (#20203)
fix(treesitter): get_captures_at_position returns metadata

Return the full `metadata` table for the capture instead of just the
priority.

Further cleanup of related docs.
2022-09-16 09:05:05 +02:00
982fef6018 fix(diagnostic): populate data key in DiagnosticChanged autocmd in reset (#20207)
Follow up to #20173.
2022-09-15 11:03:07 -06:00
708bd68651 feat(ui): use msg_grid based implementation for cmdheight=0 2022-09-15 12:13:43 +02:00
89b9eab638 test(old): remove OpenBSD skip (#20201) 2022-09-15 11:36:13 +08:00
bf6de51f55 fix(help): add --clean to -h (#20171)
update man file to match
2022-09-14 11:11:17 +02:00
ddb762f401 docs(treesitter): clean up and update treesitter.txt (#20142)
* add type annotations to code
* clean up and expand static documentation
* consistent use of tags for static and generated docs
2022-09-14 11:08:31 +02:00
8b0b0a5c32 Merge pull request #18705 from dundargoc/fix/require-missing-module-in-autocmd
fix: assertion failure when requiring missing module in autocmd
2022-09-14 10:55:25 +02:00
bd4eca1146 refactor: move definitions from typval.h to typval_defs.h (#20194)
Taken from #20187.
2022-09-14 13:01:39 +08:00
1e5daed676 Merge pull request #20164 from bfredl/luanull
fix(lua): make vim.str_utfindex and vim.str_byteindex handle NUL bytes
2022-09-13 23:17:11 +02:00
25e4af439f fix(lua): make vim.str_utfindex and vim.str_byteindex handle NUL bytes
fixes #16290
2022-09-13 22:50:22 +02:00
a8c9e721d9 feat(fs): extend fs.find to accept predicate (#20193)
Makes it possible to use `vim.fs.find` to find files where only a
substring is known.
This is useful for `vim.lsp.start` to get the `root_dir` for languages
where the project-file is only known by its extension, not by the full
name.
For example in .NET projects there is usually a `<projectname>.csproj`
file in the project root.

Example:

    vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true })
2022-09-13 14:16:20 -06:00
1970d2ac43 feat(diagnostic): pass diagnostics as data to DiagnosticChanged autocmd (#20173) 2022-09-13 08:33:39 -06:00
f19e91acd8 vim-patch:9.0.0457: substitute prompt does not highlight an empty match (#20186)
Problem:    Substitute prompt does not highlight an empty match.
Solution:   Highlight at least one character.
a04f457a6c
2022-09-13 22:08:01 +08:00
ec1f153ddc vim-patch:9.0.0456: function called at debug prompt is also debugged (#20185)
Problem:    Function called at debug prompt is also debugged.
Solution:   Reset the debug level while entering the debug command.
            (closes vim/vim#11118)
b1842de5ca
2022-09-13 21:02:11 +08:00
37e9688802 Merge pull request #20011 from lewis6991/refactor/memline
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-13 11:56:18 +01:00
8eabbacf22 refactor(memline): resolve clint errors
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-13 10:35:52 +01:00
907fc8ac37 vim-patch:9.0.0449: there is no easy way to translate a key code into a string (#20168)
Problem:    There is no easy way to translate a string with a key code into a
            readable string.
Solution:   Add the keytrans() function. (closes vim/vim#11114)
cdc839353f

vim-patch:7b2d87220c6c

Add missing part of patch
7b2d87220c
2022-09-13 06:23:33 +08:00
91a150d0a9 test(lsp): call clear() before bufwipe test (#20170)
Otherwise this test cannot be run alone, and fails frequently on CI.
2022-09-13 06:01:35 +08:00
f6232e160b Merge pull request #20077 from dundargoc/refactor/char_u/11
refactor: replace char_u with char 11: remove `STRLEN` part 1
2022-09-12 21:50:31 +02:00
fd70e2bff2 Merge pull request #20141 from vigoux/ts-self-inherits
fix(treesitter): prevent endless loop on self-inheritence

docs(treesitter): suggest using extends to extend queries
2022-09-12 17:35:49 +02:00
a3272cf452 docs(treesitter): suggest using extends to extend queries 2022-09-12 17:14:27 +02:00
5bc0964b97 vim-patch:9.0.0299: error messages for setcmdline() could be better (#20169)
Problem:    Error messages for setcmdline() could be better.
Solution:   Use more specific error messages. (Yegappan Lakshmanan,
            closes vim/vim#10995)
25f1e55562

Cherry-pick tv_check_for_opt_number_arg() from Vim.
2022-09-12 21:47:35 +08:00
afe01842ef vim-patch:9.0.0448: SubRip files are not recognized (#20167)
Problem:    SubRip files are not recognized.
Solution:   Add a pattern for SubRip. (closes vim/vim#11113)
5a4eb55122
2022-09-12 15:12:39 +02:00
add27f2898 Merge pull request #20091 from teto/fix-flake 2022-09-12 14:07:44 +02:00
a48e42a29d vim-patch:8.2.4671: 'wildignorecase' is sometimes not used for glob() (#20165)
Problem:    'wildignorecase' is sometimes not used for glob().
Solution:   Also use 'wildignorecase' when there are no wildcards.
            (closes vim/vim#10066, closes vim/vim#8350)
a3157a476b
2022-09-12 19:09:23 +08:00
2ea6584a1b Merge pull request #20163 from zeertzjq/vim-8.2.5034
vim-patch:8.2.5034: there is no way to get the byte index from a virtual column
2022-09-12 18:10:13 +08:00
245ac6f263 vim-patch:8.2.5034: there is no way to get the byte index from a virtual column
Problem:    There is no way to get the byte index from a virtual column.
Solution:   Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477,
            closes vim/vim#10098)
5a6ec10cc8

Cherry-pick tv_check_for_number_arg() from Vim.
Cherry-pick pathshorten() doc change.
2022-09-12 17:28:07 +08:00
4448fa88ec refactor: move f_screenpos() to move.c 2022-09-12 17:20:21 +08:00
738c204523 Merge pull request #20160 from zeertzjq/vim-8.2.2646
vim-patch:8.2.{2646,2664}: string argument type check
2022-09-12 15:29:39 +08:00
49aa9e17fa vim-patch:8.2.2664: Vim9: not enough function arguments checked for string
Problem:    Vim9: not enough function arguments checked for string.
Solution:   Check in balloon functions.  Refactor function arguments.
32105ae88f

Cherry-pick removal of useless check from patch 8.2.3840.

vim-patch:8.2.3083: crash when passing null string to charclass()

Problem:    Crash when passing null string to charclass().
Solution:   Bail out when string pointer is NULL. (Christian Brabandt,
            closes vim/vim#8498, closes vim/vim#8260)
72463f883c
2022-09-12 14:56:49 +08:00
38059b4f31 vim-patch:8.2.2646: Vim9: error for not using string doesn't mention argument
Problem:    Vim9: error for not using string doesn't mention argument.
Solution:   Add argument number.
f28f2ac425
2022-09-12 14:56:42 +08:00
f98cff9575 vim-patch:9.0.0443: blueprint files are not recognized (#20155)
Problem:    Blueprint files are not recognized.
Solution:   Add a pattern for blueprint files. (Gabriele Musco, closes vim/vim#11107)
cce82a55b8
2022-09-11 16:07:54 +02:00
3ff46544c9 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-11 13:28:59 +02:00
1939518eba fix(treesitter): prevent endless loop on self-inheritence
Fixes #20139
2022-09-11 08:16:50 +02:00
9b4cab0126 fix(lsp): schedule removal of client object (#20148)
The execution of the LspDetach autocommands in the LSP client's on_exit
function are scheduled on the event loop to avoid making API calls in a
fast context; however, this means that by the time the LspDetach
autocommands finally run the client object has already been deleted.

To address this, we also schedule the deletion of the client on the
event loop so that it is guaranteed to occur after all of the LspDetach
autocommands have fired.
2022-09-10 18:56:29 -06:00
91a2e7a571 vim-patch:71b6d3397649 (#20144)
Update runtime files
71b6d33976
2022-09-10 14:54:13 +02:00
2a1c65b330 build: ensure version generation always succeeds (#19515)
Add --always flag to `git describe` so version generation succeeds if
current directory is in a git repo. If not in git repo, fall back to a
default version in the format vx.y.z-dev
2022-09-10 14:37:11 +02:00
4638fcf4fb Merge pull request #20068 from dundargoc/refactor/char_u/10
refactor: replace char_u with char 10: remove `FNAMECMP`, `FNAMENCMP` and `STRLCAT`
2022-09-10 14:33:43 +02:00
40f9f479b7 vim-patch:9.0.0434: gitignore files are not recognized (#20143)
Problem:    gitignore files are not recognized.
Solution:   Add patterns for the gitignore filetype. (closes vim/vim#11102)
9ba2786f15
2022-09-10 13:30:54 +02:00
684bc749ef refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-10 11:17:40 +02:00
82d93429e7 ci: add more reviewers based on label (#17975) 2022-09-10 11:08:46 +02:00
48e060f648 Merge pull request #20132 from JartC0ding/master
docs: remove link that has been dead for 2 years by now
2022-09-09 20:30:33 -04:00
4c6bf386c5 docs: removed outdated coverage link
Coverage jobs have not been re-added since switching from Travis to GHA,
so the coverage information is severely outdated.
2022-09-09 20:03:53 -04:00
2f385d17a0 Merge pull request #20057 from dundargoc/refactor/char_u/9
refactor: replace char_u with char 9: remove `STRCMP`
2022-09-09 21:49:41 +02:00
c5322e752e refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-09 21:02:42 +02:00
9b0e1256e2 vim-patch:9.0.0427: Drupal theme files are not recognized (#20138)
Problem:    Drupal theme files are not recognized.
Solution:   Use php filetype for Drupl theme files.  Remove trailing spaces.
            (Rodrigo Aguilera, closes vim/vim#11096)
8995c4cd4e
2022-09-09 18:48:12 +02:00
ad2d6a624b vim-patch:9.0.0424: gitattributes files are not recognized (#20134)
Problem:    gitattributes files are not recognized.
Solution:   Add patterns to match gitattributes files. (closes vim/vim#11085)
7d56cfc861
2022-09-09 17:53:15 +02:00
038c711539 refactor(vim.opt): de-nest code 2022-09-09 12:38:15 +01:00
9272d20ea4 refactor(vim.opt): use local function syntax 2022-09-09 12:38:15 +01:00
ad972990ad refactor(vim.opt): optimize append/prepend/remove 2022-09-09 12:38:15 +01:00
b364bc2c34 refactor(vim.opt): dry up and tidy 2022-09-09 12:38:10 +01:00
925a811990 refactor(vim.opt): remove value_mutator() 2022-09-09 09:54:54 +01:00
7533ceec13 refactor(vim.opt): unify vim.bo/wo building 2022-09-09 09:54:53 +01:00
22a88c425e build(deps): bump Luv to 1.44.2-1 (#20128)
https://github.com/luvit/luv/releases/tag/1.44.2-1
2022-09-09 09:44:16 +02:00
2d6735d8ce ci: move BSD jobs from sourcehut to Cirrus CI #19616
dispatch.sr.ht is being deprecated, meaning that using sourcehut CI
won't be possible (see https://github.com/neovim/neovim/issues/19609).
Since Github Actions doesn't provide any BSD runners an external service
is required and Cirrus CI seems like a good replacement for sourcehut.

Initially experimented with using FreeBSD and OpenBSD virtual machines
in GitHub Actions, but Cirrus has been a much better fit with better
performance, logs and overall experience.

Failing tests are automatically skipped on FreeBSD regardless if it's on
CI or not. Ideally these tests should only be skipped in CI with the
help of `isCI` helper function. Unfortunately, the tests don't recognize
the environment variable CIRRUS_CI even if it's set manually. This
workaround is good enough for the time being, but we might want to only
skip tests when using the CI (or even better, fix the failing tests).

Closes: https://github.com/neovim/neovim/issues/19609
2022-09-08 15:12:42 -07:00
d6233cbcdc ci(labeler): add treesitter label for query changes (#20122) 2022-09-08 21:58:50 +02:00
79a9b00671 build(deps): bump tree-sitter-viml to 0.2.0 (#20121) 2022-09-08 19:46:40 +02:00
19a3b2c26e docs(lsp): update rpc.start stdio limitations (#20120) 2022-09-08 10:25:16 -07:00
164752b380 refactor(vim.opt): remove make_meta_accessor() 2022-09-08 17:24:17 +01:00
30ca6d23a9 fix(lsp): when buffer detach remove buffer from client attached buffers (#20081)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-09-08 17:09:32 +02:00
514a1679dc refactor(vim.opt): simplify get_option_metatype 2022-09-08 15:44:00 +01:00
b8de5ada80 refactor(vim.opt): replace _setup with lazy table 2022-09-08 15:42:17 +01:00
f21e2a51ba refactor(vim.opt): remove enums 2022-09-08 15:32:26 +01:00
bc88691dbd refactor(vim.opt): remove del arg 2022-09-08 15:32:26 +01:00
08602ec1ab vim-patch:9.0.0417: Jsonnet files are not recognized (#20119)
Problem:    Jsonnet files are not recognized.
Solution:   Add a pattern for Jsonnet files. (Cezary Drożak, closes vim/vim#11073,
            closes vim/vim#11081)
2a4c885d54
2022-09-08 16:06:00 +02:00
bb35422659 Merge pull request #19958 from dundargoc/build/cmake/cleanup
build: remove ARGS from add_custom_command
It's a command that doesn't do anything, kept only for compatibility
reasons.

build: remove unnecessary policy related code
Having cmake version 3.10 as the required minimum version ensures these
are set to new by default.

build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable
Instead use the recommended form CMAKE_C_COMPILER_ID MATCHES "GNU"

build: remove unnecessary build functions
These functions serve no purpose if they're only used as intermediary
functions that passes on arguments to ExternalProject_Add.
2022-09-08 14:51:27 +02:00
7ae74998f0 build: remove unnecessary build functions
These functions serve no purpose if they're only used as intermediary
functions that passes on arguments to ExternalProject_Add.
2022-09-08 14:15:13 +02:00
b9aafb85e6 build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable
Instead use the recommended form `CMAKE_C_COMPILER_ID MATCHES "GNU"`
2022-09-08 14:15:13 +02:00
42aeb5c5b1 build: remove unnecessary policy related code
Having cmake version 3.10 as the required minimum version ensures these
are set to new by default.
2022-09-08 14:15:13 +02:00
b635f7ed41 build: remove ARGS from add_custom_command
It's a command that doesn't do anything, kept only for compatibility
reasons.
2022-09-08 14:15:13 +02:00
11167ab6d5 feat(lsp): add range option to lsp.buf.format (#19998) 2022-09-08 11:33:04 +02:00
8c59d7e6a7 Merge pull request #20093 from neovim/upstream-ts-util
* feat(treesitter): upstream get_{node,captures} utility functions
* refactor(treesitter): get_{nodes,captures}_at_{position,cursor}
2022-09-08 11:23:26 +02:00
893b659e88 fix(treesitter): use the right loading order for base queries (#20117)
Use the first, not last, query for a language on runtimepath. Typically,
this implies that a user query will override a site plugin query, which 
will override a bundled runtime query.
2022-09-08 11:17:29 +02:00
0405594399 feat(treesitter)!: do not merge queries by default (#20105)
Problem: Treesitter queries for a given language in runtime were merged together, 
leading to errors if they targeted different parser versions (e.g., bundled viml queries 
and those shipped by nvim-treesitter).
Solution:  Runtime queries now work as follows:
* The last query in the rtp without `; extends` in the header will be used as the base query
* All queries (without a specific order) with `; extends` are concatenated with the base query

BREAKING CHANGE: queries need to be updated if they are meant to extend other queries
2022-09-08 09:47:36 +02:00
36faac6241 Merge pull request #20115 from glepnir/fix_doc
fix(docs): remove duplicate word
2022-09-08 08:43:20 +02:00
4af04df844 fix(docs): remove duplicate word 2022-09-08 14:33:17 +08:00
79afdae2f3 Merge pull request #20114 from zeertzjq/ts-docs
docs(treesitter): fix doxygen comment
2022-09-08 08:20:27 +02:00
99e6e0f221 docs(treesitter): fix doxygen 2022-09-08 12:54:41 +08:00
078e49b96a Merge pull request #20112 from zeertzjq/vim-9.0.0410
vim-patch:9.0.{0410,0412}: unused cts_lnum
2022-09-08 09:22:38 +08:00
06f9da547c vim-patch:9.0.0412: compiler warning for unused argument
Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
e5a420fb33
2022-09-08 08:54:14 +08:00
80a566b55f vim-patch:9.0.0410: struct member cts_lnum is unused
Problem:    Struct member cts_lnum is unused.
Solution:   Delete it.
d7633114af
2022-09-08 08:52:10 +08:00
e93f22f28a Merge pull request #20110 from ii14/vim-7c7e1e9b98d4
vim-patch:8.2.3702,9.0.0409
2022-09-08 08:47:01 +08:00
4a67f9d386 vim-patch:9.0.0409: #{g:x} was seen as a curly-braces expression
Problem:    #{g:x} was seen as a curly-braces expression.
Solution:   Do never see #{} as a curly-braces expression. (closes vim/vim#11075)
7c7e1e9b98
2022-09-08 08:17:30 +08:00
93a0c2dd63 vim-patch:8.2.3702: first key in dict is seen as curly expression and fails
Problem:    First key in dict is seen as curly expression and fails.
Solution:   Ignore failure of curly expression. (closes vim/vim#9247)
98cb90ef86
2022-09-08 08:15:55 +08:00
ead524656d vim-patch:9.0.0403: 'equalalways' may be off when 'laststatus' is zero (#20109)
Problem:    'equalalways' may be off when 'laststatus' is zero.
Solution:   call last_status() before win_equal(). (Luuk van Baal,
            closes https://github.com/vim/vim/pull/11070)
fd7e60a33d
2022-09-07 18:08:00 +02:00
4dc4cf3467 fix(options): mark winhighlight as list style (#19477)
Also add missing fcs, lcs and winhighlight to list of key-value options for `vim.opt`.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-09-07 17:59:27 +02:00
9d1d3a6707 vim-patch:9.0.0402: javascript module files are not recoginzed (#20108)
Problem:    Javascript module files are not recoginzed.
Solution:   Recognize "*.jsm" files as Javascript. (Brett Holman,
            closes vim/vim#11069)
bb6c4073e7
2022-09-07 15:55:39 +02:00
ff9d2b17fb Merge pull request #20100 from bfredl/luafunc
refactor(typval): change FC_CFUNC abstraction into FC_LUAREF
2022-09-07 09:08:05 +02:00
fd1595514b Use weak tables in tree-sitter code (#17117)
feat(treesitter): use weak tables when possible

Also add the defaulttable function to create a table whose values are created when a key is missing.
2022-09-07 08:39:56 +02:00
f32fd19f1e fix(diagnostic): remove buf from cache on BufWipeout (#20099)
Doing so on `BufDelete` has issues:
  - `BufDelete` is also fired for listed buffers that are made unlisted.
  - `BufDelete` is not fired for unlisted buffers that are deleted.

This means that diagnostics will be lost for a buffer that becomes unlisted.

It also means that if an entry exists for an unlisted buffer, deleting that
buffer later will not remove its entry from the cache (and you may see "Invalid
buffer id" errors when using diagnostic functions if it was wiped).

Instead, remove a buffer from the cache if it is wiped out.
This means simply `:bd`ing a buffer will not clear its diagnostics now.
2022-09-06 20:55:03 -06:00
db9b8b08e7 refactor(typval): change FC_CFUNC abstraction into FC_LUAREF
"cfuncs" was only ever used to wrap luarefs. As vim8script is
finished and will not be developed further, support for "cfuncs"
for other usecases are not planned. This abstraction was immediately
broken anyway in order to get luarefs out of userfuncs again.

Even if a new kind of userfunc needs to be invented in the future,
likely just extending the FC_... flag union directy, instead of
invoking unnecessary heap object and c function pointer indirection,
will be a more straightforward design pattern.
2022-09-07 00:52:58 +02:00
b17c5c3d9c Merge pull request #20102 from e-kwsm/treesitter-c99
build(treesitter): set CMAKE_C_STANDARD to C99
2022-09-07 00:49:08 +02:00
c77bb5a528 build(treesitter): set CMAKE_C_STANDARD to C99 2022-09-07 06:33:58 +09:00
694ac26946 Merge pull request #17329 from cryptomilk/asn-vterm-0-2
build(deps): bump libvterm to 0.3-RC1
2022-09-06 22:41:37 +02:00
b76e33b598 fix(terminal): adopt altscreen test for libvterm 0.2 changes
Due to a rewrite of the resize handling logic in libvterm, the behavior
changed. It's actually fixing a bug.

16b8574575
2022-09-06 21:48:22 +02:00
9ecaa35f55 build(deps): use libvterm 0.3-rc1 2022-09-06 21:48:14 +02:00
2aeb8d976f feat(term): add support for libvterm >= 0.2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2022-09-06 21:19:55 +02:00
74a8b5982a Merge pull request #20031 from dundargoc/refactor/char_u/8
refactor: replace char_u with char 8: remove `vim_strsave`
2022-09-06 20:38:26 +02:00
707edfc9e6 fix(ts): do not clobber spelloptions (#20095) 2022-09-06 19:22:05 +01:00
aaa54a8b3e Merge pull request #20097 from clason/ts-syntax-off
fix(treesitter): don't support legacy syntax in start()
2022-09-06 19:57:07 +02:00
d01cadd82f fix(treesitter): don't support legacy syntax in start() 2022-09-06 17:33:44 +02:00
6e3a69b4cf build: consistently set build type regardless of generator or platform #19760
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.

This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.

The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run

cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run

cmake -B build
cmake --build build --config Release

Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.

Co-authored-by: dundargoc <gocundar@gmail.com>
2022-09-06 07:52:39 -07:00
73207cae61 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-06 16:44:37 +02:00
87e037e26c fix(cmdheight=0): various issues part3 #19816
And fixed in https://github.com/neovim/neovim/pull/19801 regression.

Fix #19834
Fix #19184
2022-09-06 07:33:25 -07:00
12afc344de refactor: migrate comment style 2 #20080 2022-09-06 07:23:00 -07:00
74db632c97 refactor(term): use const for title and add len to buf_set_term_title() 2022-09-06 13:23:50 +02:00
84d1094958 Merge pull request #19419 from vigoux/extmark_spell
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-09-06 11:23:01 +01:00
75adfefc85 feat(extmarks,ts,spell): full support for spelling
- Added 'spell' option to extmarks:

  Extmarks with this set will have the region spellchecked.

- Added 'noplainbuffer' option to 'spelloptions':

  This is used to tell Neovim not to spellcheck the buffer. The old
  behaviour was to spell check the whole buffer unless :syntax was set.

- Added spelling support to the treesitter highlighter:

  @spell captures in highlights.scm are used to define regions which
  should be spell checked.

- Added support for navigating spell errors for extmarks:

  Works for both ephemeral and static extmarks

- Added '_on_spell_nav' callback for decoration providers:

  Since ephemeral callbacks are only drawn for the visible screen,
  providers must implement this callback to instruct Neovim which
  regions in the buffer need can be spell checked.

  The callback takes a start position and an end position.

  Note: this callback is subject to change hence the _ prefix.

- Added spell captures for built-in support languages

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-09-06 10:14:11 +01:00
05893aea39 Merge pull request #20039 from zeertzjq/cmod-tab
fix(api)!: correctly deal with number before :tab
2022-09-06 10:32:23 +02:00
95fd1ad83e refactor(treesitter): get_{nodes,captures}_at_{position,cursor} 2022-09-06 10:15:23 +02:00
ffe98531b9 feat(treesitter): upstream get_node_at_cursor()
Util from the nvim-treesitter project.
2022-09-06 10:14:05 +02:00
5b8d6e0b32 Merge pull request #15391 from vigoux/ts-lua-builtin
feat(treesitter): highlighting for core languages, enabled for Lua
2022-09-06 10:10:01 +02:00
4bf005e9fd vim-patch:partial 0daafaa7d99e (#20083)
Update runtime files
0daafaa7d9

skip vim9script ftplugin
create userfunc.txt from Neovim content (skip section 3, needs 9.0.0379)
2022-09-06 08:57:53 +02:00
5b7213ad7f docs: update .mailmap (#20086)
Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2022-09-06 08:57:03 +02:00
0822896efc feat(treesitter): add vim.treesitter.start(), enable for Lua
* Add vim.treesitter.start() for starting treesitter highlighting via
  ftplugin or autocommand (can be extended later for fold, indent,
  matchpairs, ...)
* Add vim.treesitter.stop() for manually stopping treesitter
  highlighting
* Enable treesitter highlighting for Lua if
  `vim.g.ts_highlight_lua = true` is set in `init.lua`
2022-09-06 08:08:29 +02:00
97f38f0a9b fix(treesitter): do not link @error by default
The @error capture is used for tree-sitter's ERROR node, which indicates
a parsing error -- which can be quite frequent (and jarring) while typing.

Users can still manually `hi link @error Error` in their config.
2022-09-06 07:57:46 +02:00
64cc78c9f3 feat(treesitter): add injections 2022-09-06 07:57:46 +02:00
e85b8aa768 feat(treesitter): add viml parser and queries 2022-09-06 07:57:46 +02:00
6254b0fd3b ci(tests): don't skip parsers on functionaltest
Treesitter parsers are now a mandatory part of the installation and
should be tested on all platforms. Remove `pending_c_parser` helper.
2022-09-06 07:57:46 +02:00
905dd49fec feat(treesitter): bundle Lua parser and queries
parser from https://github.com/MunifTanjim/tree-sitter-lua
queries from nvim-treesitter
2022-09-06 07:57:46 +02:00
da34833fdf fix: assertion failure when requiring missing module in autocmd
Closes https://github.com/neovim/neovim/issues/15348
2022-09-05 19:11:25 +02:00
93f32bb0aa build(nix): removed the useless 'app'
the format changed depending on the nix version and it is useless
anyway.
2022-09-05 17:47:06 +02:00
fb39bba5a6 Merge pull request #20088 from zeertzjq/vim-9.0.0386
vim-patch:9.0.0386: some code blocks are nested too deep

N/A patches for version.c:

vim-patch:9.0.0385: GUI: when CTRL-D is mapped in Insert mode it gets inserted
2022-09-05 23:02:01 +08:00
f6a8d395a7 refactor(ex_cd): add an early return to fix clint warning
The popupmenu.c change is unrelated.
2022-09-05 22:36:09 +08:00
fc7a64291a vim-patch:9.0.0386: some code blocks are nested too deep
Problem:    Some code blocks are nested too deep.
Solution:   Bail out earlier. (Yegappan Lakshmanan, closes vim/vim#11058)
b1f471ee20
2022-09-05 22:36:09 +08:00
8570a700cc build(nix): bumped flake 2022-09-05 11:31:24 +02:00
29cd072351 build(flake): add sumneko lsp in PATH
and reformatted the file
2022-09-05 11:31:22 +02:00
a220650fd6 docs(contributing): fix broken link (#20044) 2022-09-05 08:44:52 +02:00
5ac6654334 Merge pull request #19481 from zeertzjq/vim-8.2.4674
Add 'mousemoveevent' as a UI option
2022-09-04 21:44:31 +08:00
82d128405a feat(pum): pretend 'mousemoveevent' is set when showing right-click menu 2022-09-04 21:18:23 +08:00
ceb09701f2 feat(api): add "move" to nvim_input_mouse 2022-09-04 21:18:23 +08:00
04bd700ac3 feat(tui): support 'mousemoveevent' 2022-09-04 21:18:22 +08:00
a5fe7940c8 feat(ui-ext): make 'mousemoveevent' a ui_option 2022-09-04 21:18:22 +08:00
00b49dd8dd vim-patch:8.2.4674: cannot force getting MouseMove events
Problem:    Cannot force getting MouseMove events.
Solution:   Add the 'mousemoveevent' option with implementaiton for the GUI.
            (Ernie Rael, closes vim/vim#10044)
c4cb544cd5

This only ports the docs and the option variable.
The following commits will actually implement it as a UI option.
2022-09-04 21:18:08 +08:00
900a774182 Merge pull request #20073 from zeertzjq/vim-088e8e344352
vim-patch:7.4.{1578,1624},088e8e344352
2022-09-04 20:41:01 +08:00
21dad0dcf3 vim-patch:088e8e344352
Update runtime files.
088e8e3443

Also cherry-pick "partial" tag from a later runtime update.
2022-09-04 18:39:55 +08:00
6f7d55d3d9 vim-patch:7.4.{1578,1624}
975b5271ee
03602ec28e
2022-09-04 18:39:55 +08:00
24fbda04b9 build(deps): bump tree-sitter-c to v0.20.2 (#20079) 2022-09-04 12:09:04 +02:00
ea10e0c104 ci: remove gpanders from api reviewers (#20074) 2022-09-03 21:49:45 -06:00
927d4d2a15 fix(filetype): run filetype.match on StdinReadPost (#20070)
Problem: filetype detection does not run on piped input
Solution: add `StdinReadPost` to main filetype.lua autocommand

Rationale: legacy filetype detection checked contents by sourcing
`scripts.vim` in separate autocommands, including on `StdinReadPost`.
For Lua filetype detection, this was moved into the main autocommand,
with bundled `scripts.vim` gated behind `g:do_legacy_filetype` (i.e.,
only user `scripts.vim` are sourced for compatibility by default). Adding
`StdinReadPost` to the main autocommand again runs content checks on
piped input without requiring code duplication and low-payoff
refactoring.
2022-09-03 19:27:57 +02:00
c50460cf3b feat(treesitter): include language in invalid query error (#14053) 2022-09-03 16:02:58 +02:00
ea611c7122 ci(clint): remove "Inner expression indentation should be 4" rule (#20047)
It completely breaks down in shada.c and is generally useless.
2022-09-03 12:00:00 +02:00
5296e9407d build(deps): bump tree-sitter to v0.20.7 (#20067) 2022-09-03 11:30:24 +02:00
1e3073bc35 docs: update .git-blame-ignore-revs (#20066) 2022-09-03 10:18:05 +01:00
042d5df956 Merge pull request #20063 from zeertzjq/vim-9.0.0360
vim-patch:8.2.1505,9.0.{0360,0362}
2022-09-03 09:39:13 +08:00
c62e5b5079 vim-patch:9.0.0362: expanding ":e %" does not work for remote files
Problem:    Expanding ":e %" does not work for remote files.
Solution:   If the "%" or "#" file does not exist add the expansion anyway.
f5724376ab
2022-09-03 09:01:09 +08:00
7243b1cbde vim-patch:9.0.0360: crash when invalid line number on :for is ignored
Problem:    Crash when invalid line number on :for is ignored.
Solution:   Do not check breakpoint for non-existing line.
35d21c6830

Test does not fail without the fix in Nvim as Nvim uses 0 when line
number overflows. If it is changed to MAXLNUM then the test does fail
without the fix, but using 0 seems better as E481 is still given.
2022-09-03 09:01:09 +08:00
05b49ef975 vim-patch:8.2.1505: not all file read and writecode is tested
Problem:    Not all file read and writecode is tested.
Solution:   Add a few tests. (Dominique Pellé, closes vim/vim#6764)
1b04ce2d40

Cherry-pick Test_glob() from patch 8.2.0634.
2022-09-03 09:01:08 +08:00
1ffd527c83 refactor: migrate comment style (#20012)
Done automatically using the following perl command:

  perl -pi -0777pe 's#\n\K */\*\n(.+?)\s*\*/\n#join("\n", map { $_ =~ s:^\s*\K \*://:; $_ } split("\n", $1)) . "\n"#sge' src/nvim/**/*.c

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 17:39:49 +01:00
69456f3414 Merge pull request #20026 from dundargoc/refactor/char_u/7
refactor: replace char_u with char 7: remove `vim_strnsave`
2022-09-02 17:06:00 +02:00
1ef7720567 fix(api)!: correctly deal with number before :tab
Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
2022-09-02 22:28:57 +08:00
2afcdbd63a feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
e085d0be31 Merge pull request #20055 from famiu/fix/ui-attach/memory-leak
fix(ui): ui compositor does not correctly free event callbacks
2022-09-02 15:07:39 +02:00
2dd55f81f7 fix(ui): ui compositor does not correctly free event callbacks
Prior to this PR, when freeing event callbacks, UI compositor did not
free the luarefs which could cause potential memory leaks. This PR fixes
that by freeing the luarefs properly.
2022-09-02 17:49:51 +06:00
ce80b8f50d vim-patch:9.0.0349: filetype of *.sil files not well detected (#20050)
Problem:    Filetype of *.sil files not well detected.
Solution:   Inspect the file contents to guess the filetype.
be807d5824
2022-09-02 08:16:17 +02:00
12fe197cff Merge pull request #20040 from zeertzjq/vim-9.0.0342
vim-patch:9.0.{0342,0346}: :horizontal modifier
2022-09-01 21:31:38 +08:00
689f5d604e feat(api): add support for :horizontal modifier 2022-09-01 20:53:43 +08:00
56bf026dea vim-patch:9.0.0346: :horizontal modifier not fully supported
Problem:    :horizontal modifier not fully supported.
Solution:   Also use :horizontal for completion and user commands.
            (closes vim/vim#11025)
d3de178e53
2022-09-01 20:28:23 +08:00
c65b1f3e15 vim-patch:9.0.0342: ":wincmd =" equalizes in two directions
Problem:    ":wincmd =" equalizes in two directions.
Solution:   Make ":vertical wincmd =" equalize vertically only and
            ":horizontal wincmd =" equalize horizontally only.
21c3a80a7f
2022-09-01 20:25:29 +08:00
49e893f296 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-01 10:47:42 +02:00
db2e5f46f5 fix(lua): make ui_attach()/ui_detach() take effect immediately (#20037) 2022-09-01 16:37:29 +08:00
48ca1d4ce8 Merge pull request #20022 from dundargoc/refactor/char_u/6
refactor: replace char_u with char 6
2022-09-01 10:25:27 +02:00
d9a873f278 Merge pull request #20038 from bfredl/unflush
perf(messages): don't call ui_flush() per message line in various places
2022-09-01 10:18:14 +02:00
5f92d9b345 perf(messages): don't call ui_flush() per message line in various places
When msgsep is used, message scrolling is emulated. To make message
output fast, inhibit emulated scrolling until the full message text
is known
2022-09-01 09:44:01 +02:00
dd8489c399 Merge pull request #20023 from bfredl/hlarena
refactor(highlight): make hlattrs2dict always use pre-allocated dict
2022-09-01 09:22:31 +02:00
a62cb406b1 fix(maparg): remove double allocation (#20033)
ASAN doesn't catch this, as it is referenced by the garbage collector.
Also remove a condition that is always true.
2022-09-01 10:22:28 +08:00
8740e0bd58 vim-patch:9.0.0343: ColorScheme autocommand triggered when colorscheme not found (#20032)
Problem:    ColorScheme autocommand triggered when colorscheme is not found.
            (Romain Lafourcade)
Solution:   Only trigger ColorScheme when loading the colorscheme succeeds.
            (closes vim/vim#11024)
5d09a401ec

Most of Test_colorscheme() is applicable to Nvim.
2022-09-01 09:12:20 +08:00
0c6b39894f feat(mapset): support restoring Lua callback (#20024)
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly

Problem:    mapset() does not restore <Nop> mapping properly.
Solution:   Use an empty string for <Nop>. (closes vim/vim#11022)
92a3d20682
2022-09-01 06:19:49 +08:00
c0050b71e5 Merge pull request #16396 from bfredl/luaevent
feat(lua): vim.ui_attach to get ui events from lua
2022-08-31 22:03:56 +02:00
bd51ac2a34 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 21:17:10 +02:00
ba8be7446d refactor(highlight): make hlattrs2dict always use pre-allocated dict
hlattrs2dict used to work with both allocated and unallocated
dicts which was quite messy. Now always delegate allocation to caller.
2022-08-31 21:15:04 +02:00
f078a3453a Merge pull request #20007 from dundargoc/refactor/char_u/5
refactor: replace char_u with char 5
2022-08-31 20:50:43 +02:00
f31db30975 feat(lua): vim.ui_attach to get ui events from lua
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-08-31 20:40:17 +02:00
933c80e8f9 refactor(mappings)!: mapblock_fill_dict() use API Dictionary (#20020)
This introduces the following breaking changes:
- nvim_get_keymap now always returns a LuaRef object as "callback" for a
  Lua mapping regardless of how it is called. The LuaRef object can be
  called from Lua and Vim script, but is lost over RPC.
- maparg() now returns a Funcref instead of a ref number as "callback"
  for a Lua mapping. The Funcref can be called from Lua and Vim script,
  but is lost over RPC.

This may also make nvim_get_keymap faster, but make maparg() slower.
2022-08-31 21:14:14 +08:00
fb1edb2f57 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 13:47:18 +02:00
fa747d004a fix(api): nvim_set_hl bail out on invalid group name (#20021) 2022-08-31 19:47:10 +08:00
0903702634 vim-patch:9b03d3e75b42 (#20013)
Update runtime files
9b03d3e75b
2022-08-31 08:08:51 +02:00
f4274d0f62 vim-patch:8.2.3102: test for crash fix does not fail without the fix (#20018)
Problem:    Test for crash fix does not fail without the fix.
Solution:   Adjust the test sequence. (closes vim/vim#8506)
3777d6e32b

Cherry-pick CheckUnix from patch 8.2.1432.
2022-08-31 09:41:00 +08:00
5ff2ea6687 vim-patch:8.2.0301: insufficient testing for exception handling (#20016)
Problem:    Insufficient testing for exception handling and the "attention"
            prompt.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5681)
b654103ad1

Fix memory leak from last char_u refactor.
2022-08-31 07:24:16 +08:00
518b5c65b0 vim-patch:8.1.2037: can call win_gotoid() in cmdline window (#20015)
Problem:    Can call win_gotoid() in cmdline window.
Solution:   Disallow switching windows. (Yasuhiro Matsumoto, closes vim/vim#4940)
a046b37c22
2022-08-31 06:58:28 +08:00
94a2bc5940 vim-patch:9.0.0332: overwrite check may block BufWriteCmd (#20014)
Problem:    Overwrite check may block BufWriteCmd.
Solution:   Do not use overwrite check when 'buftype' is "acwrite".
            (closes vim/vim#11011)
9c8f94636b
2022-08-31 06:27:39 +08:00
813476bf72 fix(exceptions): restore did_throw (#20000)
`!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false`
is sometimes used to defer exception handling for later (without forgetting the
exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred
to a different call (e.g: when `try_level > 0`).

In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of
`did_throw = false`, but also causes the pending exception to be lost, which
also leaks as `discard_exception()` wasn't used.

It may be possible to fix this by saving/restoring `current_exception`, but
handling all of `did_throw`'s edge cases seems messier. Maybe not worth
diverging over.

This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown
due to Windows missing `man`, but they're lost; skip these tests if `man` isn't
executable.
2022-08-30 23:13:52 +01:00
6b7eed1884 Vim 9.0.{0314,0319}: some filetypes are not recognized (#20005)
* vim-patch:9.0.0314: VDM files are not recognized

Problem:    VDM files are not recognized.
Solution:   Add patterns for VDM files. (Alessandro Pezzoni, closes vim/vim#11004)
bf26941f40

* vim-patch:9.0.0319: Godot shader files are not recognized

Problem:    Godot shader files are not recognized.
Solution:   Add patterns for "gdshader". (Maxim Kim, closes vim/vim#11006)
d5c8f11905
2022-08-30 21:16:03 +02:00
2828aae7b4 refactor: replace char_u with char 4 (#19987)
* refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2022-08-30 14:52:09 +02:00
9397e70b9e docs(lua): present vim.o as default and vim.opt as special-purpose #19982
Problem: People are confused about `vim.o` and `vim.opt`
Solution: Clarify that `vim.o` is the default interface, with `vim.opt`
          specifically meant for interacting with list-style options.
2022-08-30 05:46:38 -07:00
981ae83fad fix(docs): update lsp.rpc.start docs to match return value changes (#20003)
Follow up to https://github.com/neovim/neovim/pull/19916
2022-08-30 13:14:27 +02:00
0368ca70c4 docs(lsp): replace formatting_sync example in lsp-faq (#19994)
`formatting_sync` is deprecated
2022-08-30 13:14:09 +02:00
f9c183c0ca Merge pull request #19897 from bfredl/statushl
fix(highlight): set the window namespace when redrawing statusline
2022-08-30 10:59:58 +02:00
6ab2bf6819 fix(highlight): set the window namespace when redrawing statusline 2022-08-30 10:28:11 +02:00
568737d5b3 feat(tui): recognize sidescroll events (#19992)
Ref https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
This works in xterm and kitty.
CSI < 66 ; x ; y M sequence is for ScrollWheelLeft.
CSI < 67 ; x ; y M sequence is for ScrollWheelRight.
2022-08-30 10:55:00 +08:00
7f20d61e00 Merge pull request #19999 from zeertzjq/vim-9.0.0320
vim-patch:9.0.0320: command line type of CmdlineChange differs from getcmdtype()
2022-08-30 07:07:50 +08:00
e6e9879cb3 vim-patch:9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Problem:    Command line type of CmdlineChange differs from getcmdtype().
Solution:   Use the same type. (closes vim/vim#11005)
54acb90d9e
2022-08-30 06:33:09 +08:00
2c83d7b2dd refactor: move cmdline functions to ex_getln.c 2022-08-30 06:32:08 +08:00
f58a979599 vim-patch:9.0.0318: clearing screen causes flicker (#19993)
Problem:    Clearing screen causes flicker.
Solution:   Do not clear but redraw in more cases.  Add () to "wait_return".
13608d851a

Only 2 lines of actual code change.
2022-08-30 06:26:06 +08:00
e78e369a9d Merge pull request #19997 from bfredl/lastsep
fix(redraw): handle switching to a tabpage with larger p_ch value
2022-08-29 23:52:47 +02:00
8fd66ff5c5 fix(redraw): handle switching to a tabpage with larger p_ch value 2022-08-29 21:58:07 +02:00
efacb6e974 fix(lsp): clean the diagnostic cache when buffer delete (#19449)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-08-29 19:09:14 +02:00
68efac3683 Merge pull request #19973 from dundargoc/refactor/char_u/3
refactor: replace char_u with char 3: revenge of the unsigned
2022-08-29 18:46:38 +02:00
126fe7fbc9 Merge pull request #19916 from mfussenegger/lsp-tcp
Adds TCP support for lsp.
Usage example:

```
vim.lsp.start({ name = 'godot', cmd = vim.lsp.rpc.connect('127.0.0.1', 6008) })
```
2022-08-29 18:26:14 +02:00
58f30a326f refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-29 15:48:56 +02:00
92bc11a891 vim-patch:9.0.0316: screen flickers when 'cmdheight' is zero (#19991)
Problem:    Screen flickers when 'cmdheight' is zero.
Solution:   Redraw over existing text instead of clearing.
f73e5ba56f
2022-08-29 20:22:15 +08:00
e6af1cf250 Merge pull request #19971 from dundargoc/refactor/remove-casts
refactor: remove redundant casts
2022-08-29 13:23:43 +02:00
5fe6bde296 Merge pull request #19961 from dundargoc/refactor/char_u/2
refactor: replace char_u with char 2: electric chaaralo
2022-08-29 12:50:22 +02:00
f05cc672e3 Merge pull request #19975 from bfredl/chartabsize
refactor(plines): use a struct for chartabsize state
2022-08-29 12:48:51 +02:00
ea4e9c71cc refactor(plines): use a struct for chartabsize state
This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text

The logic for inline virtual text is going to be different in nvim than
text property based text in vim, but this refactor is still useful,
as calculation of displayed linesize is going to be stateful in a
similar way.
2022-08-29 12:05:34 +02:00
253f0ffd8d vim-patch:9.0.0285: it is not easy to change the command line from a plugin (#19979)
vim-patch:9.0.0285: it is not easy to change the command line from a plugin

Problem:    It is not easy to change the command line from a plugin.
Solution:   Add setcmdline(). (Shougo Matsushita, closes vim/vim#10869)
07ea5f1509
2022-08-29 13:11:52 +08:00
1dcaa75a65 fix(events): triggered WinScrolled when only skipcol changed (#19972)
fix(events): trigger WinScrolled when only skipcol changed

vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes

Problem:    WinScrolled is not triggered when only skipcol changes.
Solution:   Add w_last_skipcol and use it. (closes vim/vim#10998)
670ab0334b
2022-08-29 06:16:20 +08:00
b21980bd60 fix(keywordprg): default to :help if set to empty string (#19983) 2022-08-29 05:58:32 +08:00
60ec6e34d5 feat(lsp): add tcp support 2022-08-28 14:07:53 +02:00
46bb34e26b refactor(lsp): extract rpc client from rpc.start
Makes the previously inner functions re-usable for a TCP client
2022-08-28 14:07:53 +02:00
7d3e4aee6a refactor(lsp): encapsulate rpc uv handle
To prepare for different transports like TCP where the handle won't have
a kill method.
2022-08-28 14:07:53 +02:00
f9641d1ac6 refactor(lsp): factor out read_loop function 2022-08-28 14:07:53 +02:00
88c32b5eba fix(l10n): improve zh_CN and zh_TW translations (#19969) 2022-08-28 17:07:24 +08:00
7a9b593796 vim-patch:8.2.3813: confusing error when using :cc without error list (#19978)
Problem:    confusing error when using :cc without error list. (Gary Johnson)
Solution:   Give the "no errors" error.
a5d78d1f11

Cherry-pick e_quickfix -> e_no_errors rename from patch 8.2.3190.
2022-08-28 07:22:27 +08:00
691f4715c0 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-27 17:59:43 +02:00
20305494f8 refactor: remove redundant casts 2022-08-27 14:26:18 +02:00
09c6ce8c4e docs: fix typos (#19798)
Co-authored-by: adrian5 <adrian5@users.noreply.github.com>
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2022-08-27 15:56:58 +08:00
523600ea6c vim-patch:8.2.1269: language and locale code spread out (#19964)
Problem:    Language and locale code spread out.
Solution:   Move relevant code to src/locale.c. (Yegappan Lakshmanan,
            closes vim/vim#6509)
054f14bbe5

Also remove redundant <locale.h> includes.
2022-08-27 11:26:47 +08:00
814c173b9d vim-patch:8.2.0660: the search.c file is a bit big (#19963)
Problem:    The search.c file is a bit big.
Solution:   Split off the text object code to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#6007)
ed8ce057b7
2022-08-27 09:58:25 +08:00
58b29e344c Merge pull request #19962 from zeertzjq/vim-9.0.0278
vim-patch:9.0.{0278,0279,0283,0284}: cmdline completion patches
2022-08-27 07:33:29 +08:00
608134794d vim-patch:9.0.0284: using static buffer for multiple completion functions
Problem:    Using static buffer for multiple completion functions.
Solution:   Use one buffer in expand_T.
5ff595d9db
2022-08-27 07:03:07 +08:00
2676555b22 vim-patch:9.0.0283: cannot complete "syn list @cluster"
Problem:    Cannot complete "syn list @cluster".
Solution:   Recognize and handle "list @". (Björn Linse, closes vim/vim#10990)
af9a6002e0
2022-08-27 07:03:07 +08:00
cc2c8be481 vim-patch:9.0.0279: the tiny version has the popup menu but not 'wildmenu'
Problem:    The tiny version has the popup menu but not 'wildmenu'.
Solution:   Graduate the wildmenu feature.
5416232707

N/A patches for version.c:

vim-patch:9.0.0281: build failure without the +eval feature

Problem:    Build failure without the +eval feature.
Solution:   Add #ifdef.
58dcbf1c65
2022-08-27 07:03:07 +08:00
e70ef80f77 vim-patch:9.0.0278: the +wildignore feature is nearly always available
Problem:    The +wildignore feature is nearly always available.
Solution:   Graduate +wildignore for consistency.
074fbd4131
2022-08-27 07:03:06 +08:00
d5e0883712 Merge pull request #19955 from zeertzjq/vim-9.0.0272
vim-patch:9.0.{0272,0274,0275,0276}: buffer loading fixes
2022-08-27 06:32:41 +08:00
d813ef0097 vim-patch:9.0.0276: 'buftype' values not sufficiently tested
Problem:    'buftype' values not sufficiently tested.
Solution:   Add and extend tests with 'buftype' values. (closes vim/vim#10988)
93f72cc119

"terminal" and "popup" buffer types cannot be tested, and commenting
them out causes an error, so just remove them.
2022-08-27 06:12:52 +08:00
45c23a757c vim-patch:9.0.0275: BufEnter not triggered when using ":edit" in "nofile" buffer
Problem:    BufEnter not triggered when using ":edit" in "nofile" buffer.
Solution:   Let readfile() return NOTDONE. (closes vim/vim#10986)
a9b5b85068
2022-08-27 06:12:52 +08:00
52f00a6c4d vim-patch:9.0.0274: netrw plugin does not show remote files
Problem:    Netrw plugin does not show remote files.
Solution:   Do read a file when 'buftype' is "acwrite". (closes vim/vim#10983)
c312619f7c
2022-08-27 06:12:52 +08:00
900a151bf5 vim-patch:9.0.0272: BufReadCmd not triggered when loading a "nofile" buffer
Problem:    BufReadCmd not triggered when loading a "nofile" buffer. (Maxim
            Kim)
Solution:   Call readfile() but bail out before reading a file.
            (closes vim/vim#10983)
b1d2c8116c
2022-08-27 06:12:52 +08:00
b0e052a8b3 Merge pull request #19957 from dundargoc/refactor/char_u/1
refactor: replace char_u with char
2022-08-26 23:07:56 +02:00
3952770360 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-26 22:24:28 +02:00
6a13b8fa54 vim-patch:7dd543246a4c (#19960)
Update runtime files
7dd543246a
2022-08-26 19:58:10 +02:00
0b72e23bf1 vim-patch:8.2.0674: some source files are too big (#19959)
Problem:    Some source files are too big.
Solution:   Move text formatting functions to a new file. (Yegappan
            Lakshmanan, closes vim/vim#6021)
11abd09521

Cherry-pick set_can_cindent() from patch 8.1.2062.
Cherry-pick global old_indent from patch 8.2.2127.
2022-08-26 22:37:20 +08:00
2ecb4076df Merge pull request #19931 from bfredl/scopedhl
feat(highlight)!: use scoped @foo.bar.special groups for tree-sitter highlight
2022-08-26 14:43:58 +02:00
b04ef7f6b9 fix(treesitter): make it get_captures_at_position 2022-08-26 13:57:31 +02:00
064ecb9ec5 feat(treesitter): upstream get_hl_groups_at_position()
Util from the nvim-treesitter project.
2022-08-26 13:57:31 +02:00
030b422d1e feat(treesitter)!: use @foo.bar style highlight groups
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.

The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)

For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
2022-08-26 13:57:31 +02:00
914ba18a49 feat(highlight): support scoped @spam.eggs.baked_beans groups 2022-08-26 13:57:31 +02:00
6547f4397f vim-patch:8.1.2331: the option.c file is still very big (#19954)
Problem:    The option.c file is still very big.
Solution:   Move a few functions to where they fit better. (Yegappan
            Lakshmanan, closes vim/vim#4895)
7bae0b1bc8

vim-patch:9.0.0271: using INIT() in non-header files

Problem:    Using INIT() in non-header files.
Solution:   Remove INIT(). (closes vim/vim#10981)
9b7d2a9596
2022-08-26 18:49:29 +08:00
06d5c6332d Merge pull request #19947 from lewis6991/truefalse 2022-08-26 11:11:14 +01:00
2498e9feb0 refactor: change FALSE/TRUE to false/true
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-26 09:36:55 +01:00
946c0aa66f Merge pull request #19953 from zeertzjq/vim-9.0.0036
vim-patch:8.2.2524,9.0.(0036,0037,0038,0040}
2022-08-26 10:46:18 +08:00
36fdad5575 vim-patch:9.0.0040: use of set_chars_option() is confusing
Problem:    Use of set_chars_option() is confusing.
Solution:   Add "apply" argument to store the result or not.  Merge similar
            code.
b67f0c8e49
2022-08-26 10:15:02 +08:00
db28c2ca2b refactor: set_chars_option()
Rename "set" to "apply" and tidy up variable scopes.
2022-08-26 10:14:59 +08:00
752d397cae vim-patch:9.0.0038: 'listchars' test fails
Problem:    'listchars' test fails.
Solution:   Use window-local value after setting the global value
5ed26faace
2022-08-26 10:14:59 +08:00
fa1c761d62 vim-patch:9.0.0036: 'fillchars' cannot have window-local values
Problem:    'fillchars' cannot have window-local values.
Solution:   Make 'fillchars' global-local. (closes vim/vim#5206)
96ba25ac01

Cherry-pick g:run_nr from patch 8.2.0454.

N/A patches for version.c:

vim-patch:9.0.0037: build error

Problem:    Build error.
Solution:   Add missing change.
510f03738d
2022-08-26 10:14:59 +08:00
1ba3d5c712 vim-patch:8.2.2524: cannot change the characters displayed in the foldcolumn
Problem:    Cannot change the characters displayed in the foldcolumn.
Solution:   Add fields to 'fillchars'. (Yegappan Lakshmanan, Matthieu Coudron,
            closes vim/vim#7860)
3aca5a6fbc
2022-08-26 10:14:58 +08:00
c12f6002a1 Merge pull request #19950 from zeertzjq/vim-9.0.0270
vim-patch:9.0.{0262,0263,0266,0268,0270}: too many #ifdefs
2022-08-26 07:37:57 +08:00
207fe4810e vim-patch:9.0.0270: some values of 'path' and 'tags' invalid in the tiny version
Problem:    Some values of 'path' and 'tags' do not work in the tiny version.
Solution:   Graduate the +path_extra feature.
2bd9dbc19f
2022-08-26 07:00:52 +08:00
4dd34989cd vim-patch:9.0.0263: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Make some functions always available.
6d4b2f54df

N/A patches for version.c:

vim-patch:9.0.0262: build failure without the +quickfix feature

Problem:    Build failure without the +quickfix feature.
Solution:   Add #ifdef.
2e6dcbc445

vim-patch:9.0.0266: compiler warning for unused argument

Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
340dafd155

vim-patch:9.0.0268: build error without the +eval feature

Problem:    Build error without the +eval feature.
Solution:   Remove #ifdef.
0166e398d1
2022-08-26 07:00:50 +08:00
6e9980fc3b Merge pull request #19628 from dundargoc/refactor/char_u/2
refactor: replace char_u with char
2022-08-25 22:35:20 +02:00
bfd1adc62c Merge pull request #19946 from bfredl/newnode
feat: upstream some nvim-treesitter functions
2022-08-25 21:35:13 +02:00
73ee2b35d1 fix(tests): use pending_c_parser when needed 2022-08-25 20:49:27 +02:00
40855b0143 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-25 18:59:12 +02:00
e5fe41198c fix(treesitter): more efficient node:root() 2022-08-25 18:24:56 +02:00
8554164b1e fix(docs): update auto-generated documentation 2022-08-25 18:01:27 +02:00
244a115e49 feat(treesitter): clarify similar 'get_node_range' functions
The private 'get_node_range' function from the languagetree module has
been renamed and remains private as it serve a purpose that is only
relevant inside the languagetree module.

The 'get_node_range' upstreamed from nvim-treesitter in the treesitter
module has been made public as it is in itself a utlity function.
2022-08-25 18:01:15 +02:00
133ff6e11e feat(treesitter): upstream node_contains()
Util from the nvim-treesitter project.
2022-08-25 18:01:15 +02:00
f57341a4b6 feat(treesitter): upstream node_length() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
baba43681e feat(treesitter): upstream get_root_for_node() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
a577fb778a feat(treesitter): upstream get_named_children() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
6b2d42eb03 feat(treesitter): add ability to retreive a tree/node given a range 2022-08-25 18:01:14 +02:00
733b2e12b8 feat(treesitter): add opts.concat to query.get_text_node
As part of the upstream of utility functions from nvim-treesitter, this
option when set to false allows to return a table (downstream behavior).
Effectively making the switch from the downstream to the upstream
function much easier.
2022-08-25 18:01:14 +02:00
3aba4ba378 feat(treesitter): upstream is_parent()
Util from the nvim-treesitter project.
Renamed is_parent to is_ancestor for clarity.
2022-08-25 18:01:14 +02:00
22f9200302 Merge pull request #19945 from zeertzjq/vim-8.2.0911
vim-patch:8.2.{0911,0923}: cmdwin interrupted
2022-08-25 22:02:29 +08:00
22536eb527 vim-patch:8.2.0923: cmdline test is slow
Problem:    Cmdline test is slow.
Solution:   Use WaitForAssert().
c82dd86084
2022-08-25 21:38:11 +08:00
4ecea0e001 vim-patch:8.2.0911: crash when opening a buffer for the cmdline window fails
Problem:    Crash when opening a buffer for the cmdline window fails. (Chris
            Barber)
Solution:   Check do_ecmd() succeeds.  Reset got_int if "q" was used at the
            more prompt. (closes vim/vim#6211)
9b7cce28d5

Make code match latest Vim instead.
2022-08-25 21:38:11 +08:00
99f8d34c8a Merge pull request #19934 from lewis6991/prepostincr 2022-08-25 14:30:12 +01:00
cd2d3aa48f vim-patch:9.0.0261: bufload() reads a file even if the name is not a file name (#19944)
Problem:    bufload() reads a file even if the name is not a file name. (Cyker
            Way)
Solution:   Do not read the file when the buffer name is not a file name.
            (closes vim/vim#10975)
2eddbacd6d
2022-08-25 20:23:29 +08:00
93f24403f8 refactor: pre-incr to post-incr 2022-08-25 13:10:41 +01:00
1b29288709 vim-patch:8.2.4356: command line completion functions are very long (#19943)
Problem:    Command line completion functions are very long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9753)
620d8edba0

Change fifth argument of set_context_by_cmdname() to "context".
2022-08-25 19:06:26 +08:00
274e1122ad fix(usercmd): also check for whitespace after escaped character (#19942) 2022-08-25 17:57:32 +08:00
f0658fd552 refactor: suppress clang and PVS warnings (#19940) 2022-08-25 15:20:54 +08:00
5c9baa6f35 docs(contributing): add documenting guidelines from wiki (#19924)
Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2022-08-25 09:06:37 +02:00
170617c7a2 Merge pull request #19939 from zeertzjq/vim-8.2.4289
vim-patch: compiler warnings
2022-08-25 13:41:17 +08:00
6584f3a2b6 vim-patch:8.2.4289: warnings reported by MSVC
Problem:    Warnings reported by MSVC.
Solution:   Rename variables and other fixes. (Ken Takata, closes vim/vim#9689)
5411910c77

N/A patches for version.c:

vim-patch:8.2.0091: compiler warnings for size_t / int types

Problem:    Compiler warnings for size_t / int types.
Solution:   Change type to size_t. (Mike Williams)
4d7a248b64

vim-patch:8.2.1299: compiler warning for using size_t for int and void pointer

Problem:    Compiler warning for using size_t for int and void pointer.
Solution:   Add type casts.
d3bb6a82a5

vim-patch:8.2.1906: warning for signed/unsigned

Problem:    Warning for signed/unsigned.
Solution:   Use size_t instead of int. (Mike Williams)
a360dbe3b6

vim-patch:8.2.4531: LGTM warnings for condition and buffer size

Problem:    LGTM warnings for condition always true and buffer size too small.
Solution:   Remove the useless condition.  Make the buffer larger. (Goc
            Dundar, closes vim/vim#9914)
f01a653ac5

vim-patch:8.2.4624: old Coverity warning for resource leak

Problem:    Old Coverity warning for resource leak.
Solution:   Close the file if memory allocation fails.
5d46dcfeed

vim-patch:9.0.0129: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Add a type cast. (Mike Williams, closes vim/vim#10830)
ab146dac6b
2022-08-25 13:18:49 +08:00
e7dd65eea3 vim-patch:8.2.2826: compiler warnings for int to size_t conversion
Problem:    Compiler warnings for int to size_t conversion. (Randall W.
            Morris)
Solution:   Add type casts.
551c1aed65

Still keep it size_t, but avoid calculating multiple times.
2022-08-25 13:06:33 +08:00
7656cd527b vim-patch:8.2.1960: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Initialize the variable.
0fd797eacd
2022-08-25 13:02:01 +08:00
88738bd28f vim-patch:8.2.1728: compiler warning for using uninitialized variable
Problem:    Compiler warning for using uninitialized variable. (John Marriott)
Solution:   Initialize "neighbor".
c53e9c57a9
2022-08-25 12:58:36 +08:00
711635872d vim-patch:8.1.1085: compiler warning for possibly uninitialized variable
Problem:    Compiler warning for possibly uninitialized variable. (Tony
            Mechelynck)
Solution:   Make conditions more logical.
bd9bf266fc
2022-08-25 12:53:34 +08:00
e4e0e8ce6f refactor: ins_compl_show_pum() (#19938)
This marks the remaining part of Vim patch 8.2.3953 as ported, because
ins_compl_upd_pum() has been removed.

vim-patch:8.2.3953: insert completion code is too complicated

Problem:    Insert completion code is too complicated.
Solution:   More refactoring.  Move function arguments into a struct.
            (Yegappan Lakshmanan, closes vim/vim#9437)
6ad84ab3e4
2022-08-25 12:07:49 +08:00
ee02141c7b Merge pull request #19937 from zeertzjq/vim-8.2.3942
vim-patch:8.2.{3942,partial:4001}
2022-08-25 11:17:29 +08:00
b1833bb33b vim-patch:partial:8.2.4001: insert complete code uses global variables
Problem:    Insert complete code uses global variables.
Solution:   Make variables local to the file and use accessor functions.
            (Yegappan Lakshmanan, closes vim/vim#9470)
d94fbfc74a

Skip changes in comments for callback-related functions (not ported).
Also make compl_busy static again.
2022-08-25 10:15:07 +08:00
45d09b46ce vim-patch:8.2.3942: Coverity reports a possible memory leak
Problem:    Coverity reports a possible memory leak.
Solution:   Free the array if allocation fails.
8e7cc6b920
2022-08-25 10:15:07 +08:00
674d3b2d5f Merge pull request #19936 from zeertzjq/vim-8.2.3989
vim-patch:8.2.{2534,3989,4037}: Insert mode completion tests and fixes
2022-08-25 08:54:03 +08:00
3290e472c0 vim-patch:8.2.4037: Insert mode completion is insufficiently tested
Problem:    Insert mode completion is insufficiently tested.
Solution:   Add more tests.  Fix uncovered memory leak. (Yegappan Lakshmanan,
            closes vim/vim#9489)
370791465e
2022-08-25 08:27:44 +08:00
cabc1861c4 vim-patch:8.2.3989: some insert completion code is not tested
Problem:    Some insert completion code is not tested.
Solution:   Add a few tests.  Refactor thesaurus completion. (Yegappan
            Lakshmanan, closes vim/vim#9460)
e982586f8e

vim-patch:9.0.0254: typo in function name

Problem:    Typo in function name.
Solution:   Rename the function. (closes vim/vim#10971)
5fb3aabc2b
2022-08-25 08:27:44 +08:00
6c9a91bebe vim-patch:8.2.2534: missing test coverage
Problem:    Missing test coverage.
Solution:   Improve test coverage for completion with different encodings,
            mapset(), and term function failures. (Dominique Pellé,
            closes vim/vim#7877)
a1070eae77

Cherry-pick E716 -> E715 change from patch 8.2.4861.
2022-08-25 08:27:43 +08:00
6d8b64fffc Merge pull request #19927 from zeertzjq/vim-9.0.0045
vim-patch:9.0.{0045,0046,0060,0102}: Insert mode completion crash fixes
2022-08-25 07:17:52 +08:00
dd77a00621 vim-patch:9.0.0102: reading past end of line with insert mode completion
Problem:    Reading past end of line with insert mode completion.
Solution:   Check text length.
a6f9e30016
2022-08-25 06:53:59 +08:00
6680002169 vim-patch:9.0.0060: accessing uninitialized memory when completing long line
Problem:    Accessing uninitialized memory when completing long line.
Solution:   Terminate string with NUL.
b9e717367c
2022-08-25 06:53:59 +08:00
5d1f0c3eca vim-patch:9.0.0046: reading past end of completion with duplicate match
Problem:    Reading past end of completion with duplicate match.
Solution:   Check string length
baefde1455
2022-08-25 06:53:59 +08:00
c366a63e4c vim-patch:9.0.0045: reading past end of completion with a long line
Problem:    Reading past end of completion with a long line and 'infercase'
            set.
Solution:   Allocate the string if needed.
caea66442d

Cherry-pick the deletion of a blank line from patch 9.0.0027.

N/A patches for version.c:

vim-patch:9.0.0054: compiler warning for size_t to int conversion

Problem:    Compiler warning for size_t to int conversion.
Solution:   Add type cast. (Mike Williams, closes vim/vim#10741)
c7bd2f08e5
2022-08-25 06:53:59 +08:00
d3cd79709b vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02:00
6b9ff5491d fix(treesitter): free memory on removing parser (#19933)
This fixes the ASAN failure.
2022-08-25 06:41:04 +08:00
c545d514df Merge pull request #19830 from lewis6991/hlgroup_name
feat(highlight)!: error on invalid names and allow '.' and '@'
2022-08-24 21:08:21 +02:00
3b2121cedf Merge pull request #19928 from vigoux/ts-fix-c-parser
test(treesitter): make internal lang test pending when necessary
2022-08-24 19:05:58 +02:00
61be343ec8 feat(highlight)!: error on invalid names and allow '.' and '@'
Previously if a highlight group with a name outside the regexp
[a-zA-Z0-9_] was defined, Nvim would emit an "invalid character"
warning message. This was annoying for Lua scripts, as it was very hard
to debug what line of code was triggering this message since it didn't
produce a stack trace.

This has now been promoted to an error with the code E5248.

Additionally the ASCII character period ('.') and at-sign ('@') have
been added to the allowed list of characters of a highlight group name
to support the application of defining hierarchical highlight groups,
e.g. 'TS.keyword'.

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-08-24 17:13:18 +01:00
26ebf67c39 test(treesitter): make internal lang test pending when necessary 2022-08-24 16:59:13 +02:00
b1eaa2b9a3 feat(lua): add vim.iconv (#18286)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-08-24 14:41:31 +01:00
9be4bfc5f4 Merge pull request #19496 from vigoux/ts_internal_lang
feat(treesitter): allow customizing language symbol name
2022-08-24 15:36:58 +02:00
f1ea126a6e Merge pull request #19906 from bfredl/bigstage
perf(api): allow to use an arena for return values
2022-08-24 15:22:30 +02:00
f91b1885dd feat(eval)!: make Vim functions return inner window width and height (#19743)
In non-multigrid UI the only change is that the returned height now
excludes winbar, and this is compatible with Vim.

In multigrid UI this means the return value of these functions now
reflect the space available for buffer lines in a window.

No change in nvim_win_get_height() and nvim_win_get_width().
2022-08-24 21:02:45 +08:00
b0fdce55d0 vim-patch:partial:8.2.3953: insert completion code is too complicated (#19923)
Problem:    Insert completion code is too complicated.
Solution:   More refactoring.  Move function arguments into a struct.
            (Yegappan Lakshmanan, closes vim/vim#9437)
6ad84ab3e4

Skip most pum-related refactoring.
Cherry-pick rename to match_at_original_text() from patch 8.2.4001.
2022-08-24 20:36:10 +08:00
7784dc9e0d refactor(api): provide a temporary copy solution for nvim_call_atomic
Make the copy_object() family accept an optional arena. More than
half of the callsites should be refactored to use an arena later
anyway.
2022-08-24 14:22:26 +02:00
bcf5ee328e refactor(arena): use a shared block freelist
This is both simpler in client code and more effective (always reuse
block hottest in cache)
2022-08-24 14:22:26 +02:00
b0569f5813 vim-patch:9.0.0020: with some completion reading past end of string (#19922)
Problem:    With some completion reading past end of string.
Solution:   Check the length of the string.
f12129f171
2022-08-24 16:59:03 +08:00
79f32c20f0 Merge pull request #19921 from zeertzjq/vim-8.2.3937
vim-patch:8.2.{3937,3944}: Insert mode completion refactoring
2022-08-24 16:12:15 +08:00
9ac44c7f5d vim-patch:8.2.3944: insert mode completion functions are too long
Problem:    Insert mode completion functions are too long.
Solution:   Split up into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9431)
5d2e007ccb

Cherry-pick can_cindent_get() -> get_can_cindent() from patch 8.1.2062.
2022-08-24 15:47:15 +08:00
ef748af01d vim-patch:8.2.3937: Insert mode completion function is too long
Problem:    Insert mode completion function is too long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9423)
edc6f10390

Cherry-pick a typo fix from patch 8.2.3637.
2022-08-24 15:47:14 +08:00
a4e4609d62 fix(path): path_is_url returns false for "foo:/" #19797
Problem:
path_to_url() returns false for single-slash URIs ("foo:/" vs "foo://").
This is not compliant with the URI spec. https://url.spec.whatwg.org/#url-representation
LSP in particular allows single-slash URIs.

Solution:
Relax path_to_url() to accept single-slash URIs. This is not fully
compliant (only ":" is required by the spec), but it is hopefully good
enough without causing false-positives in typical text files.

ref https://url.spec.whatwg.org/#windows-drive-letter
ref https://github.com/neovim/neovim/pull/19773
ref https://github.com/neovim/neovim/pull/19773#issuecomment-1214763769
2022-08-23 23:38:06 -07:00
9a100ee169 fix(cmdline): do not trigger completion at wrong time (#19920)
Cherry-picked from Vim patches 8.2.4339, 9.0.0238.
2022-08-24 10:28:32 +08:00
64d147b471 vim-patch:9.0.0248: duplicate code in finding a script in the execution stack (#19917)
Problem:    Duplicate code in finding a script in the execution stack.
Solution:   Reduce duplicate code. (closes vim/vim#10961)
a247142ae4
2022-08-24 06:28:37 +08:00
c0d6052654 perf(api): allow to use an arena for return values 2022-08-23 18:34:24 +02:00
6cc6e11929 vim-patch:9.0.0206: redraw flags are not named specifically (#19913)
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
a4d158b3c8
2022-08-23 22:00:19 +08:00
779a25f040 refactor(spell.c): resolve clint errors (#19875)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-23 14:30:02 +01:00
0c0a426e40 doc(CONTRIBUTING): update #19891
- add section for managing includes via IWYU
- recommend clangd over ctags
- tidy up links
- remove ./scripts/check-includes.py
2022-08-23 06:18:05 -07:00
e892b7b383 fix(inspect): escape identifiers that are lua keywords (#19898)
A lua keyword is not a valid table identifier
2022-08-23 13:02:55 +02:00
df4709ddf6 Merge pull request #19905 from zeertzjq/vim-8.2.4726
vim-patch:8.2.{4726,4740,4741,4749,4841,4842}: expand('<script>')
2022-08-23 18:12:28 +08:00
d459b66877 vim-patch:8.2.4842: expand("%:p") is not empty when there is no buffer name
Problem:    expand("%:p") is not empty when there is no buffer name.
Solution:   When ignoring errors still return NULL. (closes vim/vim#10311)
211a5bb235
2022-08-23 17:48:12 +08:00
f1b8683b8c vim-patch:8.2.4841: empty string considered an error for expand()
Problem:    Empty string considered an error for expand() when 'verbose' is
            set. (Christian Brabandt)
Solution:   Do not give an error for an empty result. (closes vim/vim#10307)
a96edb736d
2022-08-23 17:48:12 +08:00
d0b9fe2d5a vim-patch:8.2.4749: <script> is not expanded in autocmd context
Problem:    <script> is not expanded in autocmd context.
Solution:   Add the context to the pattern struct. (closes vim/vim#10144)
            Rename AutoPatCmd to AutoPatCmd_T.
eca7c60d68

Omit AutoPatCmd -> AutoPatCmd_T rename as it is inconsistent.
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Omit acp_script_stx(), use member directly.
2022-08-23 17:48:12 +08:00
7afc17dec1 vim-patch:8.2.4741: startup test fails
Problem:    Startup test fails.
Solution:   Avoid an error for verbose expansion.  Fix that the "0verbose"
            command modifier doesn't work.
60895f3e36

Most code changes has already been ported.
2022-08-23 17:48:12 +08:00
a9e6cf0e64 vim-patch:8.2.4740: when expand() fails there is no error message
Problem:    When expand() fails there is no error message.
Solution:   When 'verbose' is set give an error message.
575445200b
2022-08-23 17:48:12 +08:00
ffa1335047 vim-patch:8.2.4726: cannot use expand() to get the script name
Problem:    Cannot use expand() to get the script name.
Solution:   Support expand('<script>'). (closes vim/vim#10121)
6013d0045d

Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
2022-08-23 17:47:46 +08:00
42e9fe7d95 test: add test for using :normal to stop Visual mode in cmdwin (#19904) 2022-08-23 11:39:25 +08:00
63df91c10a vim-patch:8.2.1046: insufficient tests for src/buffer.c (#19903)
Problem:    Insufficient tests for src/buffer.c.
Solution:   Add more tests.  Move comments related tests to a separate file.
            (Yegappan Lakshmanan, closes vim/vim#6325)
b7e2483655
2022-08-23 11:24:46 +08:00
d5328ea408 vim-patch:8.2.0522: several errors are not tested for (#19901)
Problem:    Several errors are not tested for.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5892)
ee4e0c1e9a

Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
2022-08-23 10:38:53 +08:00
48a4657aee vim-patch:8.1.{1915,1921,1953} (#19900)
vim-patch:8.1.1915: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
1a3a89168d

Move debugbreak() to the right place.

vim-patch:8.1.1921: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
a4208966fb

vim-patch:8.1.1953: more functions can be used as a method

Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.
f9f24ce7a0

Omit test_termcodes.vim: cannot be used and superseded by later patches.
Cherry-pick test_bufline.vim change from patch 8.1.1993.
2022-08-23 08:36:22 +08:00
2fd25fb909 vim-patch:8.1.0832: confirm() is not tested (#19896)
Problem:    confirm() is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3868)
2e05009218
2022-08-23 07:20:23 +08:00
baaaa1f2b3 vim-patch:8.2.3421: a bit of code is not covered by tests (#19895)
Problem:    A bit of code is not covered by tests.
Solution:   Add a few more test cases. (Dominique Pellé, closes vim/vim#8857)
d176ca3dde

Cherry-pick Test_trim() change from patch 8.2.0448.
Cherry-pick Test_History() change from patch 8.2.1736.
Cherry-pick charidx() and trim() type checks from patch 8.2.3135.
2022-08-22 22:09:53 +08:00
3c1d70f20b feat(treesitter): allow customizing language symbol name 2022-08-22 15:34:10 +02:00
15a768eeb0 fix(api): avoid side effects with nvim_parse_cmd (#19890)
Save and restore the cursor and last search pattern and do not change
search history.
2022-08-22 18:06:18 +08:00
2bed0d1d97 vim-patch:8.2.4753: error from setting an option is silently ignored (#19888)
Problem:    Error from setting an option is silently ignored.
Solution:   Handle option value errors better.  Fix uses of N_().
31e5c60a68
2022-08-22 13:56:50 +08:00
d4d27c41b3 fix(edit.c): indentkeys double indent after "!" #12894
which is both unexpected and different from the Vim behaviour.

Indent was triggered once by the '!' check in insert_execute(), and
inserting the char was correctly skipped, but then triggered again in
insert_check() (provided that cindent was not being ignored after manual
indentation, i.e. `can_cindent == true`).

While this is the smallest fix, another solution would be to remove
VimState#check and instead move that to *_enter()/-_execute(), since the
control flow is pretty unnecessarily convoluted as is. That would also
have the benefit of differing less from the Vim source code.
2022-08-21 21:48:18 -07:00
4f6d0d6da9 vim-patch:8.2.2289: Vim9: 'cpo' can become empty (#19887)
Problem:    Vim9: 'cpo' can become empty.
Solution:   Use empty_option instead of an empty string.  Update quickfix
            buffer after restoring 'cpo'.  (closes vim/vim#7608)
e5a2dc87fd

Omit test as it is Vim9 script.
2022-08-22 12:02:45 +08:00
d5cc161dea Merge pull request #19886 from zeertzjq/vim-8.2.2030
vim-patch:8.2.{2030,2031}: some tests fail
2022-08-22 10:15:00 +08:00
b94cfaf080 vim-patch:8.2.2031: some tests fail when run under valgrind
Problem:    Some tests fail when run under valgrind.
Solution:   Avoid timing problems.
18dc355395
2022-08-22 09:53:09 +08:00
af2b078258 vim-patch:8.2.2030: some tests fail on Mac
Problem:    Some tests fail on Mac.
Solution:   Avoid Mac test failures.  Add additional test for wildmenu.
            (Yegappan Lakshmanan, closes vim/vim#7341)
4b2ce1297e
2022-08-22 09:53:07 +08:00
72b03792b6 Merge pull request #19885 from zeertzjq/vim-8.2.4328
vim-patch:8.2.{4328,4334}: wildmenu tests
2022-08-22 09:27:55 +08:00
06a53ab2cb vim-patch:8.2.4334: command line popup menu not positioned correctly
Problem:    Command line popup menu not positioned correctly.
Solution:   Also use vim_strsize() on the existing text. (Naruhiko Nishino,
            closes vim/vim#9727)
68cc2b8a37
2022-08-22 09:08:47 +08:00
99bd895956 vim-patch:8.2.4328: command line complete matches cleard when typing character
Problem:    Command line complete matches cleard when typing character.
            (Dominique Pellé)
Solution:   Only remove a popup menu if there is one.
73a16c22a4
2022-08-22 08:55:54 +08:00
c086bf6079 Merge pull request #19864 from lewis6991/decorfix
fix(ui): don't allow decor provider with ns_id==0
2022-08-21 21:11:56 +02:00
2379699b1e vim-patch:9.0.0236: popup menu not removed when 'wildmenu' reset while visible (#19882)
Problem:    Popup menu not removed when 'wildmenu' reset while it is visible.
Solution:   Do not check p_wmnu, only pum_visible(). (closes vim/vim#10953)
b82a2ab8ad
2022-08-21 22:03:26 +08:00
e3eb6967bc vim-patch:8.2.4325: 'wildmenu' only shows few matches (#19876)
Problem:    'wildmenu' only shows few matches.
Solution:   Add the "pum" option: use a popup menu to show the matches.
            (Yegappan Lakshmanan et al., closes vim/vim#9707)
3908ef5017

Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
2022-08-21 21:31:25 +08:00
dde90f0ca4 fix(api/command): fargs behavior when no arguments are passed (#19862)
Problem: A command defined with `nargs="?"` returns `fargs={""}` to
a Lua callback when executed with no arguments, which is inconsistent
with how`nargs="*"` behaves.

Solution: Pass `fargs={}` for no argument with `nargs="?"` as well.
2022-08-21 15:19:29 +02:00
5928d5c2f1 vim-patch:9.0.0234: cannot make difference between :normal end and argument char (#19879)
Problem:    Cannot make difference between the end of :normal and a character
            in its argument.
Solution:   Add the "typebuf_was_empty" flag. (closes vim/vim#10950)
8d69637133
2022-08-21 19:37:11 +08:00
6b9852cc41 vim-patch:8.2.4754: using cached values after unsetting some environment variables (#19872)
Problem:    Still using cached values after unsetting some known environment
            variables.
Solution:   Take care of the side effects. (closes vim/vim#10194)
7714231bb5

Cherry-pick vim_setenv_ext() from patch 8.2.0200.
2022-08-21 11:37:13 +08:00
506a3ec913 refactor: make wildmenu code closer to Vim (#19870)
This is a small refactor that makes `compl_match_array` static and
doesn't change any behavior.
2022-08-21 11:06:07 +08:00
61ff37952a vim-patch:8.2.1587: loop for handling keys for the command line is too long (#19868)
Problem:    Loop for handling keys for the command line is too long.
Solution:   Move wild menu handling to separate functions. (Yegappan
            Lakshmanan, closes vim/vim#6856)
eadee486c7
2022-08-21 09:18:47 +08:00
741ef87876 vim-patch:8.1.1914: command line expansion code is spread out (#19867)
Problem:    Command line expansion code is spread out.
Solution:   Move set_one_cmd_context(). (Yegappan Lakshmanan, closes vim/vim#4855)
d019039ccd
2022-08-21 08:05:39 +08:00
76d35a5a36 vim-patch:9.0.0231: expanding "**" may loop forever with directory links (#19866)
Problem:    Expanding "**" may loop forever with directory links.
Solution:   Check for being interrupted. (closes vim/vim#10946)
57e95179ab
2022-08-21 07:08:09 +08:00
0d0a336c53 vim-patch:8.1.1886: command line expansion code is spread out (#19861)
Problem:    Command line expansion code is spread out.
Solution:   Move the code to cmdexpand.c. (Yegappan Lakshmanan, closes vim/vim#4831)
66b51420e0
2022-08-21 06:33:24 +08:00
5e15452043 fix(ui): don't allow decor provider with ns_id==0
Fixes #19831
2022-08-20 19:05:22 +01:00
ff5cfcdeab vim-patch:8.1.2045: the option.c file is too big (#19854)
Problem:    The option.c file is too big.
Solution:   Split off the code dealing with strings. (Yegappan Lakshmanan,
            closes vim/vim#4937)
dac1347b4d

Cherry-pick set_string_option_direct_in_win() from patch 8.1.1405.
Cherry-pick shift_line() comment change from patch 8.1.2096.
Move 'clipboard' default parsing to didset_string_options().
Reorder option flags to put Nvim-only flags at the end.
2022-08-20 17:26:44 +08:00
1cc4706e94 vim-patch:e80086446cc2 (#19848)
* vim-patch:e80086446cc2

Update runtime files
e80086446c

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-08-20 10:04:55 +02:00
bffaf1e27e fix(eval): check for v:lua when calling callback (#19855)
This makes callback_call() match call_vim_function() when calling a function.
2022-08-20 15:52:35 +08:00
1a57cd3836 Merge pull request #19852 from zeertzjq/vim-8.2.3623
vim-patch:8.2.{3623,4667}: expandcmd() fixes
2022-08-20 07:49:31 +08:00
15ca01b649 vim-patch:8.2.4667: expandcmd() fails on an error
Problem:    expandcmd() fails on an error.
Solution:   On failure return the command unmodified. (yegappan Lakshmanan,
            closes vim/vim#10063)
5018a836c0
2022-08-20 07:25:22 +08:00
6d6e9c5d51 vim-patch:8.2.3623: "$*" is expanded to "nonomatch"
Problem:    "$*" is expanded to "nonomatch".
Solution:   Only add "set nonomatch" when using a csh-like shell. (Christian
            Brabandt, closes vim/vim#9159, closes vim/vim#9153)
8b8d829faf

Cherry-pick a line from patch 8.2.0522.
2022-08-20 07:25:22 +08:00
f342194396 Merge pull request #19847 from lewis6991/utfmb
refactor(drawline.c): factor out utf8 multibyte check
2022-08-19 23:28:20 +01:00
e8618df7f8 vim-patch:8.2.3619: cannot use a lambda for 'operatorfunc' (#19846)
Problem:    Cannot use a lambda for 'operatorfunc'.
Solution:   Support using a lambda or partial. (Yegappan Lakshmanan,
            closes vim/vim#8775)
777175b0df

Omit duplicate docs. It's removed in patch 8.2.3623.
Nvim doesn't seem to need callback_set() as it was omitted when patch 8.1.1437
was first ported.
2022-08-20 06:12:02 +08:00
ebd5720901 Merge pull request #19841 from bfredl/drawstatus
refactor: move statusline code from buffer.c and [draw]screen.c to new file
2022-08-20 00:05:32 +02:00
6adc2ae7e0 refactor: move statusline code from buffer.c and [draw]screen.c to new file
problem: code for drawing statusline is arbitrarily spreadout between drawscreen.c, screen.c and buffer.c
solution: move it to a new file statusline.c

- rename archaic internal name "status match" to public name "wildmenu"
- showruler() does not show the ruler. it show anything which displays
  info about the cursor. Rename it accordingy.
2022-08-19 22:48:03 +02:00
b2f979b30b fix(filetype): only check first 100 and last line of buffer (#19819)
fix(filetype): only pass first 100 and last lines to contents check

sufficient for current content checks and avoids performance issues for
buffers with a large number of lines

fixes #19817
2022-08-19 19:30:35 +02:00
7e980a4df4 docs(lua): update vim.{g,b,w}o documentation (#19844)
docs(lua): update vim.{go,bo,wo} documentation

* document indexing by buffer/window handle
* correct wrapper information (`nvim_buf_{g,s}et_value` now)
* make clear what is considered "invalid key" (consistently)
2022-08-19 19:05:28 +02:00
7d815eb4d9 refactor(drawline.c): factor out utf8 multibyte check 2022-08-19 16:54:27 +01:00
3c545b9c62 Merge pull request #19360 from famiu/feat/multibuffer-inccommand
feat: multibuffer preview support for inccommand
2022-08-19 17:21:18 +02:00
dc32cc5acf Merge pull request #19845 from zeertzjq/vim-8.2.0982
vim-patch:8.2.{partial:0425,0982}: insufficient tests
2022-08-19 22:27:43 +08:00
b7c86e24f7 vim-patch:8.2.0982: insufficient testing for reading/writing files
Problem:    Insufficient testing for reading/writing files.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6257)
            Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f

Omit test_override().
Reorder test_writefile.vim to match Vim.
2022-08-19 22:05:26 +08:00
efebf30784 vim-patch:partial:8.2.0425: code for modeless selection not sufficiently tested
Problem:    Code for modeless selection not sufficiently tested.
Solution:   Add tests.  Move mouse code functionality to a common script file.
            (Yegappan Lakshmanan, closes vim/vim#5821)
515545e11f

Skip termcode tests for now.
2022-08-19 22:05:23 +08:00
7ff283b1b7 Merge pull request #19843 from zeertzjq/vim-9.0.0227
vim-patch:8.2.3946,9.0.0227: internal error improvements
2022-08-19 21:02:38 +08:00
4edf967050 vim-patch:9.0.0227: cannot read error message when abort() is called
Problem:    Cannot read error message when abort() is called.
Solution:   Output a newline before calling abort().
213e70e284

Add emsg_not_now() check to make code equivalent.
2022-08-19 20:39:17 +08:00
aa96a80d5d vim-patch:8.2.3946: when an internal error makes Vim exit the error is not seen
Problem:    When an internal error makes Vim exit the error is not seen.
Solution:   Add the error to the test output.
1c67f3a977

Add emsg_not_now() check to make code equivalent.
2022-08-19 20:38:59 +08:00
2af9be3db5 vim-patch:8.1.1966: some code in options.c fits better elsewhere (#19840)
Problem:    Some code in options.c fits better elsewhere.
Solution:   Move functions from options.c to other files. (Yegappan
            Lakshmanan, closes vim/vim#4889)
e677df8d93
2022-08-19 19:20:39 +08:00
5dc43265b1 Merge pull request #19802 from lewis6991/drawscreen 2022-08-19 10:41:45 +01:00
51063a90df vim-patch:8.1.2057: the screen.c file is much too big
Problem:    The screen.c file is much too big.
Solution:   Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943)
7528d1f6b5

This is an approximation vim-patch 8.1.2057. Applying the patch directly
isn't feasible since our version of screen.c has diverged too much,
however we still introduce drawscreen.c and drawline.c:
- screen.c is now a much smaller file used for low level screen functions
- drawline.c contains everything needed for win_line()
- drawscreen.c contains everything needed for update_screen()

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-19 10:01:40 +01:00
c2f7a2a18d feat: multibuffer preview support for inccommand
Allows preview callbacks to modify multiple buffers in order to show the
preview. Previously, if multiple buffers were modified, only the current
buffer would have its state restored. After this change, all buffers
have their state restored after preview.

Closes #19103.
2022-08-19 09:27:52 +06:00
a5ed89c972 refactor(undo.c): resolve clint issues (#19827) 2022-08-18 15:16:52 +01:00
36f0b508c5 revert: "jobstart(): Fix hang on non-executable cwd #9204" (#19826)
This reverts commit c4c74c3883.

LibUV already gives an error for this, so this isn't needed.
2022-08-18 22:09:50 +08:00
700a6fb9d4 Merge pull request #19822 from bfredl/hldef
fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
2022-08-18 12:16:27 +02:00
39494be2a4 ci: add codeql action (#19810)
replaces deprecated LGTM workflow:
https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/
2022-08-18 11:55:15 +02:00
7a2be8cc17 Merge pull request #19828 from bfredl/nullhl
fix(winhl): do not crash when unsetting winhl in just opened window
2022-08-18 11:12:50 +02:00
fbcce2b2ca vim-patch:8.1.2082: rename popupmnu.* to popupmenu.* (#19829)
vim-patch:8.1.2082: some files have a weird name to fit in 8.3 characters

Problem:    Some files have a weird name to fit in 8.3 characters.
Solution:   Use a nicer names.
30e8e73506
2022-08-18 17:06:39 +08:00
e29156356b fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
fixes #18160
2022-08-18 10:57:46 +02:00
341ef46d00 docs(lsp): remove lsp.buf_request from docs (#19738)
This starts a soft phase-out of `buf_request`.

`buf_request` is quite error prone:

- Positional `params` depend on the client because of the
  `offset_encoding`. Currently if there is one client using UTF-8 offset
  encoding and another using UTF-16, the positions in the request are
  wrong for one of the clients. To solve this the params would need to
  be created per client instead of once for all of them.

- `handler` is called *per* client but many users of it assume it is
  only called once.

  This can lead to a "select n + 1"
  kind of problem, where the handler makes another call to `buf_request`,
  multiplying the amount of requests.
  (There are in fact still some places where this happens in core)

  Or it leads to erratic behavior if called multiple times (E.g. the
  quicklist list flickering & being overwritten)
  (See hover or references implementation)

  `buf_request_all` returns an aggregate of the responses which is more
  sensible as it avoids this problem.

  For off-spec extensions it also has the problem that it sends requests to
  clients which cannot handle a given request.

Given that `buf_request` is in use by a lot of plugins this starts a
soft-phase out. Planned Steps:

- Remove from docs
- Provide an alternative, either `buf_request_all`, maybe with
  extensions (params being a function), or an entirely new method.
- Mark as deprecated in 0.9
- Remove in 0.10

To note:

- `buf_request_all` currently isn't ideal either because it suffers from
the `params` problem as well.

- This implies that the `vim.lsp.with` pattern will die, because the
  global handlers as they are don't fit a multi-client model, as most of
  the time an aggregate is needed.
2022-08-18 10:57:17 +02:00
21b2906c9c fix(winhl): do not crash when unsetting winhl in just opened window
fixes #19823
2022-08-18 09:43:07 +02:00
02e9b5a8ee Merge pull request #19824 from bfredl/msgsep_allthethings
fix(tests): remove irrelevant usage of display-=msgsep
2022-08-18 00:12:28 +02:00
068a998e60 fix(tests): remove irrelevant usage of display-=msgsep
These were just added to avoid churn when changing the default
of 'display'. To simplify message handling logic, we might want
to remove support for printing messages in default_grid later on.
This would allow things like printing error messages safely in the
middle of redraw, or a future graduation of the 'multigrid' feature.
2022-08-17 23:44:49 +02:00
35653e6bcd Merge pull request #13457 from bfredl/färgtema
feat(highlight): support highlight namespaces per window
2022-08-17 16:45:35 +02:00
d879331b0d feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces
- check for EOF in screen tests (to indicate a likely crash)
2022-08-17 16:20:39 +02:00
f7cfca49d6 refactor: remove some unused includes (#19820)
Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
2022-08-17 22:18:34 +08:00
f5588ee896 feat: allow :wincmd to accept a count (#19815)
Let :wincmd command accept a count like what its documentation suggests.
Previously it could only accept a range, which led to some ambiguity on
which attribute should be used when executing :wincmd using nvim_cmd.

Closes #19662.

Also fix a typo in a related Vim test:

vim-patch:9.0.0223: typo in diffmode test

Problem:    Typo in diffmode test.
Solution:   Fix the typo. (closes vim/vim#10932)
5fd6ab820b
2022-08-17 19:50:40 +08:00
7a076306e4 docs(lsp): rename on-list-handler to lsp-on-list-handler (#19813)
This makes it easier to find documentation about the on-list-handler
when starting the search term with "lsp".
2022-08-17 12:39:38 +02:00
5d8278591a vim-patch:8.2.1262: src/ex_cmds.c file is too big (#19811)
Problem:    src/ex_cmds.c file is too big.
Solution:   Move help related code to src/help.c. (Yegappan Lakshmanan,
            closes vim/vim#6506)
f868ba8903
2022-08-17 17:29:06 +08:00
bccb5de89d vim-patch:8.2.3699: the +title feature adds a lot of #ifdef but little code (#19809)
Problem:    The +title feature adds a lot of #ifdef but little code.
Solution:   Graduate the +title feature.
651fca85c7
2022-08-17 12:44:31 +08:00
5c1eb02b05 Merge pull request #19801 from Shougo/vim-9.0.0190
vim-patch:9.0.{0190,0191,0192}: cmdheight=0 fixes
2022-08-17 10:19:16 +08:00
9a6d3bd76e vim-patch:9.0.0191: messages test fails; window size incorrect
Problem:    Messages test fails; window size incorrect when 'cmdheight' is
            made smaller.
Solution:   Properly cleanup after test with cmdheight zero.  Resize windows
            correctly when 'cmdheight' gets smaller.
d4cf9fc53e

N/A patches for version.c:

vim-patch:9.0.0192: possible invalid memory access when 'cmdheight' is zero

Problem:    Possible invalid memory access when 'cmdheight' is zero. (Martin
            Tournoij)
Solution:   Avoid going over the end of w_lines[] when w_height is Rows.
            (closes vim/vim#10882)
fdc5d17d58
2022-08-17 09:35:07 +08:00
5977a96b3f vim-patch:9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Problem:    The way 'cmdheight' can be made zero is inconsistent.
Solution:   Only make 'cmdheight' zero when setting it explicitly, not when
            resizing windows. (closes vim/vim#10890)
f797e309ca
2022-08-17 09:34:13 +08:00
d74f9c3b94 Merge pull request #19808 from zeertzjq/vim-9.0.0220
vim-patch:9.0.{0220,0222}
2022-08-17 09:32:46 +08:00
dd15fa7096 vim-patch:9.0.0222: no good reason why text objects are only in larger builds
Problem:    No good reason why text objects are only in larger builds.
Solution:   Graduate +textobjects.
887748742d
2022-08-17 09:07:12 +08:00
65bcec9e9b vim-patch:9.0.0220: invalid memory access with for loop over NULL string
Problem:    Invalid memory access with for loop over NULL string.
Solution:   Make sure mb_ptr2len() consistently returns zero for NUL.
f6d39c31d2
2022-08-17 09:07:12 +08:00
542fa8a9cc refactor: change pre-decrement/increment to post (#19799)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-16 12:26:08 +01:00
9a4b8dc603 refactor(signs): handle non-sign attrs separately (#19784) 2022-08-16 11:03:44 +01:00
4f0a0a2933 docs: update .gitattributes (#19800) 2022-08-16 10:51:30 +01:00
03fddfd928 fix(api): nvim_exec and nvim_cmd restore msg_col when capturing output (#19789)
This matches the code in execute_common(), preventing messages after the
API call from being printed at the wrong column.
2022-08-16 17:30:39 +08:00
dee96f4725 refactor(eval.c): resolve all clint issues (#19774) 2022-08-16 09:47:16 +01:00
e8caaab6bf vim-patch:e1f3fd1d02e3 (#19796)
Update runtime files
e1f3fd1d02
2022-08-16 09:53:04 +02:00
da13ed43cb vim-patch:8.2.3888: the argument list may contain duplicates (#19795)
Problem:    The argument list may contain duplicates.
Solution:   Add the :argdedeupe command. (Nir Lichtman, closes vim/vim#6235)
73a024209c

Use latest index.txt :argdedupe doc from Vim.
2022-08-16 15:29:36 +08:00
cf3b871fa9 test: use poke_eventloop() instead of sleep(10) where possible (#19794)
Using sleep(10) to wait for typeahead to finish is flaky, especially on
macOS, where legacy/global_spec.lua has failed several times.
2022-08-16 15:21:46 +08:00
a63eea3d23 vim-patch:8.1.2042: the evalfunc.c file is too big (#19792)
Problem:    The evalfunc.c file is too big.
Solution:   Move getchar() and parse_queued_messages() to getchar.c.
9c658c9eac

Omit parse_queued_messages(): Nvim does not have MESSAGE_QUEUE.
2022-08-16 15:09:59 +08:00
5e98a41872 vim-patch:8.1.1869: code for the argument list is spread out (#19791)
Problem:    Code for the argument list is spread out.
Solution:   Put argument list code in arglist.c. (Yegappan Lakshmanan,
            closes vim/vim#4819)
4ad62155a1
2022-08-16 14:16:03 +08:00
d5d6ed311b vim-patch:9.0.0216: undo earlier test sometimes fails on MS-Windows (#19790)
Problem:    Undo earlier test sometimes fails on MS-Windows.
Solution:   Use another file name.
cce293f87b
2022-08-16 11:23:49 +08:00
63e4436d8e Merge pull request #19781 from zeertzjq/source-lua-estack
fix(source): fix expand('<sfile>') no longer works for Lua
2022-08-16 06:04:09 +08:00
d1464d16d6 fix(source): fix expand('<sfile>') no longer works for Lua 2022-08-16 05:39:44 +08:00
1d28bbf1e5 vim-patch:9.0.0217: 'shellslash' works differently when sourcing a script again
Problem:    'shellslash' works differently when sourcing a script again.
Solution:   Use the name from the script item. (closes vim/vim#10920)
5a4fff4d94
2022-08-16 05:39:12 +08:00
e954d62527 Merge pull request #19635 from dundargoc/build/windows
build: windows-specific cmake fixes
2022-08-15 17:49:33 +02:00
6b686e7e1e Merge pull request #19785 from zeertzjq/vim-8.2.1803
vim-patch:8.2.{1803,3345,3392}
2022-08-15 22:17:05 +08:00
747dec7925 vim-patch:8.2.3392: augroup completion escapes regexp pattern characters
Problem:    augroup completion escapes regexp pattern characters.
Solution:   Do not escape the augroup name. (closes vim/vim#8826)
b4d82e2a8d
2022-08-15 21:19:50 +08:00
e73517e34e vim-patch:8.2.3345: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add a few more tests. (Dominique Pellé, closes vim/vim#8757)
bfb2bb16bc
2022-08-15 21:19:50 +08:00
535e423a6a vim-patch:8.2.1803: a few failures are not tested
Problem:    A few failures are not tested.
Solution:   Test a few failures. (Dominique Pellé, closes vim/vim#7075)
afe8cf6170

Cherry-pick a line in Test_argdelete() from patch 8.2.1736.
2022-08-15 21:19:35 +08:00
cbb2e634c9 Merge pull request #19440 from zeertzjq/vim-8.2.1786
vim-patch:8.2.{1786,1799}: Normal mode commands not fully tested
2022-08-15 20:50:04 +08:00
18b457ebbb fix(redraw): make sure :redraw! redraws command line
In Vim :redraw! uses CLEAR, which calls screenclear(), which sets
redraw_cmdline. In Nvim :redraw! uses NOT_VALID, which does not set
redraw_cmdline automatically, so set it explicitly.
2022-08-15 20:24:43 +08:00
76b4b1977b vim-patch:8.2.1799: some Normal mode commands not fully tested
Problem:    Some Normal mode commands not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#7073)
d1ad99b654

Cherry-pick test_registers.vim change from patch 8.2.0644.
2022-08-15 20:24:43 +08:00
37586eac42 vim-patch:8.2.1786: various Normal mode commands not fully tested
Problem:    Various Normal mode commands not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7059)
8a9bc95eae

Cherry-pick Test_normal_gdollar_cmd() change from patch 8.2.0540.
2022-08-15 20:24:42 +08:00
d334249833 Merge pull request #19098 from zeertzjq/vim-8.1.0822
vim-patch:8.1.{partial:0822,1189,1192},8.2.5109: 'showmode' fixes
2022-08-15 18:38:46 +08:00
55da52963b vim-patch:8.2.5109: mode not updated after CTRL-O CTRL-C in Insert mode
Problem:    Mode not updated after CTRL-O CTRL-C in Insert mode.
Solution:   Set redraw_mode and use it. (closes vim/vim#10581)
7a1d32809b
2022-08-15 17:58:35 +08:00
93ba821831 vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem:    Mode is not cleared when leaving Insert mode with mapped Esc.
Solution:   Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
4c25bd785a
2022-08-15 17:58:35 +08:00
53b0688ac0 vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem:    Mode is not cleared when leaving Insert mode.
Solution:   Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270)
abc7c7fc5a
2022-08-15 17:58:35 +08:00
b47f313151 fix(getchar): flush screen before doing a blocking wait 2022-08-15 17:58:35 +08:00
95b8e2c55f vim-patch:partial:8.1.0822: peeking and flushing output slows down execution
Problem:    Peeking and flushing output slows down execution.
Solution:   Do not update the mode message when global_busy is set.  Do not
            flush when only peeking for a character. (Ken Takata)
cb574f4154

Omit inchar() change: it breaks too many tests.

N/A patches for version.c:

vim-patch:8.2.5170: tiny issues

Problem:    Tiny issues.
Solution:   Tiny improvements.
944cc9ceba
2022-08-15 17:58:35 +08:00
9a3877ff9d refactor(ex_docmd.c): resolve most clint errors (#19775)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-15 08:54:40 +01:00
6264aa521e ci(build.ps1): restore comment removed in #19336 2022-08-15 12:41:00 +08:00
93ae183810 docs: update Vim differences (#19780)
Patch 8.2.4594 (36a5b6867b) added support for sourcing a buffer without a name.

Patch 8.2.4325 (3908ef5017) added support for using a popup menu for wildmode completion.
2022-08-15 10:40:41 +08:00
a6f0e32d23 Merge pull request #19763 from zeertzjq/vim-8.2.1297
vim-patch:8.2.{1297,1653,1658}: expand('<stack>')
2022-08-15 10:39:41 +08:00
9ab9eb1220 fix(source): make changing 'shellslash' change expand() result 2022-08-15 10:14:53 +08:00
d6a6adf708 vim-patch:8.2.1658: expand('<stack>') has trailing ".."
Problem:    Expand('<stack>') has trailing "..".
Solution:   Remove the "..". (closes vim/vim#6927)
a810db3f17
2022-08-15 10:14:53 +08:00
ed65724e57 vim-patch:8.2.1653: expand('<stack>') does not include the final line number
Problem:    Expand('<stack>') does not include the final line number.
Solution:   Add the line nuber. (closes vim/vim#6927)
4f25b1aba0
2022-08-15 10:14:53 +08:00
98ab0bb5f7 vim-patch:8.2.1297: when a test fails it's often not easy to see where
Problem:    When a test fails it's often not easy to see what the call stack
            is.
Solution:   Add more entries from the call stack in the exception message.
a5d0423fa1

Use docs from latest Vim.
2022-08-15 10:14:52 +08:00
1c164689a4 refactor: move menu non-symbols to menu_defs.h (#19778) 2022-08-15 10:04:05 +08:00
36acb803c6 Merge pull request #19772 from lewis6991/uncrust_suggest
ci(lint): various improvements
2022-08-14 19:20:06 -04:00
d3569e8337 vim-patch:8.1.1960: fold code is spread out (#19777)
Problem:    Fold code is spread out.
Solution:   Move fold functions to fold.c.
db022f3ffb
2022-08-15 06:33:30 +08:00
41d6b8a6d0 vim-patch:9.0.0207: stacktrace not shown when debugging (#19776)
Problem:    Stacktrace not shown when debugging.
Solution:   Set msg_scroll in msg_source(). (closes vim/vim#10917)
28c162f6f1
2022-08-15 06:01:38 +08:00
f38c05bece Merge pull request #19771 from lewis6991/clint/eval/funcs.c
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-14 16:53:31 +01:00
47aba12593 refactor(eval/funcs.c): resolve all clint errors
... and tidy up local variable declarations

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-14 15:51:03 +01:00
0cd39c2f50 ci(lint): separate lintc from lint
All steps in lint now do now require a Neovim build.
2022-08-14 15:47:46 +01:00
27c3919a48 ci(lint): move some steps before build 2022-08-14 15:41:43 +01:00
49e691f58f ci(line): lintcfull -> lintc
lintcfull == lintc + uncrustify

We are already running uncrustify separately so can just run lintc
instead.
2022-08-14 15:41:07 +01:00
0fcc32b707 ci(lint): run uncrustify earlier 2022-08-14 15:37:23 +01:00
1dc984eaab ci(lint): generate PR suggestions from uncrustify 2022-08-14 15:37:22 +01:00
b1faf5f0b9 vim-patch:8.2.4249: the timeout limit for spell suggestions is always 5000 (#19769)
Problem:    The timeout limit for spell suggestions is always 5000 milli
            seconds.
Solution:   Add the "timeout" entry to 'spellsuggest'.
585ee07cfe
2022-08-14 19:11:36 +08:00
c77cce615b vim-patch:8.1.2081: the spell.c file is too big (#19767)
Problem:    The spell.c file is too big.
Solution:   Move the code for spell suggestions to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#4988)
46a426c9ac
2022-08-14 18:30:37 +08:00
c96020b2bf vim-patch:8.2.3675 (#19766)
vim-patch:8.2.3675: using freed memory when vim_strsave() fails

Problem:    Using freed memory when vim_strsave() fails.
Solution:   Clear "last_sourcing_name".  Check for msg_source() called
            recursively. (closes vim/vim#8217)
ba8c92687d

Although xstrdup() cannot fail in Nvim, it may still be possible that an
error appears (e.g. in regexp engine) when printing the message.
2022-08-14 15:15:43 +08:00
5854103dad docs(lua): clarify vim.keymap.set() opts (#19761) 2022-08-14 06:38:31 +08:00
fa8fde99e6 vim-patch:9.0.0203: confusing variable name (#19762)
Problem:    Confusing variable name.
Solution:   Use "prim_aep" instead of "spell_aep".
c9b6570fab
2022-08-14 06:19:12 +08:00
8cd116729f Merge pull request #19752 from zeertzjq/vim-8.2.0056
vim-patch:8.2.{0056,0061,0078,0097,0823}: execution stack
2022-08-14 05:18:21 +08:00
1ca2247639 vim-patch:8.2.0823: Vim9: script reload test is disabled
Problem:    Vim9: script reload test is disabled.
Solution:   Compile a function in the context of the script where it was
            defined.  Set execution stack for compiled function.  Add a test
            that an error is reported for the right file/function.
25e0f5863e

Omit stack_top_is_ufunc(): only used by Vim9 script.
2022-08-14 04:29:44 +08:00
a10a23aae9 vim-patch:8.2.0097: crash with autocommand and spellfile
Problem:    Crash with autocommand and spellfile. (Tim Pope)
Solution:   Do not pop exestack when not pushed. (closes vim/vim#5450)
ce6db0273f
2022-08-14 04:29:44 +08:00
3a8b859147 vim-patch:8.2.0078: expanding <sfile> works differently the second time
Problem:    Expanding <sfile> works differently the second time.
Solution:   Keep the expanded name when redefining a function. (closes vim/vim#5425)
b9adef79ec
2022-08-14 04:29:44 +08:00
de72f9098a vim-patch:8.2.0061: the execute stack can grow big and never shrinks
Problem:    The execute stack can grow big and never shrinks.
Solution:   Reduce the size in gargage collect.
3fbcc128cb
2022-08-14 04:29:44 +08:00
ded2925b40 refactor: change remaining sourcing_name/sourcing_lnum to exestack
Co-Authored-By: VVKot <volodymyr.kot.ua@gmail.com>
2022-08-14 04:29:44 +08:00
f52c236c5b vim-patch:8.2.0056: execution stack is incomplete and inefficient
Problem:    Execution stack is incomplete and inefficient.
Solution:   Introduce a proper execution stack and use it instead of
            sourcing_name/sourcing_lnum.  Create a string only when used.
1a47ae32cd

Omit test_debugger.vim: superseded by later patches.
Omit check_map_keycodes(): N/A.
Omit kword_test.c: N/A (converted to a unit test).
2022-08-14 04:29:44 +08:00
11837e9b29 build: only use CMAKE_BUILD_TYPE for single-config generators
CMAKE_BUILD_TYPE is ignored for multi-config generators and creates a
warning that it's unused.
2022-08-13 21:22:07 +02:00
2dde701115 build(MSVC): don't add non-MSVC compiler options
This will prevent warnings of the type "ignoring unknown option '-fPIC'"
when using MSVC.
2022-08-13 21:22:07 +02:00
d56ddf9583 build(windows): fix target check-single-includes
Add missing includes and exclude os-specific files depending on platform
when using the target.
2022-08-13 21:22:07 +02:00
bf0d7ed1f6 build: bump minimum cmake version for all dependencies to 3.10
This removes cmake policy warning for CMP0053 on windows and ensures the
build works correctly for newer cmake policies.
2022-08-13 21:22:07 +02:00
c1cbe3fb3d refactor(screen.c): resolve all clint errors (#19754)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-08-13 16:59:15 +02:00
3cf629022b vim-patch:9.0.0198: ml_get error when switching buffer in Visual mode (#19756)
Problem:    ml_get error when switching buffer in Visual mode.
Solution:   End Visual mode when switching buffer. (closes vim/vim#10902)
cfeb8a584b
2022-08-13 21:47:52 +08:00
f9a9956837 ci(release): move release-winget steps into release job #19689 2022-08-13 06:34:28 -07:00
02a4974418 vim-patch:7.4.1168 (#19645)
Problem:    This doesn't give the right result: eval(string(v:true)). (Nikolay
            Pavlov)
Solution:   Make the string "v:true" instead of "true".
f48aa160fd
2022-08-13 21:31:00 +08:00
33b49d5f55 vim-patch:9.0.0197: astro files are not detected (#19755)
Problem:    Astro files are not detected.
Solution:   Add a pattern to match Astro files. (Emilia Zapata, closes vim/vim#10904)
6a76e84f55
2022-08-13 15:11:03 +02:00
9dec3815d2 Merge pull request #19751 from bfredl/tabbar
fix(winbar): do not always assume cursor is valid
2022-08-13 11:17:42 +02:00
33f4ba7379 fix(winbar): do not always assume cursor is valid. fixes #19458 2022-08-13 10:45:21 +02:00
a850b15e19 vim-patch:9.0.0195: metafun files are not recogized (#19746)
Problem:    Metafun files are not recogized.
Solution:   Add filetype detection patterns.
9032b9ceb6
2022-08-13 10:26:12 +02:00
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
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
6f14c5d2dd refactor: remove some unused includes (#19747)
- Remove autocmd.h from fileio.h
- Remove normal.h from main.h
- Move bufinfo_T from undo_defs.h to undo.c
2022-08-13 08:59:11 +08:00
e23c5fda0a build libuv cmake (#19632)
Co-authored-by: Daniel Hahler <git@thequod.de>
2022-08-12 16:59:40 +01:00
b6a963bded Merge pull request #19713 from lewis6991/rmccache
ci(cache): remove ccache
2022-08-12 15:42:59 +02:00
342d18b91e refactor: remove some unused includes (#19740)
Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other
headers.
2022-08-12 21:16:28 +08:00
5b80d20271 ci(cache): remove ccache
It was never in action since migrating from travis to github actions.
2022-08-12 14:07:23 +01:00
ac78639de8 docs: .git-blame-ignore-revs (#18579)
add "refactor(uncrustify): enable formatting for regexp and indent files" (#18549)
2022-08-12 15:05:08 +02:00
54a165d9a6 Merge pull request #19592 from dundargoc/refactor/char_u-to-char
refactor: replace char_u with char
2022-08-12 14:44:28 +02:00
094cdf2d69 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-12 14:22:02 +02:00
f79773a3b4 refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)
This avoids including ex_eval.h in any other header, thus preventing
future circular includes.
2022-08-12 19:16:24 +08:00
1cf3a4b409 docs: clarify that cursorline will be disabled before command preview (#19710) 2022-08-12 10:21:50 +02:00
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
103f10d901 refactor: move code dealing with script files to runtime.c (#19734)
vim-patch:8.1.1927: code for dealing with script files is spread out

Problem:    Code for dealing with script files is spread out.
Solution:   Move the code to scriptfile.c. (Yegappan Lakshmanan, closes vim/vim#4861)
307c5a5bb7
2022-08-12 15:41:43 +08:00
d4f5e0db3c Merge pull request #19733 from zeertzjq/vim-8.1.1684
vim-patch:8.1.{1684,1689}: profiling code is spread out
2022-08-12 14:39:47 +08:00
a93d29589a vim-patch:8.1.1689: profiling code is spread out
Problem:    Profiling code is spread out.
Solution:   Move more profiling code to profiler.c. (Yegappan Lakshmanan,
            closes vim/vim#4668)
660a10ad41
2022-08-12 14:15:03 +08:00
c7ca94ba7f vim-patch:8.1.1684: profiling functionality is spread out
Problem:    Profiling functionality is spread out.
Solution:   Put profiling functionality in profiling.c. (Yegappan Lakshmanan,
            closes vim/vim#4666)
fa55cfc69d

Move proftime_T to types.h for now to avoid recursive #include.
2022-08-12 13:44:37 +08:00
0d9e09bf67 test: make Ex mode exit test test what it wants to test (#19728) 2022-08-12 09:04:08 +08:00
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
a27756cc24 fix(signs): priority of extmark signs (#19718) 2022-08-11 17:26:17 +01:00
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
8b67f37798 fix(lsp): fix some type annotations in lsp.rpc (#19714) 2022-08-11 15:17:05 +02:00
6669fc94ae docs: add reformat commit to .git-blame-ignore-revs (#19715)
followup to #19685
2022-08-11 14:41:15 +02:00
d1fb0dd8b9 Merge pull request #19685 from ii14/gen_vimdoc_indentation
docs: change gen_vimdoc indentation level
2022-08-11 14:34:00 +02:00
ea333badd2 docs: regenerate 2022-08-11 14:25:48 +02:00
d2975d58cb docs: change gen_vimdoc indentation to 4 spaces 2022-08-11 14:25:18 +02:00
94c3176478 refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)
vim-patch:8.2.0559: clearing a struct is verbose

Problem:    Clearing a struct is verbose.
Solution:   Define and use CLEAR_FIELD() and CLEAR_POINTER().
a80faa8930
2022-08-11 15:44:55 +08:00
252dea5927 build(deps): bump LuaJIT to HEAD - 633f265f6 (#19703) 2022-08-11 08:53:15 +02:00
b4b22318a1 Merge pull request #19704 from bfredl/ceci-nest-pas-un-bool
fix(mpack): make sure a `bool` always is a `bool`
2022-08-10 22:31:53 +02:00
faccae47fc fix(mpack): make sure a bool always is a bool
before, RelWithDebInfo linking gave this warning:

    src/mpack/conv.h:36:16: warning: type of ‘mpack_unpack_boolean’ does not match original declaration [-Wlto-type-mismatch]
       36 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t) FUNUSED FPURE;
          |                ^
    src/mpack/conv.c:196:16: note: return value type mismatch
      196 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t)
          |                ^
2022-08-10 20:36:28 +02:00
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
78658ef383 fix(api): vim.cmd.make crashes when argument count isn't 1 (#19701)
Closes #19696
2022-08-10 18:37:59 +08:00
3ee6c05b4b Merge pull request #19693 from clason/bump-gha-ubuntu 2022-08-10 08:55:25 +02:00
512e0441f1 docs: fix some mistakes and missing docs (#19699) 2022-08-10 12:47:38 +08:00
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
d212dfd676 ci(release): build with standard gcc on Ubuntu
Ubuntu-20.04 ships with GCC 10.3.0, which is enough to avoid #14150
2022-08-09 18:10:18 +02:00
48241c3b23 ci(release): bump deprecated ubuntu image to 20.04
`ubuntu-18.04` is now deprecated and subject to outages, see
  https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/
2022-08-09 18:10:18 +02:00
3030b4d653 feat(tui): allow grid and host to disagree on ambiguous-width chars (#19686)
Note: This only applies to ambiguous-width characters.
2022-08-09 21:08:46 +08:00
24bf0490ea vim-patch:9.0.0176: checking character options is duplicated and incomplete (#19690)
Problem:    Checking character options is duplicated and incomplete.
Solution:   Move checking to check_chars_options(). (closes vim/vim#10863)
8ca29b6a35
2022-08-09 20:35:34 +08:00
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
cd14efd281 vim-patch:8.1.1823: command line history code is spread out (#19688)
Problem:    Command line history code is spread out.
Solution:   Put the code in a new file. (Yegappan Lakshmanan, closes vim/vim#4779)
            Also graduate the +cmdline_hist feature.
d7663c22c6
2022-08-09 17:13:44 +08:00
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
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
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
d31ee6664d test: increse expect_exit() timeouts (#19680)
A timeout of 100 milliseconds is sometimes still too short for macOS.
Change it to 1000 milliseconds.
2022-08-08 22:04:21 +08:00
d36c2fa713 Merge pull request #19674 from zeertzjq/vim-8.2.1535
vim-patch:8.2.{1535,1537,3545}: setcellwidths()
2022-08-08 21:20:27 +08:00
603f7bd253 fix(fillchars): change fallback after setcellwidths() 2022-08-08 20:03:40 +08:00
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
01a7009af9 refactor(setcellwidths): use TV_LIST_ITEM_NEXT properly 2022-08-08 20:03:40 +08:00
967415d527 vim-patch:8.2.1537: memory acccess error when using setcellwidths()
Problem:    Memory acccess error when using setcellwidths().
Solution:   Use array and pointers correctly.
b06a6d59d1
2022-08-08 20:03:40 +08:00
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
bc8fbb7c1d refactor: move non-symbols in mbyte.h to mbyte_defs.h
This just avoids including mbyte.h in eval/typval.h, so that mbyte.h can
include eval/typval.h in Vim patch 8.2.1535.
2022-08-08 20:03:40 +08:00
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
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
18766e742b fix(folds): fix fold remains when :delete makes buffer empty (#19673) 2022-08-08 06:07:59 +08:00
629169462a fix(terminal): skip aucmd_win when checking terminal size (#19668) 2022-08-07 19:43:29 +08:00
fa8b2b4c50 vim-patch:8.2.4492: no error if an option is given a value with ":let &opt = val" (#19670)
Problem:    No error if an option is given an invalid value with
            ":let &opt = val".
Solution:   Give the error. (closes vim/vim#9864)
8ccbbeb620
2022-08-07 17:11:03 +08:00
fea15adad3 Merge pull request #19669 from zeertzjq/vim-8.2.1278
vim-patch:8.2.{1278,1280,1281}: error message improvements
2022-08-07 15:22:48 +08:00
48051ed62c vim-patch:8.2.1281: the "trailing characters" error can be hard to understand
Problem:    The "trailing characters" error can be hard to understand.
Solution:   Add the trailing characters to the message.
2d06bfde29
2022-08-07 14:39:19 +08:00
d0686540f5 vim-patch:8.2.1280: Ex command error cannot contain an argument
Problem:    Ex command error cannot contain an argument.
Solution:   Add ex_errmsg() and translate earlier.  Use e_trailing_arg where
            possible.
8930caaa1a

Remove duplicate test file 062_tab_pages_spec.lua
2022-08-07 14:38:57 +08:00
3b7fc5f793 vim-patch:8.2.1278: Vim9: line break after "->" only allowed in :def function
Problem:    Vim9: line break after "->" only allowed in :def function.
Solution:   Only allow line break after "->". (closes vim/vim#6492)
dd1a9af00f
2022-08-07 13:47:40 +08:00
0fdf59ac9d fix(api): nvim_cmd handle 0 range (#19655)
Fixes #19608
2022-08-06 13:53:37 +01:00
0df1418ffa vim-patch:8.2.1873: Vim9: missing white space when using <f-args> (#19657)
Problem:    Vim9: missing white space when using <f-args>.
Solution:   Add spaces. (Christian J. Robinson)
20d89e0ac6
2022-08-06 20:05:46 +08:00
5eb8119dce vim-patch:8.2.3282: Vim9: error about using -complete without -nargs is confusing (#19656)
Problem:    Vim9: error about using -complete without -nargs is confusing.
Solution:   Change the wording.
41a3485dd6
2022-08-06 19:18:43 +08:00
ad7064bd83 vim-patch:8.1.1210: support for user commands is spread out (#19653)
Problem:    Support for user commands is spread out. No good reason to make
            user commands optional.
Solution:   Move user command support to usercmd.c.  Always enable the
            user_commands feature.
ac9fb18020
2022-08-06 17:14:37 +08:00
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
a308f53525 fix(api): fix nvim_buf_set_text heap-use-after-free (#19644)
The line returned but ml_get_buf() may be freed by another call to
ml_get_buf(), so it is necessary to make a copy.
2022-08-06 06:22:01 +08:00
85ad0e6b43 fix(lsp): avoid ^M character in hover window on Windows (#19640) 2022-08-05 15:23:01 +02:00
58e1c6fbff test(old): clear builtin menus before running tests (#19647)
Otherwise Test_menu_expand() fails when run alone.
2022-08-05 18:50:20 +08:00
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
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
a78606ec53 test(let_spec): increase expect_exit() timeout
Test ":unlet self-referencing node in a List graph #6070" feeds many characters into typeahead, so a timeout of only 100 milliseconds sometimes fails. Change that timeout to 1000 milliseconds.
2022-08-05 08:32:54 +08:00
37ab823e6e Merge pull request #19642 from zeertzjq/vim-8.2.0413
vim-patch:8.2.{0413,0478},9.0.0009: menu patches
2022-08-05 08:27:40 +08:00
3aef2b8bdf vim-patch:9.0.0009: going past the end of a menu item with only modifier
Problem:    Going past the end of a menu item with only modifier.
Solution:   Check for NUL.
083692d598
2022-08-05 07:58:38 +08:00
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
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
c1e1d16fca Merge pull request #19638 from zeertzjq/vim-8.2.0385
vim-patch:8.2.{0385,0392,3459}: menu_info()
2022-08-05 07:25:23 +08:00
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
93649cefab vim-patch:8.2.0392: Coverity warns for using array index out of range
Problem:    Coverity warns for using array index out of range.
Solution:   Add extra "if" to avoid warning.
56cb337872
2022-08-05 06:47:24 +08:00
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
69299380ca fix(menu): make :menu still print header when there are no menus 2022-08-05 06:29:05 +08:00
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
7c997dbc5d fix(lsp): prevent unexpected position jumps (#19370) 2022-08-03 21:44:33 +02:00
43cd91a4f4 Merge #19626 build: cleanup old cmake files 2022-08-03 07:54:53 -07:00
0a29267514 fix(completion): remove wrong FUNC_ATTR_NONNULL_ALL (#19627) 2022-08-03 21:50:14 +08:00
3df8d9b8c5 feat(lua): print source locations of lua callbacks (#19597)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-08-03 13:41:17 +01:00
c57e133e50 fix(ui): set redraw_cmdline when setting window height (#19630) 2022-08-03 19:25:03 +08:00
5ee56f95c7 Merge pull request #19540 from lewis6991/cmd_refactor 2022-08-03 11:44:17 +01:00
d3bfc03c5d build: remove InstallClintErrors.cmake
Replace its functionality by copying the entire directory where the
reports are instead.
2022-08-03 09:52:05 +02:00
ba3742ed0d build: remove unused file i386-linux-gnu.toolchain.cmake
It was used in .travis.yml which has been removed.
2022-08-03 09:52:05 +02:00
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
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
cc1ceebf8f refactor: quickfix.c (#19603)
Simplify variable declarations

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-02 23:16:07 +01:00
0806c882cd Merge pull request #19584 from bfredl/terminal_c_BSL_c_O
implement <c-\><c-o> key for terminal mode
2022-08-02 14:53:20 +02:00
def0ced4c7 fix(tabpage): check if ROWS_AVAIL changed for resize (#19620)
N/A patches for version.c:

vim-patch:9.0.0135: comment about tabpage line above the wrong code

Problem:    Comment about tabpage line above the wrong code.
Solution:   Move the comment. (closes vim/vim#10836)
0b0ccbbfb0
2022-08-02 20:48:41 +08:00
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
8ce7e7409f build: add formatting targets for c and lua files (#19488)
The targets will only format files that have been changed in current
branch compared to the master branch. This includes unstaged, staged and
committed files.

Add following make and cmake targets:
formatc   - format changed c files
formatlua - format changed lua files
format    - run formatc and formatlua

Remove scripts/uncrustify.sh as this deprecates it.
2022-08-02 12:32:57 +02:00
c223875a65 refactor: rename function prefix mb to the more accurate utf_cp (#19590)
The "cp" stands for codepoint.

Closes https://github.com/neovim/neovim/issues/7401
2022-08-02 11:52:33 +02:00
dc2745e9ea refactor(cmd): unify execute_cmd with do_one_cmd 2022-08-02 10:46:14 +01:00
dc24cb668c refactor(cmd): hoist out some code into functions 2022-08-02 10:32:00 +01:00
1f847edc63 refactor(cmd): format do_one_cmd()
- Comment style
- Minimise scope of locals
2022-08-02 10:32:00 +01:00
0a049c322f test: improve mapping tests and docs (#19619) 2022-08-02 11:13:22 +08:00
9c91d5c613 Merge pull request #19617 from zeertzjq/vim-8.2.4956
vim-patch:8.2.{4899,4956,5013}
2022-08-02 06:57:49 +08:00
50672e3850 vim-patch:8.2.5013: after text formatting cursor may be in an invalid position
Problem:    After text formatting the cursor may be in an invalid position.
Solution:   Correct the cursor position after formatting.
78d52883e1
2022-08-02 05:58:51 +08:00
4f576be881 vim-patch:8.2.4956: reading past end of line with "gf" in Visual block mode
Problem:    Reading past end of line with "gf" in Visual block mode.
Solution:   Do not include the NUL in the length.
395bd1f6d3

Omit trailing space: removed in patch 9.0.0126.
2022-08-02 05:58:51 +08:00
c57c25649b vim-patch:8.2.4899: with latin1 encoding CTRL-W might go before the cmdline
Problem:    With latin1 encoding CTRL-W might go before the start of the
            command line.
Solution:   Check already being at the start of the command line.
ef02f16609
2022-08-02 05:58:51 +08:00
d4b9f8186d vim-patch:9.0.0126 (#19612)
vim-patch:9.0.0126: expanding file names fails in dir with more than 255 entries

Problem:    Expanding file names fails in directory with more than 255
            entries.
Solution:   Use an int instead of char_u to count. (John Drouhard,
            closes vim/vim#10818)
95fca12b0e
2022-08-02 05:39:23 +08:00
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
711ef4eac9 vim-patch:05a8061eecd9 (#19610)
Update runtime files
05a8061eec
2022-08-01 17:13:53 +02:00
c6181a672a feat(node): add pnpm support #19461 2022-08-01 07:21:54 -07:00
8d1c55e422 Merge pull request #19602 from zeertzjq/vim-8.2.0807
vim-patch:8.2.{0807,0809,0812,0815,0832,1773,2804,4831,5106},9.0.0127: first part of mapset()
2022-08-01 22:19:30 +08:00
d954e8da62 feat(mapset): support restoring "replace_keycodes" and "desc" 2022-08-01 21:54:18 +08:00
cabb23ea4d test: fix api/keymap_spec.lua tests 2022-08-01 21:54:18 +08:00
8a032a6866 vim-patch:8.2.5106: default cmdwin mappings are re-mappable
Problem:    Default cmdwin mappings are re-mappable.
Solution:   Make the default mappings not re-mappable. (closes vim/vim#10580)  Use
            symbols for the first do_map() argument.
44068e97db
2022-08-01 21:54:18 +08:00
9cebfbe6ab vim-patch:8.2.4831: crash when using maparg() and unmapping simplified keys
Problem:    Crash when using maparg() and unmapping simplified keys.
Solution:   Do not keep a mapblock pointer. (closes vim/vim#10294)
2c8a7ebdad

N/A patches for version.c:

vim-patch:8.2.0832: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Add initial value.
a55ba06f69
2022-08-01 21:54:18 +08:00
34e7dc5d05 vim-patch:8.2.2804: setting buffer local mapping with mapset() changes global
Problem:    Setting buffer local mapping with mapset() changes global mapping.
Solution:   Only set the local mapping. (closes vim/vim#8143)
7ba1e4d363
2022-08-01 21:54:18 +08:00
7d45f1a5e8 vim-patch:8.2.1773: crash when calling mapset() with a list as first argument
Problem:    Crash when calling mapset() with a list as first argument.
Solution:   Check for NULL. (closes vim/vim#7040)
1b9129809d
2022-08-01 21:54:18 +08:00
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
5c72640bc2 vim-patch:8.2.0812: mapset() does not properly handle <> notation
Problem:    mapset() does not properly handle <> notation.
Solution:   Convert <> codes. (closes vim/vim#6116)
c94c1467b9
2022-08-01 21:54:18 +08:00
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
db6e93c48d feat(api): add replace_keycodes to nvim_set_keymap (#19598) 2022-08-01 21:35:08 +08:00
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
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
bcb4186cf6 refactor: replace_makeprg (#19570) 2022-08-01 12:02:53 +01:00
8952def50a Merge pull request #19595 from zeertzjq/vim-9.0.0124
vim-patch:9.0.0124: code has more indent than needed
2022-08-01 07:22:24 +08:00
975a273125 test(old): unskip test that already passes 2022-08-01 06:54:35 +08:00
c9ca90229b vim-patch:9.0.0124: code has more indent than needed
Problem:    Code has more indent than needed.
Solution:   Use continue and return statements. (closes vim/vim#10824)
101d57b34b
2022-08-01 06:18:52 +08:00
68ec497d52 Merge pull request #19437 from dundargoc/refactor/char_u-to-char
refactor: replace char_u with char
2022-07-31 15:55:01 +02:00
86110ec933 fix(highlight): add missing 'nocombine' to nvim_get_hl_* apis (#19586) 2022-07-31 13:38:00 +02:00
380417c1dd Merge pull request #19587 from Shougo/vim-9.0.0114
vim-patch:9.0.{0114,0115,0118}
2022-07-31 19:13:45 +08:00
2c522854c7 vim-patch:9.0.0118: no test for what patch 9.0.0155 fixes
Problem:    No test for what patch 9.0.0155 fixes.
Solution:   Add a test. Fix typos.  (closes vim/vim#10822)
750209459c
2022-07-31 18:51:06 +08:00
63244f68e7 vim-patch:9.0.0115: when 'cmdheight' is zero pressing ':' may scroll a window
Problem:    When 'cmdheight' is zero pressing ':' may scroll a window.
Solution:   Add the made_cmdheight_nonzero flag and set 'scrolloff' to zero.
6747cf1671
2022-07-31 17:15:36 +08:00
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
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
c1652bdcb5 cmdheight=0: fix bugs part2 (#19185) 2022-07-31 13:13:19 +08:00
7f4c50f8c4 Merge pull request #19582 from clason/vim-9.0.0111
vim-patch:9.0.0111: "nocombine" is missing from synIDattr()
2022-07-31 09:19:10 +08:00
0ae94a128f test: rewrite Test_missing_attr() in Lua 2022-07-31 08:51:20 +08:00
824a729628 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-07-31 00:52:59 +02:00
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
9511faa819 vim-patch:9.0.0109: writing over the end of a buffer on stack (#19581)
Problem:    Writing over the end of a buffer on stack when making list of
            spell suggestions.
Solution:   Make sure suggested word is not too long. (closes vim/vim#10812)
1eead4cf1d
2022-07-31 05:48:24 +08:00
fc5ed5b672 Merge pull request #19524 from dundargoc/refactor/conversion-screen
refactor: enable -Wconversion warning for screen.c
2022-07-30 22:53:51 +02:00
aa9ba05d70 refactor: enable -Wconversion warning for screen.c
Closes https://github.com/neovim/neovim/issues/567
2022-07-30 17:15:27 +02:00
6237ac8402 vim-patch:2ecbe53f452e (#19577)
Update runtime files
2ecbe53f45
2022-07-30 15:48:32 +02:00
d36d9be8ff fix(terminal): avoid reading over the end of cell.chars (#19580) 2022-07-30 21:40:30 +08:00
c34d72bf7c refactor: enable -Wconversion warning for spell.c (#19538)
Work on https://github.com/neovim/neovim/issues/567
2022-07-30 20:59:34 +08:00
e59bc078de fix(screen): check for col instead of vcol when drawing fold (#19572) 2022-07-29 21:47:21 +08:00
02efdb4d58 refactor: fix clang and PVS warnings (#19569)
The last commit didn't actually disable V1028 because of a typo.
Fix the typo so it is actually disabled.
2022-07-29 14:44:18 +08:00
0b8bade493 build(pvscheck): disable PVS/V1028 (#19553)
Most casts where PVS warns for V1028 aren't added to prevent overflows
in the first place, but to avoid other warnings, like printf argument or
-Wconversion warnings. PVS/V1028 is more annoying than useful.
2022-07-29 10:32:00 +08:00
1ebe7cd160 refactor: enable -Wconversion warning for syntax.c (#19533)
Work on https://github.com/neovim/neovim/issues/567
2022-07-29 10:05:29 +08:00
88ed33230a vim-patch:9.0.0101: invalid memory access in diff mode with "dp" and undo (#19568)
Problem:    Invalid memory access in diff mode with "dp" and undo.
Solution:   Make sure the line number does not go below one.
4e677b9c40
2022-07-29 07:31:54 +08:00
352a177dae vim-patch:9.0.0026: accessing freed memory with diff put (#19564)
Problem:    Accessing freed memory with diff put.
Solution:   Bail out when diff pointer is no longer valid.
c5274dd122
2022-07-29 06:53:32 +08:00
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
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
468b1a689a build(deps): bump LuaJIT to HEAD - a7d026548 (#19565) 2022-07-28 18:02:26 +02:00
161efc9ea4 Merge pull request #19486 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for lua/treesitter.c
2022-07-28 14:31:26 +02:00
f254fc67a5 vim-patch:9.0.0099: scrollback can be wrong after redrawing the command line (#19562)
Problem:    Scrollback can be wrong after redrawing the command line.
Solution:   Clear unfinished scrollback when redrawing. (closes vim/vim#10807)
46af7bc08d
2022-07-28 20:07:32 +08:00
9cb8b5f8db vim-patch:9.0.0097: long quickfix line is truncated for :clist (#19561)
Problem:    Long quickfix line is truncated for :clist.
Solution:   Allocate a buffer if needed.
5f30e26f69
2022-07-28 19:49:18 +08:00
b4e12bfa00 refactor: enable -Wconversion warning for spellfile.c (#19527)
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 18:49:46 +08:00
7304b7eee3 refactor: enable -Wconversion warning for lua/treesitter.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 12:13:06 +02:00
b971547c54 build(deps): bump LuaJIT to HEAD - e1339aed3 (#19536) 2022-07-28 09:18:22 +02:00
fe254fb7e7 Merge pull request #19556 from zeertzjq/vim-9.0.0061
vim-patch:9.0.{0061,partial:0077,0094}
2022-07-28 12:22:00 +08:00
0134a2cb3e vim-patch:9.0.0094: cursor restored unexpected with nested autocommand
Problem:    Cursor restored unexpected with nested autocommand.
Solution:   Do not restore the cursor when it was moved intentionally.
            (closes vim/vim#10780)
3d6ee8bda0
2022-07-28 11:40:35 +08:00
394d65494a vim-patch:partial:9.0.0077: wrong restored cursor position when switching window in autocmd
Problem:    When switching window in autocmd the restored cursor position may
            be wrong.
Solution:   Do not restore the cursor if it was not set. (closes vim/vim#10775)
b03950fafa

This patch cannot be fully ported because it depends on patch 8.2.3518.
2022-07-28 11:38:02 +08:00
8e67af1b20 vim-patch:9.0.0061: ml_get error with nested autocommand
Problem:    ml_get error with nested autocommand.
Solution:   Also check line numbers for a nested autocommand. (closes vim/vim#10761)
5fa9f23a63
2022-07-28 11:38:02 +08:00
bdbf843031 vim-patch:8.2.3912: the ins_complete() function is much too long (#19555)
Problem:    The ins_complete() function is much too long.
Solution:   Split it up into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9414)
bf7ff61af4
2022-07-28 11:35:13 +08:00
f1c01e5f94 Merge pull request #19554 from zeertzjq/vim-9.0.0095
vim-patch:9.0.{0095,0096}: remove dead code
2022-07-28 07:17:11 +08:00
721ea8fab2 vim-patch:9.0.0096: flag "new_value_alloced" is always true
Problem:    Flag "new_value_alloced" is always true.
Solution:   Remove "new_value_alloced". (closes vim/vim#10792)
f6782732ab
2022-07-28 06:48:36 +08:00
e6b7f70294 vim-patch:9.0.0095: conditions are always true
Problem:    Conditions are always true.
Solution:   Remove useless conditions. (closes vim/vim#10802)
122dea7007
2022-07-28 06:45:22 +08:00
e0eebe3087 refactor: enable -Wconversion warning for window.c (#19537)
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 23:39:52 +01:00
dadb0d6f01 refactor: enable -Wconversion warning for eval/funcs.c (#19541)
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 23:37:39 +01:00
d27e4d657b perf(api): optimize nvim_cmd (#19513)
Reduce the amount of string allocations and length calculations.

With the following benchmark:

```lua
total = 0
for _ = 1, loops do
  local start = now()
  vim.api.nvim_cmd({cmd = 'let', args = {'a', '=', '1'}}, {})
  total = total + (now() - start)
end
print('nvim_cmd', total / loops)
```

```
hyperfine 'nvim --clean test.lua +source +q'
```

Before: 234.5ms
After:  173.8ms
2022-07-27 23:35:01 +01:00
48608a1f46 refactor: enable -Wconversion warning for regexp files (#19521)
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 06:08:20 +08:00
e0c433833f refactor: fix clang and PVS warnings (#19532) 2022-07-28 06:05:33 +08:00
7d9e68669c vim-patch:9.0.0092: plugins cannot change v:completed_item (#19542)
Problem:    Plugins cannot change v:completed_item.
Solution:   Make v:completed_item writeable. (Shougo Matsushita,
            closes vim/vim#10801)
61021aa318
2022-07-28 05:19:38 +08:00
b6b9f46041 Merge pull request #19525 from dundargoc/refactor/conversion-search
refactor: enable -Wconversion warning for search.c
2022-07-27 19:07:45 +02:00
18755c6b89 Merge pull request #19516 from dundargoc/refactor/conversion-mbyte
refactor: enable -Wconversion warning for mbyte.c
2022-07-27 19:00:40 +02:00
f5d558c8ea feat(lsp): provide feedback if server can't compute rename result (#19546)
Without some form of feedback a user cannot easily tell if the server is
still computing the result (which can take a while in large projects),
or whether the server couldn't compute the rename result.
2022-07-27 18:56:27 +02:00
888f12858a fix(lsp): set workspace.configuration capability (#19548)
Neovim implements `workspace/configuration`
It should set the capability accordingly.

From https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities:

    /**
     * The client supports `workspace/configuration` requests.
     *
     * @since 3.6.0
     */
    configuration?: boolean;
2022-07-27 18:55:44 +02:00
4c3104819b vim-patch:9.0.0093: sway config files are recognized as i3config (#19545)
Problem:    Sway config files are recognized as i3config.
Solution:   Recognize swayconfig separately. (James Eapen, closes vim/vim#10672)
7abd1c6d8e
2022-07-27 18:11:59 +02:00
9b447c7ce5 vim-patch:9.0.0088: pattern for detecting bitbake files is not sufficient (#19547)
Problem:    Pattern for detecting bitbake files is not sufficient.
Solution:   Adjust the pattern. (Gregory Anders, closes vim/vim#10743)
30e212dac1
2022-07-27 10:06:09 -06:00
3a40d4b759 refactor: enable -Wconversion warning for search.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 16:51:25 +02:00
f57432af4d vim-patch:9.0.0090: no error when assigning bool to a string option (#19539)
Problem:    No error when assigning bool to a string option with setwinvar().
Solution:   Give an error (closes vim/vim#10766)
28f84e17b0
2022-07-27 20:59:43 +08:00
335b49e129 refactor: enable -Wconversion warning for mbyte.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 13:14:33 +02:00
e0f32abb1c Merge pull request #19518 from dundargoc/build/openbsd/no-versions
ci(openbsd): don't specify versions for dependencies if possible
2022-07-27 06:27:51 -04:00
57ce6c2b8f Merge pull request #19531 from zeertzjq/vim-8.2.4623
vim-patch:8.2.{4623,4625}: coverity warnings
2022-07-27 12:27:42 +08:00
bbad7371db vim-patch:8.2.4625: old Coverity warning for resource leak
Problem:    Old Coverity warning for resource leak.
Solution:   Call FreeWild() if expanding matches did not fail.
90da27b927
2022-07-27 12:00:56 +08:00
f586131e57 vim-patch:8.2.4623: Coverity warns for using uninitialized field
Problem:    Coverity warns for using uninitialized field.
Solution:   Initialize he field to zero.
03a297c63f

Also only initialize used fields in f_fullcommand().
2022-07-27 12:00:52 +08:00
79872f3770 fix(options): properly free string options (#19510) 2022-07-27 07:26:32 +08:00
890d4023cd vim-patch:9.0.0081: command line completion of user command may have duplicates (#19529)
Problem:    Command line completion of user command may have duplicates.
            (Dani Dickstein)
Solution:   Skip global user command if an identical buffer-local one is
            defined. (closes vim/vim#10797)
c2842adfb2
2022-07-27 07:25:47 +08:00
2fdb0de197 Merge pull request #19528 from zeertzjq/vim-9.0.0051
vim-patch:9.0.{0051,0082,0083,0086}: cmdline fixes
2022-07-27 07:25:13 +08:00
fc55f8263c vim-patch:9.0.0086: tabline is not redrawn when entering command line
Problem:    Tabline is not redrawn when entering command line.
Solution:   Set "redraw_tabline". (closes vim/vim#10771)
6791adca53
2022-07-27 06:32:40 +08:00
0c0a2e4e52 vim-patch:9.0.0083: ModeChanged event not triggered when leaving cmdline window
Problem:    ModeChanged event not triggered when leaving the cmdline window.
Solution:   Call may_trigger_modechanged(). (closes vim/vim#10791)
c9e8fd6fc7

Code is already present in Nvim. Add some other related missing changes.
2022-07-27 06:23:47 +08:00
9f1dc1466e vim-patch:9.0.0082: cannot interrupt global command from command line
Problem:    Cannot interrupt global command from command line.
Solution:   Reset got_int in another place. (closes vim/vim#10739)
3cfae39b08
2022-07-27 06:19:43 +08:00
45e2bbae83 vim-patch:9.0.0051: using CTRL-C wih :append may hang Vim
Problem:    Using CTRL-C wih :append may hang Vim.
Solution:   Reset got_int. (closes vim/vim#10729, closes vim/vim#10728)
f754fe6a3d
2022-07-27 06:19:43 +08:00
49d2256ae5 build(gen_vimdoc): fall back to lua if luajit doesn't exist (#19498)
It currently falls back to texlua if luajit doesn't exist. However,
the documentation generation does not work with texlua. Instead use lua
as a fall back instead.
2022-07-27 00:17:11 +02:00
289256337a Merge pull request #19523 from ii14/vim-9.0.0085
vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
2022-07-27 05:58:27 +08:00
7e939ddb87 vim-patch:9.0.0084: using "terraform" filetype for .tfvars file is bad (#19526)
Problem:    Using "terraform" filetype for .tfvars file is bad.
Solution:   use "terraform-vars", so that different completion and other
            mechanisms can be used. (Radek Simko, closes vim/vim#10755)
15b87b6610
2022-07-26 23:08:48 +02:00
4225e6ee46 vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
Problem:    ":write" fails after ":file name" and the ":edit".
Solution:   Reset BF_NOTEDITED when using ":edit". (closes vim/vim#10790)
1f0dc5e84f
2022-07-26 20:57:57 +02:00
d61a5a08ac ci(openbsd): don't specify versions for dependencies if possible
It's more convenient to not specify the version and let openbsd's
package manager figure it out. This will help us avoid manually bumping
dependency versions when a new version of openbsd is released.

Some packages have multiple versions and not specifying a version in
those cases fails the CI job, so providing a version seems to be
necessary for some key packages.
2022-07-26 17:27:26 +02:00
2a9c9371bc vim-patch:9.0.0073: too many files recognized as bsdl (#19504)
Problem:    Too many files recognized as bsdl.
Solution:   Use pattern "*.bsd" instead of "*bsd". (Martin Tournoij,
            closes vim/vim#10783)
1b67f07f76
2022-07-26 14:16:46 +02:00
1a4753f25a Merge pull request #19514 from zeertzjq/vim-8.1.1424
vim-patch:8.1.1424,9.0.0076: crash when popup menu is deleted while waiting for char
2022-07-26 20:03:02 +08:00
27116a0159 vim-patch:9.0.0076: no test for what patch 8.1.1424 fixes
Problem:    No test for what patch 8.1.1424 fixes.
Solution:   Add a test. (closes vim/vim#10789)
92a1678d48
2022-07-26 19:37:17 +08:00
ee8606d31f vim-patch:8.1.1424: crash when popup menu is deleted while waiting for char
Problem:    Crash when popup menu is deleted while waiting for char.
Solution:   Bail out when pum_array was cleared.
5c3fb04623
2022-07-26 19:36:24 +08:00
cbfae548e8 Merge pull request #19512 from dundargoc/build/version-fix
build: fix version generation to its previous behavior
2022-07-26 06:47:56 -04:00
4cbeedf57b vim-patch:b529cfbd04c0 (#19501)
Update runtime files
b529cfbd04
2022-07-26 11:26:23 +02:00
46bf1ec791 build: fix version generation to its previous behavior
This will change the version format from

v0.8.0-dev-nightly-12-g1a07044c1

to

v0.8.0-dev-698-ga5920e98f

Closes https://github.com/neovim/neovim/issues/19499
2022-07-26 11:22:31 +02:00
1a07044c1c revert: "vim-patch:9.0.0061: ml_get error with nested autocommand" (#19509)
This reverts commit 6cee15da72.

Port this again when https://github.com/vim/vim/issues/10780 is fixed.
2022-07-26 11:53:17 +08:00
147cce29a6 fix(cmdline): trigger CmdlineEnter and ModeChanged earlier (#19474)
Match Vim's ordering in code.
These tests are unrelated to ext_cmdline. Move them out of that block.
2022-07-26 10:21:30 +08:00
88c6e02c12 Merge pull request #19508 from ii14/fix_older_cmake_makefiles
build: fix git version generation on makefiles with older cmake versions
2022-07-25 21:41:03 -04:00
ba662efb17 build: fix git version generation on makefiles with older cmake versions
When using a Makefile generator, older CMake versions are not building
custom targets when depending on their byproducts, making version
generation fail. (works on 3.19.4, fails on 3.10.2) As a workaround,
add a dependency on the custom target explicitly.
2022-07-26 02:03:13 +02:00
fe159d23fd vim-patch:9.0.0071: command overlaps with printed text in scrollback (#19505)
Problem:    Command overlaps with printed text in scrollback.
Solution:   Clear until end-of-line and use correct message chunk.
            (closes vim/vim#10765, closes vim/vim#10764)
ecdc82e74e

N/A patches for version.c:

vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative

Problem:    Using utfc_ptr2char_len() when length is negative.
Solution:   Check value of length. (closes vim/vim#10760)
4dc513a22c
2022-07-26 07:30:33 +08:00
3ded2ab55a feat(lsp): allow passing custom list handler to LSP functions that return lists (#19213)
Currently LSP allows only using loclist or quickfix list window. I
normally prefer to review all quickfix items without opening quickfix
window. This fix allows passing `on_list` option which allows full
control what to do with list.

Here is example how to use it with quick fix list:

```lua
local function on_list(options)
  vim.fn.setqflist({}, ' ', options)
  vim.api.nvim_command('cfirst')
end

local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', '<leader>ad', function() vim.lsp.buf.declaration{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>ai', function() vim.lsp.buf.implementation{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>at', function() vim.lsp.buf.type_definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>af', function() vim.lsp.buf.references(nil, {on_list=on_list}) end, bufopts)
```

If you prefer loclist do something like this:

```lua
local function on_list(options)
  vim.fn.setloclist(0, {}, ' ', options)
  vim.api.nvim_command('lopen')
end
```

close #19182

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2022-07-25 23:02:51 +02:00
7961f79904 Merge pull request #19494 from zeertzjq/vim-8.2.5155
vim-patch:8.2.{5155,5163,5164,5166}: diff fixes
2022-07-25 21:32:30 +08:00
e12035fc0c build(lint): check uncrustify version #19468
This to prevent the user from accidentally using the wrong uncrustify
version.
2022-07-25 06:18:49 -07:00
e4079f3b5a vim-patch:8.2.5166: test for DiffUpdated fails
Problem:    Test for DiffUpdated fails.
Solution:   Also accept a count of two.
f65cc665fa
2022-07-25 20:48:21 +08:00
771564b00e vim-patch:8.2.5164: invalid memory access after diff buffer manipulations
Problem:    Invalid memory access after diff buffer manipulations.
Solution:   Use zero offset when change removes all lines in a diff block.
c101abff4c
2022-07-25 20:48:21 +08:00
8543de3a86 vim-patch:8.2.5163: crash when deleting buffers in diff mode
Problem:    Crash when deleting buffers in diff mode.
Solution:   Recompute diffs later.  Skip window without a valid buffer.
cd38bb4d83
2022-07-25 20:48:21 +08:00
611b43369e vim-patch:8.2.5155: in diff mode windows may get out of sync
Problem:    In diff mode windows may get out of sync. (Gary Johnson)
Solution:   Avoid that the other window scrolls for 'cursorbind'.
a315ce1f32
2022-07-25 20:30:35 +08:00
e12c62c1f7 Merge pull request #19470 from zeertzjq/vim-8.2.4866
vim-patch:8.2.4866,9.0.0066: duplicate code in "get" functions
2022-07-25 20:29:34 +08:00
ad57610ac7 vim-patch:9.0.0066: switching window uneccarily when getting buffer options
Problem:    Switching window uneccarily when getting buffer options.
Solution:   Do not switch window when getting buffer options. (closes vim/vim#10767)
cd6ad6439d
2022-07-25 20:01:59 +08:00
56ed5a0403 vim-patch:8.2.4866: duplicate code in "get" functions
Problem:    Duplicate code in "get" functions.
Solution:   Use get_var_from() for getwinvar(), gettabvar(), gettabwinvar()
            and getbufvar(). (closes vim/vim#10335)
47d4e317f8

f_setbufvar() can use tv_get_buf_from_arg() as it sets emsg_off.
2022-07-25 20:01:59 +08:00
6e9a7e7db8 Merge pull request #19493 from zeertzjq/vim-8.2.1469
vim-patch:8.2.{1469,2254,2284,2285,2969,4228}: option fixes and refactorings
2022-07-25 19:01:48 +08:00
6c26d0b068 ci(distribution): auto-release winget #19121
- forked winget-pkgs to https://github.com/neovim/winget-pkgs
- key stored in WINGET_TOKEN at https://github.com/neovim/neovim/settings/secrets/actions
- deploy key public key stored at https://github.com/neovim/winget-pkgs/settings/keys
2022-07-25 03:58:16 -07:00
aba3147cb6 vim-patch:8.2.4228: no tests for clicking in the GUI tabline
Problem:    No tests for clicking in the GUI tabline.
Solution:   Add test functions to generate the events.  Add tests using the
            functions. (Yegappan Lakshmanan, closes vim/vim#9638)
b0ad2d92fd
2022-07-25 18:20:47 +08:00
d8df9afad6 vim-patch:8.2.2969: subtracting from number option fails when result is zero
Problem:    Subtracting from number option fails when result is zero. (Ingo
            Karkat)
Solution:   Reset the string value when using the numeric value.
            (closes vim/vim#8351)
a42e6e0082

Cherry-pick Test_compound_assignment_operators() changes from patch 8.2.1593
2022-07-25 18:20:47 +08:00
963ea726da vim-patch:8.2.2285: Vim9: cannot set an option to a false
Problem:    Vim9: cannot set an option to a false.
Solution:   For VAR_BOOL use string "0". (closes vim/vim#7603)
b0d8182fa3
2022-07-25 18:20:47 +08:00
8921035fc7 vim-patch:8.2.2284: Vim9: cannot set an option to a boolean value
Problem:    Vim9: cannot set an option to a boolean value.
Solution:   Check for VAR_BOOL. (closes vim/vim#7603)
31a201a04a
2022-07-25 18:20:47 +08:00
2241fd3211 vim-patch:8.2.2254: Vim9: bool option type is number
Problem:    Vim9: bool option type is number.
Solution:   Have get_option_value() return a different value for bool and
            number options. (closes vim/vim#7583)
dd1f426bd6
2022-07-25 18:20:47 +08:00
3ea45a2caf vim-patch:8.2.1469: Vim9: cannot assign string to string option
Problem:    Vim9: cannot assign string to string option.
Solution:   Change checks for option value. (closes vim/vim#6720)
0aae4809fd
2022-07-25 18:20:45 +08:00
e9b58a619e Merge pull request #18992 from zeertzjq/alt-mouse
fix(input): do no reinterpret mouse keys with ALT modifiers
2022-07-25 10:15:44 +08:00
0cc41a61d1 test: improve some input tests 2022-07-25 09:47:28 +08:00
eb77122823 fix(input): do no reinterpret mouse keys with ALT modifiers
Remove check for MOD_MASK_META as it is for <T- which never appears in TUI.
Make small changes to docs.
2022-07-25 09:47:28 +08:00
46e3e1c728 fix(api): make nvim_cmd mods.silent work correctly (#19489) 2022-07-25 09:43:39 +08:00
d529523027 vim-patch:8.1.1763: evalfunc.c is still too big (#17952) 2022-07-24 15:02:39 +01:00
2a56cc5230 feat(l10n): improve zh_CN translations (#19483) 2022-07-24 20:33:07 +08:00
ea13dce3bf fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)
Fix a mistake in the porting of Vim patch 8.0.1309.
2022-07-24 09:29:28 +08:00
1849cf0e4c Merge pull request #19476 from zeertzjq/vim-9.0.0059
vim-patch:9.0.{0059,0061}
2022-07-23 18:12:37 +08:00
6cee15da72 vim-patch:9.0.0061: ml_get error with nested autocommand
Problem:    ml_get error with nested autocommand.
Solution:   Also check line numbers for a nested autocommand. (closes vim/vim#10761)
5fa9f23a63
2022-07-23 17:50:25 +08:00
264791925a vim-patch:9.0.0059: test file has wrong name
Problem:    Test file has wrong name.
Solution:   Rename the file.  Various small fixes. (closes vim/vim#10674)
bb404f5ad5
2022-07-23 14:22:08 +08:00
d0ced2a127 Merge pull request #19471 from zeertzjq/vim-8.2.4731
vim-patch:8.2.{4731,5035}: changelist patches
2022-07-23 10:15:57 +08:00
9d556fc81f vim-patch:8.2.5035: when splitting a window the changelist position moves
Problem:    When splitting a window the changelist position moves.
Solution:   Set the changelist index a bit later. (closes vim/vim#10493)
e6f13b473c

Cherry-pick Test_nv_hat_count() change from patch 8.2.1593.
2022-07-23 09:48:24 +08:00
91c99eed54 vim-patch:8.2.4731: the changelist index is not remembered per buffer
Problem:    The changelist index is not remembered per buffer.
Solution:   Keep the changelist index per window and buffer. (closes vim/vim#10135,
            closes vim/vim#2173)
db0ea7f2b0

Cherry-pick FOR_ALL_BUF_WININFO from patch 8.2.0500.
Cherry-pick test_changelist.vim change from patch 8.2.3795.
2022-07-23 09:48:24 +08:00
ed6bbc03af Merge pull request #19467 from zeertzjq/vim-8.2.1489
vim-patch:8.2.1489
2022-07-22 23:03:52 +08:00
232cdbb880 vim-patch:8.2.1489: Vim9: error when setting an option with setbufvar()
Problem:    Vim9: error when setting an option with setbufvar().
Solution:   Do not get a number from a string value. (closes vim/vim#6740)
191929b182

Vim9 is N/A, so this just refactors the code without changing behavior.
2022-07-22 22:38:05 +08:00
271739c830 refactor: move f_getbufvar() and f_setbufvar() to eval/vars.c
Vim moved them there in patch 8.1.1943.
2022-07-22 22:38:05 +08:00
790f8b0e16 fix(build): non-git ("tarball") build fails #19448
Problem:
Build fails without git or .git/.
ref #19289

Solution:
Fix the version generation logic.

Test cases:
If `git` is missing:
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `.git/` is missing:
    -- Git tag extraction failed:
       fatal: not a git repository (or any of the parent directories): .git
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `git describe` fails
    -- Git tag extraction failed:
       fatal: ...
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-07-22 07:10:24 -07:00
3f2e1c1db9 ci(release): use cpack on macOS #19459
We use `cpack` to generate the release tarballs on Linux. Now that we
don't need to bundle `libintl`, we can do the same on macOS.
2022-07-22 07:08:11 -07:00
a7b9920930 refactor: move FunPtr to types.h (#19466)
This type itself is not eval-specific. Moving it to types.h can avoid
including eval/funcs.h in many headers, and types.h is already included
by many headers.
2022-07-22 22:05:02 +08:00
ac690f457e feat(l10n): Turkish translations #19441 2022-07-22 07:04:40 -07:00
9d4a4f49ef vim-patch:8.1.1933: the eval.c file is too big (#19462)
Problem:    The eval.c file is too big.
Solution:   Move code related to variables to evalvars.c. (Yegappan
            Lakshmanan, closes vim/vim#4868)
0522ba0359

Name the new file eval/vars.c instead.
2022-07-22 21:14:17 +08:00
bb7853a62d test(mksession_spec): use %bwipeout! instead of qall! to close terminal (#19465)
Avoid expect_exit, session will be closed when a new one is spawned.
2022-07-22 12:59:34 +08:00
8af3d641da fix(grid): don't use utfc_ptr2char_len() when printing until NUL (#19456) 2022-07-22 06:41:51 +08:00
946c8fd288 ci(labeler): do not add "column" label for mark.{c,h} (#19455) 2022-07-21 17:44:44 +08:00
77b9f1eac5 refactor: fix clang warnings (#19453) 2022-07-21 17:42:59 +08:00
c15e9d3746 fix(mark): give correct error message when mark is in another buffer (#19454) 2022-07-21 17:42:17 +08:00
6a7d00469b vim-patch:9.0.0047: using freed memory with recursive substitute (#19457)
Problem:    Using freed memory with recursive substitute.
Solution:   Always make a copy for reg_prev_sub.
32acf1f1a7
2022-07-21 16:00:45 +08:00
1f1863ed54 vim-patch:8.2.4502 (#19439)
vim-patch:8.2.4502: in the GUI a modifier is not recognized after CTRL-X

Problem:    In the GUI a modifier is not recognized for the key typed after
            CTRL-X, which may result in a mapping to be used. (Daniel
            Steinberg)
Solution:   Recognize a modifier starting with CSI. (closes vim/vim#9889)
d979d64fa2

Code is N/A. This just ports the test change.
Test depends on README.txt in testdir. Add that file.
Reorder test_ins_complete.vim to match upstream.
2022-07-21 06:00:16 +08:00
598cbcae4a Merge pull request #19445 from famiu/fix/local_winbar_tabs
fix: local winbar with tabs
2022-07-20 16:57:38 +02:00
9879fd5d08 fix: local winbar with tabs
Closes #19396
2022-07-20 20:32:22 +06:00
1a2560c2dc test(old): set 'display' to an empty string (#19450) 2022-07-20 19:58:08 +08:00
559ef3e903 feat(lua): allow vim.cmd to be indexed (#19238) 2022-07-20 12:29:24 +01:00
243038188b Merge pull request #19446 from bfredl/fixarray
refactor(object): get rid of redundant FIXED_TEMP_ARRAY
2022-07-20 10:36:44 +02:00
c65e73f2d6 refactor(object): get rid of redundant FIXED_TEMP_ARRAY
use the MAXSIZE_TEMP_ARRAY + ADD_C pattern instead, as exemplified
by the changes in this commit.
2022-07-20 10:04:06 +02:00
1ef84547a8 Merge pull request #19415 from zeertzjq/vim-8.1.1076
vim-patch:8.1.{1076,1849}: file for Insert mode is much too big
2022-07-20 06:33:55 +08:00
420bb2eb8a vim-patch:8.1.1849
9bca58f36d
2022-07-20 06:08:41 +08:00
f357c9bca5 vim-patch:8.1.1076: file for Insert mode is much too big
Problem:    File for Insert mode is much too big.
Solution:   Split off the code for Insert completion. (Yegappan Lakshmanan,
            closes vim/vim#4044)
7591bb39d5

Cherry-pick ins_compl_len() -> get_compl_len() from patch 8.2.4001.

Revert a71c5e9eb9: ctrl_x_mode is no
longer a global variable, so l_ctrl_x_mode is no longer needed.
2022-07-20 06:08:41 +08:00
8620dfc5bd fix(tmpdir): invalid tempname() if username has slashes #19323
fix #19240

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-07-19 09:03:12 -07:00
61302fb391 docs: fix vim.filetype.add by avoiding quotes (#19433)
* Problem

Quotes are special in doxygen, and should be escaped. *Sometimes* they
cause doc generation issues. Like in #17785

* Solution

Replace double quotes with single quotes
2022-07-19 09:12:10 -06:00
b154d951e6 Merge pull request #19434 from zeertzjq/vim-8.2.0509
vim-patch:8.2.{0509,2632}: startup tests
2022-07-19 22:27:36 +08:00
9e15bdde3b build(macos): use consistent MACOSX_DEPLOYMENT_TARGET (#19430)
Use the same logic for both deps (including LuaJIT, for which setting
this variable is mandatory) and Nvim: either the eponymous environment
variable if set, or the current software version if not.

Removes annoying warnings when building locally on macOS.
2022-07-19 16:10:59 +02:00
358f9b776b vim-patch:8.2.2632: not all command line arguments are tested
Problem:    Not all command line arguments are tested.
Solution:   Add tests for -D and -serverlist. (Dominique Pellé, closes vim/vim#7992)
c5cf369e95

Cherry-pick two deletions from patch 8.2.1799.
2022-07-19 22:02:49 +08:00
2e790e9ad1 vim-patch:8.2.0509: various code is not properly tested.
Problem:    various code is not properly tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5871)
cde0ff39da

Cherry-pick test_clientserver.vim change from patch 8.1.1826.
Cherry-pick a comment from patch 8.2.0301.
Omit test_viminfo.vim.
2022-07-19 22:02:46 +08:00
871ff8d62f Merge pull request #19428 from jamessan/deps-cmake-version
build: bump minimum CMake version in cmake.deps
2022-07-19 08:52:14 -04:00
078e446181 Merge pull request #19429 from zeertzjq/fix-flaky-tests
fix flaky tests
2022-07-19 20:27:25 +08:00
72dfd57e5f test: deal with RPC call causing Nvim to exit later 2022-07-19 19:41:07 +08:00
366e90cdc8 test: avoid timing-sensitive undo message 2022-07-19 19:41:07 +08:00
101fd04ee2 Merge pull request #19409 from bfredl/uiunpack
perf(ui): some ui_client fixes/optimizations before externalized TUI
2022-07-19 13:08:11 +02:00
0a716fc776 build: bump minimum CMake version in cmake.deps
The minimum version for the main project was bumped in 035d82e0d3.
Align cmake.deps to the same version for consistency.
2022-07-19 07:02:51 -04:00
f87c824513 fix(rpc): break nvim_error_event feedback loop between two nvim instances
In case nvim A sends nvim_error_event to nvim B, it would
respond with another nvim_error_event due to unknown
request name. Fix this by adding dummy request handler for now.
2022-07-19 12:38:37 +02:00
0b63f5afad perf(ui): unpack grid_line (screen contents) directly 2022-07-19 12:38:37 +02:00
93bd6fb2c8 Merge pull request #19427 from Maverun/maveBranchDoc
fix(docs): remove internal function from docs (nvim__*)
2022-07-19 12:10:03 +02:00
4e3699d13a fix(docs): remove internal function from docs (nvim__*) 2022-07-19 05:03:22 -04:00
7b835ba796 vim-patch:8.2.1147 (#19425)
vim-patch:8.2.1147: :confirm may happen in cooked mode

Problem:    :confirm may happen in cooked mode. (Jason Franklin)
Solution:   Switch to raw mode before prompting. (Brandon Pfeifer)
27321dbeed

Code is N/A, but this improves tests. Port the improved tests to Lua.
2022-07-19 13:00:22 +08:00
JP
1a655b71a8 fix(lua): make it possible to cancel vim.wait() with Ctrl-C (#19217) 2022-07-19 09:11:13 +08:00
a80d447b47 fix(mouse): click on global statusline with splits (#19390) 2022-07-19 06:35:04 +08:00
3340728c72 fix(powershell): filter ":!" commands with args #19268
Problem:
Since 0b9664f524 powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."

Solution:
Pass args to Start-Process via `-ArgumentList`.
closes #19250
2022-07-18 13:26:09 -07:00
d73c31a41f Merge pull request #19167 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for memline.c
2022-07-18 20:22:18 +01:00
e8c94697bc ci: test only a single macos version (#19418)
The differences in MacOS releases are smaller since they're now upgraded
yearly, meaning the need to test each version is reduced.
2022-07-18 18:39:41 +02:00
d15a66d803 ci(windows): config and build before publish step (#19416)
Problem: Windows package step failed (silently).
Solution: Make sure to configure cmake before attempting to build the package target.
2022-07-18 15:18:15 +02:00
be3d2f5125 perf(ui): avoid ui_flush() work in headless mode 2022-07-18 14:08:44 +02:00
45bee1dafd perf(ui): eliminate spurious memory allocations for hl_attr_define event 2022-07-18 14:08:44 +02:00
67a04fe6cb perf(ui): unpack a single ui event at a time, instead of a "redraw" batch
This reduces the memory overhead for large redraw batches, as a much smaller
prefix of the api object buffer is used and needs to be hot in cache.
2022-07-18 14:08:44 +02:00
1b462705d0 fix(windows):exepath, stdpath return wrong slashes #19111
exepath and stdpath should respect shellslash and return path with
proper file separator.
Closes #13787
2022-07-17 17:00:08 -07:00
776913e32e fix: add group in autocmd api #19412
regression from PR #19283: custom close autocommands for the preview window were
not cleaned up after the window was closed.
2022-07-17 16:11:41 -07:00
9169fb8f07 fix(lua): double entries in :lua completion #19410
`:lua vim.ls<tab>` would list `lsp` twice.
2022-07-17 15:40:18 -07:00
9f4b19b6d0 ci: refactor build.ps1 #19336
Refactor `build.ps1` into a more modular design

9728f3b558/.github/workflows/ci.yml (L283-L296)

- Separate CI steps.
- Remove unneeded code related to setting up CMake.
- Use parallel/incremental builds.
- Fix github's cache.
- Clear the way for the possibility of replacing this file with a cmake-preset:
  https://github.com/neovim/neovim/pull/19128
2022-07-17 15:07:35 -07:00
13abe20b5f refactor(lsp): use autocmd api (#19407)
* refactor(lsp): use autocmd api

* refactor(lsp): inline BufWritePost and VimLeavePre callbacks
2022-07-17 19:13:33 +02:00
ff35d7a4b9 fix(lsp): move augroup define to if statement (#19406) 2022-07-17 19:11:05 +02:00
5ccdf6a88d vim-patch:9.0.0055 (#19392)
vim-patch:9.0.0055: bitbake files are not detected

Problem:    Bitbake files are not detected.
Solution:   Add bitbake filetype detection by file name and contents. (Gregory
            Anders, closes vim/vim#10697)
fa49eb4827
2022-07-17 14:33:51 +02:00
eb9b93b5e0 feat(defaults): mouse=nvi #19290
Problem:
Since right-click can now show a popup menu, we can provide messaging to
guide users who expect 'mouse' to be disabled by default. So 'mouse' can
now be enabled by default.

Solution:
Do it.
Closes #15521
2022-07-17 04:14:04 -07:00
aae11865e1 Merge #19309 from ii14/lsp_refactor_1
refactor(lsp): make the use of local aliases more consistent
2022-07-17 11:43:44 +02:00
9e7f92e59a Merge pull request #19404 from zeertzjq/vim-8.2.0670
vim-patch:8.2.{0670,0698,1294,1984,2424,2426,2427,5029}: textlock patches
2022-07-17 14:15:32 +08:00
006334f3a7 vim-patch:8.2.2427: can still switch windows for 'completefunc'
Problem:    Can still switch windows for 'completefunc'.
Solution:   Also disallow switching windows for other completions.
3eb6bd9c2b

Assert E565 instead of E578.
Need to assert a different string because patch 8.2.1919 hasn't been
ported yet.
2022-07-17 13:51:46 +08:00
f72ec95958 vim-patch:8.2.2426: allowing 'completefunc' to switch windows causes trouble
Problem:    Allowing 'completefunc' to switch windows causes trouble.
Solution:   use "textwinlock" instead of "textlock".
28976e2acc

Assert E565 instead of E578.

vim-patch:8.2.0670: cannot change window when evaluating 'completefunc'

Problem:    Cannot change window when evaluating 'completefunc'.
Solution:   Make a difference between not changing text or buffers and also
            not changing window.
6adb9ea0a6

vim-patch:8.2.5029: "textlock" is always zero

Problem:    "textlock" is always zero.
Solution:   Remove "textlock" and rename "textwinlock" to "textlock".
            (closes vim/vim#10489)
cfe456543e
2022-07-17 13:51:46 +08:00
b0bbcfa239 vim-patch:8.2.2424: some tests are known to cause an error with ASAN
Problem:    Some tests are known to cause an error with ASAN.
Solution:   Add CheckNotAsan.
97202d9516

Move CheckNotMSWindows to the right place.
Omit test_memory_usage.vim: a Lua test is used for this file.
2022-07-17 13:51:46 +08:00
656a1889ee vim-patch:8.2.1984: cannot use :vimgrep in omni completion
Problem:    Cannot use :vimgrep in omni completion, causing C completion to
            fail.
Solution:   Add the EX_LOCK_OK flag to :vimgrep. (closes vim/vim#7292)
33aecb1f2c

Cherry-pick Test_resize_from_copen() indent change from patch 8.2.1432.
2022-07-17 13:51:46 +08:00
7e79cb56c5 vim-patch:8.2.1294: Vim9: error when using vim9script in TextYankPost
Problem:    Vim9: error when using vim9script in TextYankPost.
Solution:   Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
            be used when text is locked. (closes vim/vim#6529)
37394ff752
2022-07-17 13:51:46 +08:00
95b1191505 vim-patch:8.2.0698: insert mode completion not fully tested
Problem:    Insert mode completion not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6041)
f9ab52e155

Cherry-pick test_ins_complete.vim changes from patches 8.2.{0522,0615}.
2022-07-17 13:51:39 +08:00
53c398d8f4 Merge pull request #19402 from zeertzjq/vim-8.2.0655
vim-patch:8.2.{0655,1040}: not enough tests
2022-07-17 11:30:32 +08:00
7c3a87182d vim-patch:8.2.1040: not enough testing for movement commands
Problem:    Not enough testing for movement commands.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6313)
bdd2c290d3

Cherry-pick test_functions.vim changes from patch 8.2.0183.
Cherry-pick Test_normal18_z_fold() change from patch 8.2.0540.
2022-07-17 11:08:14 +08:00
e53330a603 vim-patch:8.2.0655: search code not sufficiently tested
Problem:    Search code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5999)
224a5f17c6

Cherry-pick test_charsearch.vim change from patch 8.2.0448.
Cherry-pick test_search.vim changes from patch 8.2.0619.
2022-07-17 10:03:58 +08:00
9f837a5dcf fix(api): fix nvim_parse_cmd interfere with printing line in Ex mode (#19400) 2022-07-17 09:59:32 +08:00
08a50f6690 Merge pull request #19395 from jamessan/flaky-job-test
test(job_spec): accept alternate messages for "append environment" tests
2022-07-16 21:24:06 -04:00
4f59bc8013 Merge pull request #19391 from zeertzjq/vim-8.2.0052
vim-patch:8.2.{0052,0198,2608,2643}: code not fully tested
2022-07-17 06:07:05 +08:00
bcb5b7b3f6 test(job_spec): accept alternate messages for "append environment" tests
These tests commonly fail in Debian with

    [  ERROR   ] test/functional/core/job_spec.lua @ 81: jobs append environment with pty #env
    test/functional/helpers.lua:198:
    ==============================================================================
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (table: 0x2aa4bcc1040) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc' } } } }
    Expected:
    (table: 0x2aa4bcc0d70) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc'
           *[2] = '' } } } }

Since the test is validating the "hello world abc" message, not the
newlines, accept either set of message sequences.
2022-07-16 14:08:27 -04:00
0cfd4fa8f3 vim-patch:8.2.2643: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add a few more test. (Yegappan Lakshmanan, closes vim/vim#7995)
1f448d906b

Cherry-pick some test_edit.vim changes from patches 8.2.{1022,1432}.
Reorder test_undo.vim to match upstream.
2022-07-16 22:46:54 +08:00
780edfc0eb vim-patch:8.2.2608: character input not fully tested
Problem:    Character input not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7963)
f4fcedc59d

Cherry-pick related changes from patches 8.2.{0433,0866}.
2022-07-16 21:55:27 +08:00
bc73795a58 vim-patch:8.2.0198: no tests for y/n prompt
Problem:    No tests for y/n prompt.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5564)
43c60eda2a
2022-07-16 21:32:25 +08:00
f7c6676199 vim-patch:8.2.0052: more-prompt not properly tested
Problem:    More-prompt not properly tested.
Solution:   Add a test case. (Dominique Pelle, closes vim/vim#5404)
c6d539b671
2022-07-16 21:32:25 +08:00
711a6a9157 fix(ex_cmds): correct flags for :const (#19387) 2022-07-16 14:54:31 +08:00
fa29bc94b5 vim-patch:8.2.0593: finding a user command is not optimal (#19386)
Problem:    Finding a user command is not optimal.
Solution:   Start further down in the list of commands.
a494f56f88
2022-07-16 13:49:48 +08:00
591765c915 vim-patch:8.2.1061: insufficient testing for src/window.c (#19384)
Problem:    Insufficient testing for src/window.c.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6345)
5d3c9f8c2a

Cherry-pick test_tagjump.vim changes from patch 8.1.2373.
2022-07-16 11:34:19 +08:00
73526abbbd fix(api): do not switch win/buf if getting option in current win/buf (#19383) 2022-07-16 09:31:05 +08:00
33da7d83e8 fix(pum): make right drag in anchor grid to select work in multigrid UI (#19382) 2022-07-16 08:26:40 +08:00
86f0da922f fix: remote UI may get invalid 'pumblend' value #19379
fixes: https://github.com/neovim/neovim/issues/19340
2022-07-15 10:42:01 -07:00
f59c96903a refactor: use local api = vim.api 2022-07-15 18:26:47 +02:00
6645f59832 fix: right-click in clickable statusline #19252
Problem:
1. Right-click does not work in statusline unless you left-click first (to focus
   the statusline).
2. Modifier (e.g. shift+rightclick) does not work in statusline.

Solution:
Make clickable statusline sections receive right-clicks regardless of whether
the statusline is focused.

Closes #18994
2022-07-15 09:15:02 -07:00
8bccefcb87 refactor: use npcall from vim.F 2022-07-15 17:55:00 +02:00
5c49129c5e Merge #19324 ci: cleanup ci/ files 2022-07-15 17:42:00 +02:00
8a5c7e91f2 refactor(lsp): make the use of local aliases more consistent 2022-07-15 17:39:26 +02:00
9370e1c511 feat(lsp): hide backticks in LSP docstrings #19377
Also clear `markdownError`: don't want to highlight invalid markdown
syntax in LSP docstrings.

fix #16114
2022-07-15 08:13:16 -07:00
1c9f487f0e feat(defaults): nnoremap & :&&<CR> #19365 2022-07-15 06:23:29 -07:00
c0ae3df052 Merge pull request #19376 from zeertzjq/vim-8.2.0535
vim-patch:8.2.{0535,0542}: regexp patterns not fully tested
2022-07-15 20:45:52 +08:00
8bfcff6c4a vim-patch:8.2.0542: no test for E386
Problem:    No test for E386.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#5911)
8832a34578

Cherry-pick Test_search_errors() from patch 8.2.0448.
2022-07-15 20:23:48 +08:00
ba5ff6e5f0 vim-patch:8.2.0535: regexp patterns not fully tested
Problem:    Regexp patterns not fully tested.
Solution:   Add more regexp tests and others. (Yegappan Lakshmanan,
            closes vim/vim#5901)
4d23c52824

Add missing Test_search_cmdline8().
Cherry-pick Test_invalid_regexp() from patch 8.2.0531.
2022-07-15 20:23:48 +08:00
827906136d test: improve searchhl tests 2022-07-15 19:38:13 +08:00
b9f15caf5c Merge pull request #19375 from zeertzjq/vim-8.2.0403
vim-patch:8.1.1547,8.2.0403: when 'buftype' is "nofile" there is no overwrite check
2022-07-15 19:26:32 +08:00
0cf5cd1ac9 vim-patch:8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Problem:    When 'buftype' is "nofile" there is no overwrite check.
Solution:   Also check for existing file when 'buftype' is set.
            (closes vim/vim#5807)
a3a9c8ef69

Nvim doesn't have buftype=popup and doesn't allow buftype=terminal for
non-terminal buffer.
2022-07-15 18:27:21 +08:00
4a64cdafd6 vim-patch:8.1.1547: functionality of bt_nofile() is confusing
Problem:    Functionality of bt_nofile() is confusing.
Solution:   Split into bt_nofile() and bt_nofilename().
26910de8b0
2022-07-15 18:27:21 +08:00
564d99c89a Merge pull request #19373 from zeertzjq/vim-8.2.0426
vim-patch:8.0.1118,8.2.0426
2022-07-15 16:49:00 +08:00
a649af4dba vim-patch:8.2.0426: some errors were not tested for
Problem:    Some errors were not tested for.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5824)
9b9be007e7

Cherry-pick get_highest_fnum() from patch 8.1.1908 to make tests pass.
2022-07-15 15:21:39 +08:00
7b5b7b3cc6 vim-patch:8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
4033c55eca
2022-07-15 15:21:39 +08:00
9777907467 Merge pull request #19369 from zeertzjq/vim-8.2.0482
vim-patch:8.2.{0430,0482}: insufficient tests
2022-07-15 11:14:22 +08:00
465b73c3a5 vim-patch:8.2.0482: channel and sandbox code not sufficiently tested
Problem:    Channel and sandbox code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5855)
ca68ae1311

Cherry-pick test_clientserver.vim changes form patch 8.2.0448.
2022-07-15 10:50:21 +08:00
c821b5c695 vim-patch:8.2.0430: window creation failure not properly tested
Problem:    Window creation failure not properly tested.
Solution:   Improve the test. (Yegappan Lakshmanan, closes vim/vim#5826)
5080b0a047
2022-07-15 10:50:21 +08:00
73f96ce4c6 Merge pull request #19348 from akinsho/bugfix/winbar-winhighlight
fix(winbar): make setting WinBar and WinBarNC in 'winhighlight' work
2022-07-15 09:56:17 +08:00
8730643326 fix(winbar): make setting WinBar and WinBarNC in 'winhighlight' work 2022-07-15 09:22:57 +08:00
072fb55cb0 vim-patch:9.0.0052: "zG" may throw an error if invalid character follows (#19368)
Problem:    "zG" may throw an error if invalid character follows.
Solution:   Pass the word length to valid_spell_word(). (Ken Takata,
            closes vim/vim#10737)
2ebcc35826
2022-07-15 08:42:36 +08:00
75ad050919 fix(build): fails if git is missing #19366
Generate empty file if git is missing.
2022-07-14 15:25:28 -07:00
001f19de28 Merge pull request #19364 from zeertzjq/vim-8.2.0921
vim-patch:8.2.{0921,0926}: CTRL-W T in cmdline window causes trouble
2022-07-14 20:59:17 +08:00
8d67358d49 vim-patch:8.2.0926: cmdline test fails on Appveyor
Problem:    Cmdline test fails on Appveyor.
Solution:   Add CR to the commands. (Naruhiko Nishino, closes vim/vim#6220)
951a2fb1b8
2022-07-14 20:36:34 +08:00
08235b6f2a vim-patch:8.2.0921: CTRL-W T in cmdline window causes trouble
Problem:    CTRL-W T in cmdline window causes trouble.
Solution:   Disallow CTRL-W T in the cmdline window.  Add more tests.
            (Naruhiko Nishino, closes vim/vim#6219)
4fdb8bd054

Test already passes in Nvim because of later patches.
Move Test_cmdwin_jump_to_win() to the right place.
2022-07-14 20:34:05 +08:00
b41f2bcae7 build(deps): bump LuaJIT to HEAD - 50936d784 (#19343) 2022-07-14 12:30:46 +02:00
ddaef0618d fix(treesitter): don't error when node argument of predicate is nil (#19355)
When the node mentioned in a predicate is not required for the query
then predicates putting restrictions on that node shouldn't run.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2600
2022-07-14 12:18:03 +02:00
c6f0be116e Merge pull request #19353 from zeertzjq/vim-8.2.0369
vim-patch:8.2.{0342,0347,0369}: insufficient test coverage
2022-07-14 18:15:31 +08:00
314f1a7c21 vim-patch:8.2.0369: various Normal mode commands not fully tested
Problem:    Various Normal mode commands not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5751)
1671f44881

Cherry-pick a fix from patch 8.2.3162.
Omit test_iminsert.vim as previous patches to that file are N/A, and
Nvim doesn't support iminsert=2 either, so that test isn't useful.
2022-07-14 15:40:07 +08:00
bf96b9f11d vim-patch:8.2.0347: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add more test coverage. (Yegappan Lakshmanan, closes vim/vim#5720)
91ffc8a5f5

Test_Ex_echo_backslash() is not applicable to Vim enhanced Ex mode.
2022-07-14 15:40:07 +08:00
c467df997e vim-patch:8.2.0342: some code in ex_getln.c not covered by tests
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5717)
0546d7df13

Nvim doesn't support imsearch=2, commenting out that line is enough.
Test_Ex_append() is not applicable to Vim enhanced Ex mode.
Omit test_iminsert.vim as previous patches to that file are N/A.
2022-07-14 15:40:07 +08:00
b81d1eb265 build(deps): bump tree-sitter to HEAD - 1f1b1eb45 (#19347) 2022-07-14 09:21:02 +02:00
685d6ab6ca build(deps): bump Luv to 1.44.2-0 (#19346) 2022-07-14 09:20:47 +02:00
912dbbdd77 build: gracefully handle error in git-version #19289
- only update git-version if both of these conditions are met:
    - `git` command succeeds
    - `versiondef_git.h` would change (SHA1-diff)
- else print a status/warning message

also move version generation out of Lua into cmake.
2022-07-14 00:12:27 -07:00
b93cb481a2 feat(eval)!: input() support any type for "cancelreturn" in a dict (#19357) 2022-07-14 14:47:25 +08:00
778541067a vim-patch:8.2.0969: assert_equal() output for dicts is hard to figure out (#19317)
Problem:    Assert_equal() output for dicts is hard to figure out.
Solution:   Only show the different items.
4a021dfbee
2022-07-13 09:38:15 +08:00
c01690b1ea fix(exmode): flush messages before printing a line after pressing Enter (#19341) 2022-07-13 09:06:31 +08:00
39d51c833a vim-patch:8.2.0035: saving and restoring called_emsg is clumsy (#19335)
Problem:    Saving and restoring called_emsg is clumsy.
Solution:   Count the number of error messages.
53989554a4
2022-07-13 04:08:49 +08:00
b1e0197a14 build(deps): bump libuv to v1.44.2 (#19338) 2022-07-12 20:45:24 +02:00
d8360e9033 Merge pull request #19334 from zeertzjq/vim-8.2.0275
vim-patch:8.2.{0275,0293,5050}
2022-07-12 17:02:46 +08:00
aa373e3abb vim-patch:8.2.5050: using freed memory when searching for pattern in path
Problem:    Using freed memory when searching for pattern in path.
Solution:   Make a copy of the line.
409510c588

Cherry-pick Test_def_search() -> Test_macro_search() from patch 8.2.0369
2022-07-12 16:23:32 +08:00
4aa4675fbf vim-patch:8.2.0293: various Ex commands not sufficiently tested
Problem:    Various Ex commands not sufficiently tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5673)
818fc9ad14

Needs to assert E170 instead of E580 because patch 8.2.3486 has been
ported but patch 8.2.1183 hasn't.
2022-07-12 16:23:32 +08:00
01afd43bc9 vim-patch:8.2.0275: some Ex code not covered by tests
Problem:    Some Ex code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5659)
406cd90f19
2022-07-12 16:23:32 +08:00
0f1b17788e fix(lsp): account for initializing servers in vim.lsp.start (#19329)
Fixes #19326
2022-07-12 09:44:11 +02:00
8b75ca7345 Merge pull request #19332 from zeertzjq/vim-8.2.0270
vim-patch:8.2.{0270,2732}
2022-07-12 14:36:05 +08:00
1abdb3224b vim-patch:8.2.2732: prompt for s///c in Ex mode can be wrong
Problem:    Prompt for s///c in Ex mode can be wrong.
Solution:   Position the cursor before showing the prompt. (closes vim/vim#8073)
e5b0b98a90
2022-07-12 14:08:34 +08:00
d079995fb8 vim-patch:8.2.0270: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5649)
bc2b71d44a
2022-07-12 14:08:34 +08:00
6a670a00b3 fix(exmode): do not throttle messages when pressing enter to print line 2022-07-12 14:06:42 +08:00
540d1af90e Merge pull request #19330 from zeertzjq/vim-8.2.0203
vim-patch:8.2.0203: :helptags and some other functionality not tested
2022-07-12 12:18:10 +08:00
53392f48b1 vim-patch:8.2.0203: :helptags and some other functionality not tested
Problem:    :helptags and some other functionality not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5567)
e20b9ececa
2022-07-12 11:52:47 +08:00
189db2b759 fix(cmdline): fix passing -1 as char 2022-07-12 11:49:32 +08:00
034d28c705 fix(lsp): don't attach a client in lsp.start() if there is none (#19328)
vim.lsp.start_client() may fail (for example if the `cmd` is not
executable). It produces a nice error notification in this case. Passing
the `nil` value returned from an erroneous `vim.lsp.start_client()` call
into `vim.lsp.buf_attach_client()` causes a meaty param validate
exception message. Avoid this.
2022-07-11 19:37:01 -06:00
195d8496a0 Merge pull request #19277 from zeertzjq/vim-8.1.1855
vim-patch:8.1.{1855,1859,1864,1867}: flaky timer tests
2022-07-12 07:21:04 +08:00
cea96ca39d test(old): test_timers.vim call timer_stopall() in SetUp() instead 2022-07-12 06:58:13 +08:00
d8f6426714 vim-patch:8.1.1867: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Loop with a sleep instead of one fixed sleep.
315244d85b
2022-07-12 06:45:19 +08:00
5119d10d41 vim-patch:8.1.1864: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Adjust the sleep times.
413c04e8d5
2022-07-12 06:45:19 +08:00
061e573e7e vim-patch:8.1.1859: timer test sometimes fails on Mac
Problem:    Timer test sometimes fails on Mac.
Solution:   Show more info when it fails.
427dddf014
2022-07-12 06:45:19 +08:00
9bea841925 vim-patch:8.1.1855: another failing timer test
Problem:    Another failing timer test.
Solution:   Assert that timers are finished by the end of the test.  Rename
            test functions to make them easier to find.
9a2fddcf04

Use test_garbagecollect_now() in Test_timer_retain_partial() like Vim.
2022-07-12 06:45:19 +08:00
daa49b525e Merge pull request #19320 from zeertzjq/vim-8.2.0212
vim-patch:8.2.{0212,0243,0250}: insufficient tests
2022-07-12 06:24:29 +08:00
27fd17a79c vim-patch:8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5618)
9f6277bdde

Cherry-pick Test_window_only() from patch 8.2.0203.
Cherry-pick a memory leak fix from patch 8.2.0399.
2022-07-12 05:36:33 +08:00
eea6a4f2a0 vim-patch:8.2.{0212,0250}
vim-patch:8.2.0212: missing search/substitute pattern hardly tested

Problem:    Missing search/substitute pattern hardly tested.
Solution:   Add test_clear_search_pat() and tests. (Yegappan Lakshmanan,
            closes vim/vim#5579)
07ada5ff2f

vim-patch:8.2.0250: test_clear_search_pat() is unused

Problem:    test_clear_search_pat() is unused.
Solution:   Remove the function. (Yegappan Lakshmanan, closes vim/vim#5624)
4f5776c17c
2022-07-12 05:36:33 +08:00
e71cc4a8dc test(old): align defaults to Vim before each test instead 2022-07-12 05:36:33 +08:00
d77ec8a5c6 ci: remove unnecessary file ci/script.sh
It only runs run_tests.sh and checks coverage, which can be replaced by
just moving the coverage check to ci/run_tests.sh.
2022-07-11 17:16:55 +02:00
bb1a464467 ci: remove unnecessary file run_lint.sh
It's a leftover artifact that currently just acts as an unnecessary
intermediary script that calls the Makefile. It can be replaced by just
calling the Makefile directly.
2022-07-11 16:41:06 +02:00
5c3bbb67e7 vim-patch:8.2.3363: when :edit reuses the current buffer the alternate file is set (#19306)
Problem:    When :edit reuses the current buffer the alternate file is set to
            the same buffer.
Solution:   Only set the alternate file when not reusing the buffer.
            (closes vim/vim#8783)
b8bd2e6eba

Cherry-pick Test_cmdline_expand_special() from patches 8.2.{0243,2873}.
Move Test_cmd_backtick() to the right place.
2022-07-11 20:55:26 +08:00
ac10c0f418 fix(lsp): abort pending changes after flush when debouncing (#19314)
Issuing a server request triggers `changetracking.flush` so as to
make sure we're not operating on a stale state. This immediately
triggers notification of any pending changes (as a result of debouncing)
to the server. However, this happens in addition to the notification
that is waiting on the debounce delay. Because we `nil`
`buf_state.pending_change` when it is called, the fix is to
also check that this is non-`nil` when it is called and exit if it is,
as this being `nil` would mean that it originates from a pending change
that has already been flushed out.
2022-07-11 12:48:02 +02:00
95c65a6b22 feat(lsp): defaults: tagfunc, omnifunc (#19003)
set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server
2022-07-10 17:26:43 +02:00
67b26a39f0 Merge pull request #19305 from zeertzjq/vim-8.2.3530
vim-patch:8.2.{3530,3531}: ":buf \{a}" fails while ":edit \{a}" works
2022-07-10 20:20:06 +08:00
5e53740350 Merge pull request #18774 from zeertzjq/float-height-width-fix
Fix some floating window height and width bugs
2022-07-10 17:59:32 +08:00
5105f713bd test(float_spec): make indent more consistent 2022-07-10 17:24:29 +08:00
63f6ecd419 fix(float): fix mouse drag position if float window turned to a split 2022-07-10 17:24:29 +08:00
63f63dd2b7 fix(float): fix glitch when making float window with border a split 2022-07-10 17:24:29 +08:00
99e8298711 fix(float): fix float window with winbar cannot have screen height 2022-07-10 17:24:29 +08:00
f7d6f472f7 fix(float): fix float window border drawing with winbar 2022-07-10 17:24:29 +08:00
2966cfe21f fix(lsp): pcall nvim_del_augroup_by_name (#19302)
fixup for #19283
2022-07-10 11:19:26 +02:00
3d77ea2762 Merge pull request #19307 from zeertzjq/vim-8.2.1053
vim-patch:7.4.1724,8.2.1053: insufficient testing for 'statusline' and 'tabline'
2022-07-10 17:13:17 +08:00
fe2b281292 vim-patch:8.2.1053: insufficient testing for 'statusline' and 'tabline'
Problem:    Insufficient testing for 'statusline' and 'tabline'.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6333)
832adf9bb8
2022-07-10 16:15:17 +08:00
59355653f6 vim-patch:7.4.1724
Problem:    Tabline test fails in GUI.
Solution:   Remove 'e' from 'guioptions'.
73cd8fb3e8

Add missing file header.
2022-07-10 16:12:58 +08:00
8f36e538cc fix(l10n): add folded line indicator translations from vim (#19286) 2022-07-10 12:36:43 +08:00
b3b85186ed vim-patch:8.2.3531: command line completion test fails on MS-Windows
Problem:    Command line completion test fails on MS-Windows.
Solution:   Do not test with "\{" on MS-Windows.
39c47c3104
2022-07-10 10:58:12 +08:00
45d2644205 vim-patch:8.2.3530: ":buf \{a}" fails while ":edit \{a}" works
Problem:    ":buf \{a}" fails while ":edit \{a}" works.
Solution:   Unescape "\{". (closes vim/vim#8917)
21c1a0c2f1
2022-07-10 10:56:37 +08:00
d606c39a9c vim-patch:9.0.0049: csv and tsv files are not recognized (#19300)
Problem:    Csv and tsv files are not recognized.
Solution:   Add patterns fo csv and tsv files. (Leandro Lourenci,
            closes vim/vim#10680)
99af91e582
2022-07-10 01:14:07 +02:00
eb9155e557 Merge #19267 require() in --startuptime 2022-07-10 01:04:11 +02:00
880de9a489 test(old): align defaults to Vim after every test (#19301)
This can avoid divergences from Vim in some small places.
2022-07-10 06:59:58 +08:00
797007997c test: --startuptime 2022-07-09 15:45:02 -07:00
d6a1e71881 vim-patch:8.1.1038: Arabic support excludes Farsi (#19285)
Problem:    Arabic support excludes Farsi.
Solution:   Add Farsi support to the Arabic support. (Ali Gholami Rudi,
            Ameretat Reith)
dc4fa190e7

Omit Test_shape_final_to_medial(): removed in later patches.
2022-07-10 06:01:49 +08:00
2c739431e8 feat(lua): measure require in --startuptime 2022-07-09 22:12:06 +02:00
782f726136 refactor: remove functions marked for deprecation in 0.8 (#19299) 2022-07-09 18:42:49 +02:00
6b1a8f23d7 refactor(lua): replace vim.cmd use with API calls (#19283)
Signed-off-by: Raphael <glephunter@gmail.com>
2022-07-09 18:40:32 +02:00
7dbe6b1a46 Merge pull request #19296 from zeertzjq/vim-8.2.2902
vim-patch:8.2.{2902,2917}: spellfile functionality not fully tested
2022-07-09 20:59:49 +08:00
7b72e61cf8 vim-patch:8.2.2917: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for SFX with removal of characters, spelling
            suggestions with NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8293)
bb162367ac
2022-07-09 20:33:00 +08:00
eb60a9be97 vim-patch:8.2.2902: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for CIRCUMFIX, NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8283)
5a6cfb3ff2

Reorder test_spellfile.vim to match upstream.
2022-07-09 20:33:00 +08:00
022e994ab8 Merge pull request #19294 from zeertzjq/vim-8.2.0332
vim-patch:8.2.{0332,0396}: insufficient tests for cmdline
2022-07-09 18:34:48 +08:00
65359e5657 vim-patch:8.2.0396: cmdexpand.c insufficiently tested
Problem:    Cmdexpand.c insufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5789)
24ebd83e03

Map Q to gQ before every test since a test uses :mapclear.
2022-07-09 17:33:49 +08:00
12f0ef669d vim-patch:8.2.0332: some code in ex_getln.c not covered by tests
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5710)
d30ae2fc4a
2022-07-09 16:31:19 +08:00
798acbca1b Merge pull request #19284 from zeertzjq/vim-8.2.0274
vim-patch:8.2.{0274,0325}
2022-07-09 16:25:16 +08:00
cf4aa6095f vim-patch:8.2.0325: ex_getln.c code not covered by tests
Problem:    Ex_getln.c code not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5702)
578fe947e3

Cherry-pick Test_Ex_global() from patch 8.2.0293.
Test_rightleftcmd() fails if incsearch is enabled, so disable it.
2022-07-08 23:11:12 +08:00
0d0a6aff6b vim-patch:8.2.0274: hang with combination of feedkeys(), Ex mode and :global
Problem:    Hang with combination of feedkeys(), Ex mode and :global.
            (Yegappan Lakshmanan)
Solution:   Add the pending_exmode_active flag.
9e2bcb5d23
2022-07-08 23:11:12 +08:00
45ba2e147f fix(tui): add fixups for hterm family #19078
Problem
-------

In #19040, I reported two things that started happening somewhen in the
last three months when using neovim in hterm (the Chrome Secure Shell
terminal):

 1. Under certain circumstances, the window title (set by nvim
    [i0]) would appear over the line I was typing, corrupting the screen.
 2. If I changed my $TERM from xterm-256color to the new hterm-256color
    (available since ncurses >=20210320), the window title corruption
    was gone, but pane scrolling was broken.

Both problems are due to changes in the termcap files, their source of
truth being the ncurses project. See "Timeline of ncurses changes" below
for details.

Cause: title corruption
-----------------------

The title corruption when using hterm + TERM=xterm-256color can be
explained by event #4 (ncurses 2022-03-12) in the ncurses timeline:

The xterm-256color termcap file gained status line termcodes in ncurses
2022-03-12. These termcodes are used by Neovim to set the title when.
hterm does not have a status line. Due to ncurses versions earlier than
2022-03-12 missing the xterm status line capability, Neovim manually
fixed up [t0] the terminfo file if $TERM was xterm-256color. So if
before Neovim manually added fsl/tsl capabilties, and after they were
in the termcap file, why did hterm suddenly start getting corruption?
The answer is that the termcodes for these capabilties are different
when Neovim fixes them up, versus the one in the new termcap database:

   fsl=\E[0$}                  // from xterm-256color
   tsl=\E[2$~\E[1$}\E[%i%p1%d` // from xterm-256color

   fsl=\x07                    // patched by Neovim
   tsl=\x1b]0;                 // patched by Neovim

hterm ignores the latter, but corrupts the screen with the former.

Solution: Make hterm users set hterm-256color, which lacks the new
fsl/tsl codes. Also, to reduce superfluous work, stop patching in this
capability when hterm is detected (even if hterm would ignore the
patched version).

Cause: pane corruption
----------------------

The pane corruption when using hterm + TERM=hterm-256color, but NOT when
using hterm + TERM=xterm-256color can be explained by:

 - Neovim uses DECSLRM when available [p1] for performant scrolling.
 - Both the hterm-256color and xterm-256color termcap databases
   advertise support for DECSLRM (ncurses timeline #1, #2 and #3).
 - hterm does not support DESCLRM [p2] (note: it does support DESCTBM for
   top/bottom scrolling, but it's broken [p3] and not used by Neovim)
 - xterm-alikes that are not real xterm generally don't support DECSLRM
   either, so Neovim patches it out [p4].

When using hterm-256color, hterm is no longer considered an xterm-alike
by Neovim. As a result, DECSLRM is not cleared. hterm does not support
it, so corruption ensues.

This is a problem with the hterm-256color termcap file, but we're stuck
with it so the best we can do is patch over it.

Timeline of ncurses changes
---------------------------

 1. 2019-05-19: Part of the DECSLRM capability (smglr AKA set_lr_margin)
    added to vt420+lrmm, which xterm-256color inherits [n1]
 2. 2021-03-20: hterm-256color added, inheriting xterm-256colors. [n2]
 3. 2021-09-25: The *parm versions of smglr (AKA set_lr_margin) were
    added to vt420+lrmm [n3]. Namely:
     1. smglp AKA set_left_margin_parm, and
     2. smgrp AKA set_right_margin_parm
 4. 2022-03-12: (new) codes for fsl, bsl and tsl added to xterm (add
    dec+sl to xterm-new, per patch #371 -TD) [n4]

Fixes #19040.

[i0]: 3a4fa22bad/src/nvim/tui/tui.c (L1377)
[t0]: 3a4fa22bad/src/nvim/tui/tui.c (L1728),L1729
[p1]: 3a4fa22bad/src/nvim/tui/tui.c (L1196)
[p2]: https://bugs.chromium.org/p/chromium/issues/detail?id=1175065&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1298796&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p4]: 3a4fa22bad/src/nvim/tui/tui.c (L1740-L1752)
[n1]: https://github.com/mirror/ncurses/commit/8f6d94b8d6211a2323caef53fa4c96c475ec9a6#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2742
[n2]: c2650100f8 (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R5907)
[n3]: f6b436c4fb (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2842)
[n4]: 8bf8c836fe (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R4828)

Signed-off-by: Nicolas Hillegeer <nicolas@hillegeer.com>
2022-07-08 06:06:27 -07:00
b999de2eb0 Merge pull request #19278 from zeertzjq/vim-8.2.0132
vim-patch:8.2.{0132,0136,0151}: detecting a script was already sourced is unreliable
2022-07-08 20:12:58 +08:00
a6803f3adf test: add a test for what Vim patch 8.2.0151 fixes 2022-07-08 14:18:16 +08:00
159a0b651f vim-patch:8.2.0151: detecting a script was already sourced is unreliable
Problem:    Detecting a script was already sourced is unreliable.
Solution:   Do not use the inode number.
978d170bdc
2022-07-08 14:17:22 +08:00
eafa09de7d vim-patch:8.2.0136: stray ch_logfile() call
Problem:    Stray ch_logfile() call.
Solution:   Remove it. (closes vim/vim#5503)
ed5adff1e6
2022-07-08 11:11:22 +08:00
a890c019a3 vim-patch:8.2.0132: script may be re-used when deleting and creating a new one
Problem:    Script may be re-used when deleting and creating a new one.
Solution:   When the inode matches, also check the file name.
ca33eb256e
2022-07-08 11:11:22 +08:00
ca64b589cd vim-patch:8.1.{1524,1544}: tests are silently skipped (#19276)
This is a port of these two patches combined:

vim-patch:8.1.1524: tests are silently skipped

Problem:    Tests are silently skipped.
Solution:   Throw an exception for skipped tests in more places.
b0f94c1ff3

vim-patch:8.1.1544: some balloon tests don't run when they can

Problem:    Some balloon tests don't run when they can.
Solution:   Split GUI balloon tests off into a separate file. (Ozaki Kiichi,
            closes vim/vim#4538)  Change the feature check into a command for
            consistency.
b46fecd345

Omit test_lua.vim: previous patches are N/A
Omit test_memory_usage.vim: previous patches are N/A
Omit test_textprop.vim: previous patches are N/A
Omit test_winbar.vim: previous patches are N/A
Omit test_termcodes.vim: mostly N/A
Skip Test_mouse_positon() because it uses test_setmouse().
Cannot throw error in a Test_nocatch_ test.
Use latest `CheckFeature clipboard_working` for test_quotestar.vim
2022-07-08 08:26:25 +08:00
72877bb17d feat(runtime)!: enable filetype.lua by default (#19216)
* revert to filetype.vim by setting `g:do_legacy_filetype`
* skip either filetype.lua or filetype.vim via `g:did_load_filetypes`

(Running both is no longer required and therefore no longer supported.)
2022-07-07 18:53:47 +02:00
0950275b8c refactor(lua): git-blame-ignore stylua update PR (#19273)
https://github.com/neovim/neovim/pull/19264
2022-07-07 18:32:53 +02:00
aa4f9c5341 refactor(lua): reformat with stylua 0.14.0 (#19264)
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
2022-07-07 18:27:18 +02:00
34d41baf8a feat(tui): try terminfo for [re]set_cursor_color OSC #19255 2022-07-07 02:09:11 -07:00
55e81b0fe8 vim-patch:5ed11535e069 (#19256)
Update runtime files
5ed11535e0
2022-07-07 08:15:33 +02:00
6b72ee1f15 Merge pull request #19263 from zeertzjq/vim-8.2.3674
vim-patch:8.2.{3674,4399}: problems after ml_get error
2022-07-07 08:35:29 +08:00
8ce60ddd07 vim-patch:8.2.4399: crash after ml_get error
Problem:    Crash after ml_get error.
Solution:   When returning "???" flush the line and set ml_line_lnum.
f9435e49ef
2022-07-07 08:10:53 +08:00
4bb01262ca vim-patch:8.2.3674: when ml_get_buf() fails it messes up IObuff
Problem:    When ml_get_buf() fails it messes up IObuff.
Solution:   Return a local pointer. (closes vim/vim#9214)
96e7a5928e
2022-07-07 08:10:00 +08:00
4cded8cec1 Merge pull request #19180 from zeertzjq/tui-kitty-keypad
feat(tui): recognize keypad keys when using kitty keyboard protocol
2022-07-07 07:42:22 +08:00
5e84db5c90 Merge pull request #19261 from zeertzjq/vim-8.2.5023
vim-patch:8.2.{5023,5043,5044}: substitute textlock fixes
2022-07-07 07:21:50 +08:00
d4db87f493 vim-patch:8.2.5044: command line test fails
Problem:    Command line test fails.
Solution:   Also beep when cmdline win can't be opened because of locks.
            Make the test not beep.  Make the test pass on MS-Windows.
be99042b03
2022-07-07 07:00:11 +08:00
0612101c92 vim-patch:8.2.5043: can open a cmdline window from a substitute expression
Problem:    Can open a cmdline window from a substitute expression.
Solution:   Disallow opening a command line window when text or buffer is
            locked.
71223e2db8
2022-07-07 07:00:11 +08:00
df4c634d06 vim-patch:8.2.5023: substitute overwrites allocated buffer
Problem:    Substitute overwrites allocated buffer.
Solution:   Disallow undo when in a substitute command.
338f1fc0ee
2022-07-07 07:00:11 +08:00
4ffe5d0189 vim-patch:8.2.5063: error for a command may go over the end of IObuff (#19260)
Problem:    Error for a command may go over the end of IObuff.
Solution:   Truncate the message.
44a3f3353e
2022-07-07 06:37:54 +08:00
664efa497e vim-patch:8.2.0614: get ml_get error when deleting a line in 'completefunc' (#19244)
Problem:    Get ml_get error when deleting a line in 'completefunc'. (Yegappan
            Lakshmanan)
Solution:   Lock the text while evaluating 'completefunc'.
ff06f283e3

Fix a mistake in the porting of patch 8.1.0098.
Cherry-pick Test_run_excmd_with_text_locked() from patch 8.2.0270.
Cherry-pick test_gf.vim changes from patch 8.2.0369.
Cherry-pick message change from later patches.
2022-07-07 04:47:18 +08:00
1e03255646 Merge pull request #19218 from smjonas/fix_ft_patterns
fix(filetype): fix filetype patterns
fix(filetype): remove call to vim.fn.resolve and pass filename to match function
2022-07-06 16:57:44 +02:00
f9683f2823 fix(filetype): remove call to vim.fn.resolve and pass filename to match function
For example on MacOS, /etc/hostname.file is symlinked to
/private/etc/hostname.file. We only care about the original file path though.
2022-07-06 16:25:51 +02:00
f3c78a4465 fix(filetype): fix filetype patterns 2022-07-06 16:25:23 +02:00
c84ae5706f Merge pull request #19247 from zeertzjq/vim-8.2.4165
vim-patch:7.4.212,8.2.{4165,4221}: some functions in normal.c are too long
2022-07-06 20:44:41 +08:00
1a490a5bc5 fix(normal): fix segfault with bracket command jumping to a mark
vim-patch:9.0.0043: insufficient testing for bracket commands

Problem:    Insufficient testing for bracket commands.
Solution:   Add a few more tests. (closes vim/vim#10668)
cf34434b5e

Cherry-pick a change from patch 8.2.0369.
2022-07-06 20:01:01 +08:00
8e03d42ec8 vim-patch:8.2.4221: some functions in normal.c are very long
Problem:    Some functions in normal.c are very long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#9628)
a827bf3ea8
2022-07-06 19:58:44 +08:00
ff111b615a vim-patch:8.2.4165: the nv_g_cmd() function is too long
Problem:    The nv_g_cmd() function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#9576)
05386ca1d4
2022-07-06 19:58:44 +08:00
1b5f53ca95 vim-patch:7.4.212
Problem:    Now that the +visual feature is always enabled the #ifdefs for it
            are not useful.
Solution:   Remove the checks for FEAT_VISUAL.
f7ff6e85e8
2022-07-06 19:58:44 +08:00
Jay
93c8fe77cb feat: add 'mousescroll' option (#12355)
Add 'mousescroll' option to control how many lines to scroll by when a
mouse wheel keycode is received. The mousescroll option controls both
horizontal and vertical scrolling. The option is a string in the format:

    set mousescroll=direction:count,direction:count

Where direction is either "ver" or "hor", and count is a non negative
integer. If a direction is omitted, a default value is used. The default
values remain unchanged, that is 3 for vertical scrolling, and 6 for
horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6".

Add mousescroll documentation
 - Add option documentation in options.txt
 - Add brief summary in quickref.txt

Update :help scroll-mouse-wheel
 - Mention mousescroll option as a means of controlling scrolling.
 - Remove obsolete suggestion to map scroll wheel keys to <C-U> to
   scroll by a single line -- users should prefer the mousescroll option.
 - Add some information about the consequences of remapping scroll wheel
   keys (they lose their magic ability to affect inactive windows).

Update :help vim-differences
 - Add brief mousescroll summary under Options

Add mousescroll tests
 - Test option validation
 - Test default mousescroll value and behavior
 - Test fallback to default values
 - Test mouse vertical and horizontal scrolling in normal mode
 - Test mouse vertical and horizontal scrolling in insert mode
2022-07-06 19:34:24 +08:00
9ced054134 fix(mark): fix unexpected cursor movements (#19253) 2022-07-06 19:01:44 +08:00
c68f1d7263 Merge pull request #19242 from smjonas/vim-9.0.0042
vim-patch:9.0.{0041,0042}: filetype patterns
2022-07-06 08:14:08 +02:00
606af7887b vim-patch:8.2.5162: reading before the start of the line with BS in Replace mode (#19241)
Problem:    Reading before the start of the line with BS in Replace mode.
Solution:   Check the cursor column is more than zero.
0971c7a4e5
2022-07-06 07:36:36 +08:00
78300a1587 vim-patch:9.0.0042: missing change for filetype detection
Problem:    Missing change for filetype detection.
Solution:   Include change to detect guile from shebang line.
3244780379
2022-07-06 01:33:45 +02:00
8b7399782e vim-patch:9.0.0041: a couple of filetype patterns do not have "*" before "/etc"
Problem:    A couple of filetype patterns do not have "*" before "/etc".
Solution:   Add the star. (Jonas Strittmatter, closes vim/vim#10662)
704988f0c3
2022-07-06 01:25:21 +02:00
41785b1b0c Merge pull request #19223 from lewis6991/ghaction
build: add github action annotations for clint
2022-07-05 09:53:41 -04:00
a4801b8034 vim-patch:8.0.1562: the terminal debugger can't set a breakpoint with the mouse (#19234)
Problem:    The terminal debugger can't set a breakpoint with the mouse.
Solution:   Add popup menu entries.
71137fed4d

This ports missing popup menu code to termdebug plugin.
Despite the commit message, the code is copied from latest Vim.
WinBar code is commented out and WinBar docs is not ported.
2022-07-05 20:57:01 +08:00
2536bde6c9 Merge pull request #19232 from zeertzjq/vim-8.2.2904
vim-patch:8.2.{2904,3644.3980,3990}: three Normal mode fixes
2022-07-05 18:48:26 +08:00
785422ad54 vim-patch:8.2.3990: testing wrong operator
Problem:    Testing wrong operator.
Solution:   Test "g@" instead of "r_". (Naohiro Ono, closes vim/vim#9463)
5c75eed758
2022-07-05 17:32:42 +08:00
5fcf701ba1 vim-patch:8.2.3980: if 'operatorfunc' invokes an operator Visual mode is changed
Problem:    If 'operatorfunc' invokes an operator the remembered Visual mode
            may be changed. (Naohiro Ono)
Solution:   Save and restore the information for redoing the Visual area.
            (closes vim/vim#9455)
b3bd1d39e6
2022-07-05 17:32:42 +08:00
dd5fce2f5d vim-patch:8.2.3644: count for 'operatorfunc' in Visual mode is not redone
Problem:    Count for 'operatorfunc' in Visual mode is not redone.
Solution:   Add the count to the redo buffer. (closes vim/vim#9174)
2228cd72cf

Cherry-pick a line from patch 8.2.0522.
2022-07-05 17:32:42 +08:00
f42657cbcf vim-patch:8.2.2904: "g$" causes scroll if half a double width char is visible
Problem:    "g$" causes scroll if half a double width char is visible.
Solution:   Advance to the last fully visible character. (closes vim/vim#8254)
74ede80aeb
2022-07-05 17:32:42 +08:00
d0835617fa fix(terminal): crash if TermClose deletes own buffer #19222
- Partially fixes #10386 except for the case where the alternate buffer
  is the default, empty, first buffer created on startup. #vimlife
- TODO: port patches related to `can_unload_buffer`, maybe that fully
  fixes #10386?

vim-patch:8.0.1732: crash when terminal API call deletes the buffer
2022-07-05 02:31:49 -07:00
eb814bdca0 Merge pull request #19231 from zeertzjq/vim-8.2.3615
vim-patch:8.2.{3615,3754,5122}: indent fixes
2022-07-05 15:39:50 +08:00
d9e5737fdc vim-patch:8.2.5122: lisp indenting my run over the end of the line
Problem:    Lisp indenting my run over the end of the line.
Solution:   Check for NUL earlier.
0e8e938d49
2022-07-05 15:10:46 +08:00
04ba37773e vim-patch:8.2.3754: undesired changing of the indent of the first formatted line
Problem:    Undesired changing of the indent of the first formatted line.
Solution:   Do not indent the first formatted line.
ecabb51107
2022-07-05 15:08:41 +08:00
42863634dd vim-patch:8.2.3615: wrong indent in first line if re-formatting with indent expr
Problem:    When re-formatting with an indent expression the first line of a
            paragraph may get the wrong indent. (Martin F. Krafft)
Solution:   Apply the correct indenting function for the first line.
            (Christian Brabandt, closes vim/vim#9150, closes vim/vim#9056)
818ff25cd1
2022-07-05 15:04:37 +08:00
6e2d23ac43 Merge pull request #19229 from zeertzjq/vim-8.2.0363
vim-patch:8.2.{0363,0416}: some Normal mode commands not tested
2022-07-05 14:57:48 +08:00
24db6c1e57 vim-patch:8.2.0416: test leaves file behind
Problem:    Test leaves file behind.
Solution:   Delete the file.
95e59a355b
2022-07-05 14:33:36 +08:00
a01905eb35 vim-patch:8.2.0363: some Normal mode commands not tested
Problem:    Some Normal mode commands not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5746)
f5f1e10d0d

Omit Test_edit_forbidden(): change reverted in patch 8.2.0369.
Cherry-pick Test_normal_yank_with_excmd() from patch 8.2.0293.
Skip Test_normal_cursorhold_with_count().
Cherry-pick Test_star_register() from patch 8.2.0270.
2022-07-05 14:22:58 +08:00
936c11f9c8 test(old): use Q -> gQ mapping instead of changing test when possible 2022-07-05 13:54:11 +08:00
d07a39c54b vim-patch:9.0.0035: spell dump may go beyond end of an array (#19228)
Problem:    Spell dump may go beyond end of an array.
Solution:   Limit the word length.
54e5fed6d2
2022-07-05 06:47:58 +08:00
826fe56f5c fix(mark): mark without a view restores at topline #19224
For a local mark without a view, currently trying to restore its view
will put the cursor at topline, which is not the correct behavior.
Initialize `topline_offset` to `MAXLNUM` instead to fix this.
2022-07-04 13:28:14 -07:00
1803b0ffd7 fix(tui): resize at startup #17795
* fix(test): screen.lua nil index
  When actual_rows and expected_rows are different avoid a nil index.
* fix(tui): resize at startup
  The deleted code is not needed after 402b4e8.
  It caused the condition to false positive when the function was called
  more than once before startup (first normal mode). Being itself what
  set the dimension and not the user, locking the size of the screen to
  an incorrect size.
  Make got_winch an int to mitigate: tui_grid_resize changing the size
  of the host terminal between the signal handler and the call to
  sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't
  directly call the callback, the event loop does.

Fixes #17285
Fixes #15044
Fixes #11330
2022-07-04 13:09:47 -07:00
03c9cf3feb test: add tests for keypad keys from kitty keyboard protocol 2022-07-04 22:37:45 +08:00
5b609bbefb build: add github action annotations for clint 2022-07-04 14:20:10 +01:00
33ed85a2f6 feat(tui): recognize keypad keys when using kitty keyboard protocol 2022-07-04 21:09:33 +08:00
ab5929e1b0 Merge pull request #19221 from zeertzjq/vim-8.2.1808
vim-patch:8.2.{1808,5098},9.0.0034
2022-07-04 18:59:27 +08:00
a4160dd105 vim-patch:9.0.0034: spell tests do not always clear the word list
Problem:    Spell tests do not always clear the word list.
Solution:   Clear the word list in TearDown(). (closes vim/vim#10659)
288ed23e39
2022-07-04 18:38:39 +08:00
08aba02ad7 vim-patch:8.2.5098: spelldump test sometimes hangs
Problem:    Spelldump test sometimes hangs.
Solution:   Catch the problem of the spell file not being found to avoid
            hanging in the download dialog.
fc9f0fd6d1
2022-07-04 18:37:46 +08:00
d9c63507f8 vim-patch:8.2.1808: no test coverage for ":spelldump!"
Problem:    No test coverage for ":spelldump!".
Solution:   Add a test. (Dominique Pellé, closes vim/vim#7089)
f12f0022e6
2022-07-04 18:37:36 +08:00
436747752b refactor: remove unnecessary volatile #19210
libuv does not call callback functions(uv_signal_cb) directly from signal
handlers. Therefore, there is no need to use volatile.

Ref. 1a91b51976/src/unix/signal.c (L183)
2022-07-04 03:28:59 -07:00
f075feee32 Merge pull request #19220 from zeertzjq/vim-8.2.1470
vim-patch:8.2.{1470,1493,1522,1523,1770,5072,5074}: spell patches
2022-07-04 11:13:19 +08:00
6b474d0237 vim-patch:8.2.5074: spell test fails on MS-Windows
Problem:    Spell test fails on MS-Windows.
Solution:   Do not change 'encoding'
ad73cc2ff2
2022-07-04 10:02:35 +08:00
a4215a0a21 vim-patch:8.2.5072: using uninitialized value and freed memory in spell command
Problem:    Using uninitialized value and freed memory in spell command.
Solution:   Initialize "attr".  Check for empty line early.
2813f38e02
2022-07-04 10:02:35 +08:00
1ff86aa634 vim-patch:8.2.1770: invalid memory use when using SpellFileMissing autocmd
Problem:    Invalid memory use when using SpellFileMissing autocmd.
Solution:   Add test case. (Dominique Pellé, closes vim/vim#7036)  Fix using a window
            that was closed.
d569a9e746

Skip an assert because of #3027.
2022-07-04 09:37:45 +08:00
7648a8524c vim-patch:8.2.1523: still not enough test coverage for the spell file handling
Problem:    Still not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6790)
b9fc192f92
2022-07-04 09:18:35 +08:00
a2d8d5e1f5 vim-patch:8.2.1522: not enough test coverage for the spell file handling
Problem:    Not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6763)
c8ec5fe56f

Add missing whitespace in message.
2022-07-04 09:15:03 +08:00
ed64c8f683 vim-patch:8.2.1493: not enough test coverage for the spell file handling
Problem:    Not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6728)
fc2a47ffc4
2022-07-04 09:09:42 +08:00
acb6512f2e vim-patch:8.2.1470: errors in spell file not tested
Problem:    Errors in spell file not tested.
Solution:   Add test for spell file errors. (Yegappan Lakshmanan,
            closes vim/vim#6721)
c0f8823ee4
2022-07-04 09:06:01 +08:00
acb7a90281 refactor(runtime): port scripts.vim to lua (#18710) 2022-07-03 15:31:56 +02:00
0313aba77a vim-patch:9.0.0031: <mods> of user command does not have correct verbose value (#19215)
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value

Problem:    <mods> of user command does not have correct verbose value.
Solution:   Use the value from the command modifier. (closes vim/vim#10651)
9359e8a6d9
2022-07-03 21:17:03 +08:00
e837f29ce6 Merge pull request #19212 from zeertzjq/vim-9.0.0024
vim-patch:9.0.{0024,0030}
2022-07-03 06:43:16 +08:00
357d63f5d7 vim-patch:9.0.0030: matchfuzzy test depends on path of current directory
Problem:    Matchfuzzy test depends on path of current directory.
Solution:   Use fnamemodify() to remove the path. (Robin Becker,
            closes vim/vim#10650)
22e7e867e2
2022-07-03 06:21:05 +08:00
312f1b65c8 vim-patch:9.0.0024: may access part of typeahead buf that isn't filled
Problem:    May access part of typeahead buf that isn't filled.
Solution:   Check length of typeahead.
af043e12d9
2022-07-03 06:21:05 +08:00
2b04aaad94 build: drop -Wsuggest #19177
Disable -Wsuggest compile flags by default.

Although the flags are useful to see what the compiler thinks we can
improve on, it adds a lot of noise to the build output. That makes it
harder to spot actual issues that may be flagged.

Closes https://github.com/neovim/neovim/issues/19160
2022-07-02 14:47:22 -07:00
c6c89391b7 Merge pull request #19205 from bfredl/luaerr
fix(lua): don't leak memory on error
2022-07-02 23:44:26 +02:00
8d37901f1c Merge pull request #19203 from zeertzjq/api-cmd-unsilent
feat(api): add `unsilent` to command APIs
2022-07-03 05:00:02 +08:00
7a907c3314 feat(api): add unsilent to command APIs 2022-07-03 04:34:28 +08:00
f93eb169f6 vim-patch:8.2.1900: Vim9: command modifiers do not work
Problem:    Vim9: command modifiers do not work.
Solution:   Make most command modifiers work.
02194d2bd5
2022-07-03 04:34:28 +08:00
0160ff6aa0 fix(lua): don't leak memory on error 2022-07-02 20:10:32 +02:00
108368bdd5 fix(coverity): 353827 unnecessary null check #19209
Previous checks make sure the index is not out of bounds. Therefore jmp
is never NULL.
2022-07-02 09:24:58 -07:00
e11f3655fb fix(jobs): deadlock in channel.c:exit_event #19082
In the rare case that exit_event is called from process_close_handles,
it stalls waiting for the process to exit (the routine is currently
underway to do just that). This causes `job_spec.lua` to sometimes
stall.

REJECTED IDEAS:
==============================================================
1. Currently `exit_event` is placed on `main_loop.fast_events`. Would the problem
   be solved by using `main_loop.events` instead?
    - A: Maybe, but it will cause other problems, such as queuing exit_event()
      during "Press Enter..." prompt which may result in the event not being
      processed, leading to another stall.
2. Can we avoid the timer?
    - A: Using a timer is just the easiest way to queue a delayed event without
      causing an infinite loop in the queue currently being processed.
3. Can we avoid the new `exit_need_delay` global...
    1. by using `process_is_tearing_down` instead?
        - A: Can't use `process_is_tearing_down` because its semantics are different.
    2. by checking a similar condition as `process_teardown`? f50135a32e/src/nvim/event/process.c (L141-L142)
       ```
       if (!process_is_tearing_down || (kl_empty(main_loop.children) && multiqueue_empty(main_loop.events))) {
         uv_timer_start(&main_loop.exit_delay_timer, exit_delay_cb, 0, 0);
         return;
       }
       ```
        - A: Tried but it did not work (other stalls occurred). Maybe
          exit_event() is called from a source other than
          process_close_handles() and is delayed, the delayed exit_event() will
          be executed before main_loop.events is processed, resulting in an
          infinite loop.
2022-07-02 09:14:08 -07:00
c1b591dc8f Merge pull request #19137 from dundargoc/refactor/char_u-to-char
refactor: replace char_u
2022-07-02 17:13:25 +02:00
3b8804571c refactor: replace char_u
Work on https://github.com/neovim/neovim/issues/459
2022-07-02 16:01:27 +02:00
ed429c00d7 refactor(fold): style #19175
* refactor(fold): update comment formatting
* refactor(fold): use post-increment/decrement
* refactor(fold): reduce scope of local variables
* refactor(fold): use booleans
2022-07-02 04:29:27 -07:00
662681694b vim-patch:0d878b95d8f9 (#19197)
Update runtime files
0d878b95d8
2022-07-02 11:06:03 +02:00
a9de89894a Merge pull request #19202 from zeertzjq/vim-8.2.0316
vim-patch:8.2.{0261,0316}: insufficient test coverage
2022-07-02 12:25:07 +08:00
7277543772 vim-patch:8.2.0316: ex_getln.c code has insufficient test coverage
Problem:    ex_getln.c code has insufficient test coverage.
Solution:   Add more tests. Fix a problem. (Yegappan Lakshmanan, closes vim/vim#5693)
8d588ccee5
2022-07-02 11:57:53 +08:00
d197e77a55 vim-patch:8.2.0261: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5645)
f0cee1971f

Cherry-pick Test_bunload_with_offset() from patch 8.2.0243
2022-07-02 11:57:53 +08:00
f71d518c90 Merge pull request #19199 from zeertzjq/vim-9.0.0017
vim-patch:9.0.{0017,0021,0022}: invalid memory access
2022-07-02 09:28:16 +08:00
5bd1bdee14 fix(mark): set mark fnum from buffer (#19195) 2022-07-01 17:20:50 -06:00
d358856a0c vim-patch:9.0.0022: spell test fails
Problem:    Spell test fails.
Solution:   Expect new error is given.
95afae6d17
2022-07-02 06:55:23 +08:00
998a96803b vim-patch:9.0.0021: invalid memory access when adding word to spell word list
Problem:    Invalid memory access when adding word with a control character to
            the internal spell word list.
Solution:   Disallow adding a word with control characters or a trailing
            slash.
5e59ea54c0
2022-07-02 06:55:23 +08:00
0b15c01912 vim-patch:9.0.0017: accessing memory beyond the end of the line
Problem:    Accessing memory beyond the end of the line.
Solution:   Stop Visual mode when closing a window.
3d51ce18ab
2022-07-02 06:55:23 +08:00
9b4d0137b8 build: move lint target to cmake #19169
This will ensure less verbose output and faster linting.
2022-07-01 09:15:04 -07:00
2b1abe3c9d vim-patch:9.0.0015: with EXITFREE defined terminal menus are not cleared (#19187)
Problem:    With EXITFREE defined terminal menus are not cleared.
Solution:   Also clear terminal menus. Remove condition that is always true.
            (closes vim/vim#10641)
79ae152697
2022-07-01 21:02:59 +08:00
6486b0345a version.c: update [skip ci] #19179
Co-authored-by: marvim <marvim@users.noreply.github.com>
2022-07-01 03:26:42 -07:00
60604d6a99 vim-patch:9.0.0012: signature files not detected properly (#19172)
Problem:    Signature files not detected properly.
Solution:   Add a function to better detect signature files. (Doug Kearns)
cdbfc6dbab
2022-07-01 07:08:44 +02:00
8f5bcfb0e4 Merge pull request #19178 from zeertzjq/vim-8.2.0049
vim-patch:8.2.0049: command line completion not fully tested
2022-07-01 11:49:48 +08:00
b22f7dd908 test(old): reorder test_cmdline.vim to match upstream 2022-07-01 11:17:33 +08:00
300490f2e8 vim-patch:8.2.0049: command line completion not fully tested
Problem:    Command line completion not fully tested.
Solution:   Add more test cases.  Make help sorting stable. (Dominique Pelle,
            closes vim/vim#5402)
297610ba4b
2022-07-01 11:02:55 +08:00
2268a4147e Merge pull request #19170 from zeertzjq/vim-8.0.1558
vim-patch:8.0.{1558,1570,1574,1588},8.1.{0487,0695,1274}: menu features
2022-07-01 10:49:14 +08:00
5a62ad605e feat(ui): make right-click menu work properly with ext_multigrid
Add tests both with and without ext_multigrid.
2022-07-01 10:28:07 +08:00
236947ab20 vim-patch:8.1.1274: after :unmenu can still execute the menu with :emenu
Problem:    After :unmenu can still execute the menu with :emenu.
Solution:   Do not execute a menu that was disabled for the specified mode.
ce79353ace
2022-07-01 10:17:39 +08:00
d81d8d454a vim-patch:8.1.0695: internal error when using :popup
Problem:    Internal error when using :popup.
Solution:   When a menu only exists in Terminal mode give an error. (Naruhiko
            Nishino, closes vim/vim#3765)
f42b45d719
2022-07-01 10:17:39 +08:00
015778a381 vim-patch:8.1.0487: no menus specifically for the terminal window
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes vim/vim#3439) Add a menu test.
4c5d815256

ADDR_OHTER comes from patch 8.1.1241, which has already been ported.
2022-07-01 10:17:39 +08:00
5551a29d06 vim-patch:8.0.1588: popup menu hangs after typing CTRL-C
Problem:    Popup menu hangs after typing CTRL-C.
Solution:   Make CTRL-C exit the loop. (Ozaki Kiichi, closes vim/vim#2697)
52f18a112a
2022-07-01 10:17:39 +08:00
e4c2ff2da4 vim-patch:8.0.1574: show cursor in wrong place when using popup menu
Problem:    Show cursor in wrong place when using popup menu. (Wei Zhang)
Solution:   Force updating the cursor position.  Fix skipping over unused
            entries.
987723e084
2022-07-01 10:17:39 +08:00
610cf9f950 vim-patch:8.0.1570: can't use :popup for a menu in the terminal
Problem:    Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
            included that don't work in the current state.
29a2c08d79
2022-07-01 10:17:39 +08:00
cf8df141f3 vim-patch:8.0.1558: no right-click menu in a terminal
Problem:    No right-click menu in a terminal.
Solution:   Implement the right click menu for the terminal.
aef8c3da2b
2022-07-01 10:13:06 +08:00
5a490d838e cmdheight=0: fix bugs #18961
Continue of #16251

Fix #18953
Fix #18960
Fix #18958
Fix #18955
Fix #18970
Fix #18983
Fix #18995
Fix #19112
2022-06-30 18:59:50 -07:00
3b1423bfa7 fix(filetype): update call sites of vim.filetype.match (#19171)
These were not updated in #18895.
2022-06-30 09:54:44 -06:00
565f72b968 feat(marks): restore viewport on jump #15831
** Refactor

Previously most functions used to "get" a mark returned a position,
changed the line number and sometimes changed even the current buffer.

Now functions return a {x}fmark_T making calling context aware whether
the mark is in another buffer without arcane casting. A new function is
provided for switching to the mark buffer and returning a flag style
Enum to convey what happen in the movement. If the cursor changed, line,
columns, if it changed buffer, etc.

The function to get named mark was split into multiple functions.

- mark_get() -> fmark_T
- mark_get_global() -> xfmark_T
- mark_get_local() -> fmark_T
  - mark_get_motion() -> fmark_T
  - mark_get_visual() -> fmark_T

Functions that manage the changelist and jumplist were also modified to
return mark types.

- get_jumplist -> fmark_T
- get_changelist -> fmark_T

The refactor is also seen mainly on normal.c, where all the mark
movement has been siphoned through one function nv_gomark, while the
other functions handle getting the mark and setting their movement
flags. To handle whether context marks should be left, etc.

** Mark View

While doing the refactor the concept of a mark view was also
implemented:

The view of a mark currently implemented as the number of lines between
the mark position on creation and the window topline. This allows for
moving not only back to the position of a mark but having the window
look similar to when the mark was defined. This is done by carrying and
extra element in the fmark_T struct, which can be extended later to also
restore horizontal shift.

*** User space features

1. There's a new option, jumpoptions+=view enables the mark view restoring
automatically when using the jumplist, changelist, alternate-file and
mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark]

** Limitations

- The view information is not saved in shada.
- Calls to get_mark should copy the value in the pointer since we are
  using pos_to_mark() to wrap and provide a homogeneous interfaces. This
  was also a limitation in the previous state of things.
2022-06-30 05:59:52 -07:00
3fe6b99abc refactor: enable -Wconversion warning for memline.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-30 14:51:38 +02:00
cb84f5ee53 refactor(uncrustify): change config to better align with style guide (#18803)
refactor(uncrustify): change config to better align with neovim style
2022-06-30 20:27:52 +08:00
69cd0ba27b vim-patch:9.0.0011: reading beyond the end of the line with put command (#19166)
Problem:    Reading beyond the end of the line with put command.
Solution:   Adjust the end mark position.
d25f003342
2022-06-30 20:16:00 +08:00
37af46bb4c feat(build): add_glob_target runs only on changed files #19070
The general idea is that add_glob_targets creates a "touch file", a
dummy file that acts as a dependency in order to check which files are
outdated since the last time the target was run.

Remove RunUncrustify.cmake as it's no longer necessary. It was initially
introduced to silence its noisy output. The per-file targets will
suppress the noisy output from uncrustify, except for the very first
run.

Also remove DefCmdTarget.cmake since add_glob_target already
incorporates its functionality.
2022-06-30 05:10:05 -07:00
f50135a32e feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem:
- Since c57f6b28d7 #8519, sockets are created in ~/.local/… but XDG
  spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which
  implies that XDG_STATE_DIR is potentially non-local.
- Not easy to inspect Nvim-created temp files (for debugging etc).

Solution:
- Store sockets in stdpath('run') ($XDG_RUNTIME_DIR).
- Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims.
- Make ok() actually useful.
- Introduce assert_nolog().

closes #3517
closes #17093
2022-06-30 04:16:46 -07:00
514e76e4b2 vim-patch:9.0.0001: Travis CI is no longer used #19163
Problem:    Travis CI is no longer used.
Solution:   Delete the Travis CI configuration. (Hugo Osvaldo Barrera,
            closes vim/vim#10636)
75417d960b
2022-06-30 03:12:08 -07:00
ba5be650a7 Merge pull request #19134 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for fileio.c
2022-06-30 11:51:07 +02:00
995e487915 refactor(highlight)!: rename attributes to match Vim (#19159)
Ref: 84f5463630
Rename:
- `underlineline` to `underdouble`
- `underdot` to `underdotted`
- `underdash` to `underdashed`

`underdouble` also now takes higher precedence than `undercurl`.
2022-06-30 16:57:44 +08:00
593f2f753f refactor: enable -Wconversion warning for fileio.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-29 22:00:56 +02:00
6f6286e4f9 fix(lsp): small bugs in snippet-parser #18998
This fixes the following bugs:
`${1:else_text}` -> format with if_text: "else_text"
`${1:-else_text}` -> format with if_text: "else_text"
`${1:}` in `format` (eg. empty else_text) -> error.
`${1:}` (eg. empty placeholder) -> error.

Thanks hrsh7th :)
2022-06-29 09:53:49 -07:00
1eb9624666 vim-patch:9.0.0006: not all Visual Basic files are recognized (#19153)
Problem:    Not all Visual Basic files are recognized.
Solution:   Change detection of *.cls files. (Doug Kearns)
8b5901e2f9
2022-06-29 18:43:56 +02:00
ba583f8206 vim-patch:9.0.0005: hare files are not recognized (#19151)
Problem:    Hare files are not recognized.
Solution:   Add a filetype pattern. (Hugo Osvaldo Barrera, closes vim/vim#10630)
040674129f
2022-06-29 16:21:04 +02:00
8ea09fc908 vim-patch:8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' (#19147)
Problem:    Incsearch highlight broken when calling searchcount() in 'tabLine'
            function. (Mirko Palmer)
Solution:   Save and restore the incsearch state. (Christian Brabandt,
            closes vim/vim#9763, closes vim/vim#9633)
6dd7424c7e
2022-06-29 19:34:37 +08:00
bab32bba7a vim-patch:9.0.0002: map functionality outside of map.c (#19150)
Problem:    Map functionality outside of map.c.
Solution:   Move f_hasmapto() to map.c.  Rename a function. (closes vim/vim#10611)
c207fd2535
2022-06-29 19:25:38 +08:00
21a1f1f552 Merge pull request #19133 from famiu/feat/api/cmd_support_filter
feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filter
2022-06-29 09:12:01 +02:00
01fc5097d3 Merge #19139 build(cmake): fix static libintl on macOS 2022-06-29 03:41:40 +02:00
998dc07288 feat: update unicode tables #19135 2022-06-28 18:34:56 -07:00
3cc8559963 Merge pull request #19141 from bfredl/mapchar
refactor: define builtin mappings and autocmds without pseudo-excmds
2022-06-29 00:46:25 +02:00
7ab2e12ebc refactor(aucmd): call define_autocmd() directly for default autocmds 2022-06-28 23:41:46 +02:00
83170a4986 refactor(map): simplify add_map params 2022-06-28 23:40:27 +02:00
674787feae ci(release): link gettext include directory
Our previous mangling of gettext broke the `HAVE_WORKING_LIBINTL` test
because it prevented CMake from finding `libintl.h`. Let's fix that by
linking Gettext's `include` directory into `/usr/local` too.
2022-06-29 02:19:45 +08:00
be40ba68a8 build(cmake): fix static libintl test on macOS
If `libintl` is a static library on macOS, we also need to explicitly
link with `libiconv` and the `CoreFoundation` framework. Otherwise, our
`HAVE_WORKING_LIBINTL` test erroneously fails.

Closes #19127
Closes #19138
2022-06-29 02:19:42 +08:00
e0f605bfd8 Merge #19120 build: rename build-related dirs 2022-06-28 13:35:56 +02:00
606ec8b708 feat(api): make nvim_parse_cmd and nvim_cmd support :filter
Also fixes a memory leak in `parse_cmdline`.

Closes #18954.
2022-06-28 17:31:04 +06:00
9e14744099 fix(coverity): redundant assert #19059
* fix(coverity/353303): redundant assert
  eap->line2 is an int32_t, it is always lower than INT_MAX.
* fix(coverity/353302): redundant assert
2022-06-28 04:24:21 -07:00
4c0c6f8428 build: move unicode/ to src/unicode/ 2022-06-28 04:05:11 -07:00
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00
9ddb481d88 refactor(ci): cleanup release.yml #19132 2022-06-28 03:40:53 -07:00
094086a713 Merge #19060 memory leaks 2022-06-28 12:37:39 +02:00
ee6b21e843 fix(vim.ui.input): accept nil or empty "opts" #19109
Fix #18143
2022-06-28 02:53:15 -07:00
014a88799a refactor: replace char_u #18429
Work on https://github.com/neovim/neovim/issues/459
2022-06-28 02:31:54 -07:00
7e1cf6b764 fix(inccommand): parse the command to check if it is previewable
Free regprog if command isn't previewable

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-06-28 13:00:05 +08:00
274609a109 vim-patch:069a7d561bbe (#19130)
Update runtime files
069a7d561b
2022-06-27 23:35:26 +02:00
f2fa11708c fix(filetype): check for non-nil match in detect.rules (#19129) 2022-06-27 20:43:37 +02:00
0c363d1a70 Merge pull request #19122 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for message.c
2022-06-27 17:07:21 +02:00
2dd01e3e21 refactor: enable -Wconversion warning for message.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-27 13:55:40 +02:00
f3c8f3e5d4 vim-patch:partial:8a3b805c6c9c (#19104)
Update runtime files
8a3b805c6c

skip builtin.txt (needs 8.2.4838)
skip message.txt (whitespace changes)
2022-06-27 10:23:09 +02:00
f10489d9c2 Merge pull request #19077 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for ex_cmds.c
2022-06-27 10:09:33 +02:00
6f3508f8ed refactor(filetype): allow vim.filetype.match to accept buf and filename (#19114)
This is necessary in cases where filetype detection acts recursively.
For example, when matching files that end with .bak, the "root" of
the filename is matched again against the same buffer (e.g. a buffer
named "foo.c.bak" will be matched again with the filename "foo.c", using
the same underlying buffer).
2022-06-27 10:03:43 +02:00
eab8b998e9 build: move man/ to src/man/ #19119
Problem:
man/ contains source files for manpage generation, it doesn't need to
live at the project root.

Solution:
Move it to src/man/.
2022-06-27 01:02:02 -07:00
8c2b870544 fix(api): change default value of 'pattern' in nvim_exec_autocmds (#19115)
Omitting 'pattern' in nvim_exec_autocmds should be equivalent to
omitting the 'fname' argument in :doautoall, which is equivalent to
using an empty string as the pattern. Fixes regression introduced
in #19091.
2022-06-27 09:51:33 +02:00
cf23695dd7 fix(api): nvim_parse_cmd check for ambiguous user command (#19116) 2022-06-27 14:10:13 +08:00
e2f9d0332b test: use "python3" to avoid skipped test #19106
Problem:
The "calls executable in $PATH" is skipped on some CI jobs because
"python" is not found.

Solution:
Use "python3" instead.
2022-06-26 22:03:06 -07:00
89f75dcd1f fix(coverity/348300): free memory when overiding sing attribute
Nothing prevent the user from doing `:sign define abc culhl=Normal
culhl=Normal` and thus this leads to an obvious memory leak.
2022-06-27 06:55:41 +02:00
a0a815ec57 Merge pull request #18716 from zeertzjq/vim-8.2.5007
vim-patch:8.2.{3484,5007,5123}: spell suggestion fixes
2022-06-27 06:45:00 +08:00
6711d001c5 fix(spell): make setting 'encoding' clear word list 2022-06-27 05:33:54 +08:00
f0d4007f62 vim-patch:8.2.5123: using invalid index when looking for spell suggestions
Problem:    Using invalid index when looking for spell suggestions.
Solution:   Do not decrement the index when it is zero.
156d391195
2022-06-27 05:33:54 +08:00
80af2c6055 vim-patch:8.2.5007: spell suggestion may use uninitialized memory
Problem:    Spell suggestion may use uninitialized memory. (Zdenek Dohnal)
Solution:   Avoid going over the end of the word.
6d24b4ff69
2022-06-27 05:33:54 +08:00
bafb53604a vim-patch:8.2.3484: crash when going through spell suggestions
Problem:    Crash when going through spell suggestions.
Solution:   Limit the text length for finding suggestions to the original
            length.  Do not update buffers when exiting. (closes vim/vim#8965)
e275ba4fc9
2022-06-27 05:33:54 +08:00
516d6318b7 Merge pull request #19091 from clason/do-aucmd-pats
feat(api): support pattern array for exec_autocmds
2022-06-26 23:05:52 +02:00
f3ce06cfa1 refactor(filetype)!: allow vim.filetype.match to use different strategies (#18895)
This enables vim.filetype.match to match based on a buffer (most
accurate) or simply a filename or file contents, which are less accurate
but may still be useful for some scenarios.

When matching based on a buffer, the buffer's name and contents are both
used to do full filetype matching. When using a filename, if the file
exists the file is loaded into a buffer and full filetype detection is
performed. If the file does not exist then filetype matching is only
performed against the filename itself. Content-based matching does the
equivalent of scripts.vim, and matches solely based on file contents
without any information from the name of the file itself (e.g. for
shebangs).

BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead 
of `vim.filetype.match(name, bufnr)`
2022-06-26 18:41:20 +02:00
5c8025967e refactor(api): use FOREACH_ITEM macro in autocmd 2022-06-26 17:57:45 +02:00
ae3e371303 docs(release): suggest "xattr" for macos release #19100 2022-06-26 08:46:37 -07:00
da358d4521 feat(api): support pattern array for exec_autocmds 2022-06-26 13:04:45 +02:00
3d45706478 build: guard free_locales with HAVE_WORKING_LIBINTL #19095
With 4c7462fdb3, when `libintl` is turned off via
`-DENABLE_LIBINTL=OFF`, Neovim does not compile in Debug mode with the following
error message:

```
...
[201/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval.c.o
FAILED: src/nvim/CMakeFiles/nvim.dir/eval.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DEXITFREE -DINCLUDE_GENERATED_DECLARATIONS -DMIN_LOG_LEVEL=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -Dnvim_EXPORTS -I/Users/hat/Projects/neovim/build/config -I/Users/hat/Projects/neovim/src -I/Users/hat/Projects/neovim/build/src/nvim/auto -I/Users/hat/Projects/neovim/build/include -I/Users/hat/Projects/neovim/.deps/usr/include/luajit-2.1 -isystem /Users/hat/Projects/neovim/.deps/usr/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -g -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always  -Wno-conversion -MD -MT src/nvim/CMakeFiles/nvim.dir/eval.c.o -MF src/nvim/CMakeFiles/nvim.dir/eval.c.o.d -o src/nvim/CMakeFiles/nvim.dir/eval.c.o -c /Users/hat/Projects/neovim/src/nvim/eval.c
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: error: implicit declaration of function 'free_locales' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  free_locales();
  ^
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: note: did you mean 'free_titles'?
/Users/hat/Projects/neovim/build/include/buffer.h.generated.h:58:16: note: 'free_titles' declared here
DLLEXPORT void free_titles(void);
               ^
1 error generated.
[212/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval/funcs.c.o
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1
```

The previous commit, b1b5802009, to 4c7462f does
not have this issue. As you can see in the following, the issue occurs only in
Debug mode with `libintl` turned off:

```bash
# No issue
git checkout b1b5802

# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"

# Compile error when in Debug and libintl turned off
git checkout 4c7462f

# The following Debug build does not work
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"

# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
```

I noticed this because I turn `libintl` off when compiling `libnvim` for VimR.

Fix #19093
2022-06-26 03:17:57 -07:00
7dd73625dc revert: "oldtests: use expand() to fix pathsep" (#19073)
This reverts commit e3687165a7.

No longer needed after #10679.
2022-06-26 05:31:27 +08:00
42e8774317 vim-patch:e1dc76fbf333 (#19092)
Update runtime files
e1dc76fbf3
2022-06-25 21:56:51 +02:00
69e7b664d8 Merge pull request #19090 from bfredl/luaprg
fix(build): don't disable byte precompilation on debug builds
2022-06-25 20:30:43 +02:00
cb58b673e5 fix(build): don't disable byte precompilation on debug builds
This special casing is redundant since long, as you can disable
the binary cache regardless of build type with the --luamod-dev flag
2022-06-25 19:24:48 +02:00
9f592780b5 Merge pull request #16271 from 3N4N/fix-15913
fix: make_filter_cmd for powershell as shell
2022-06-25 17:52:39 +02:00
f977f9445f refactor(tests): introduce testprg()
Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
2022-06-25 08:27:17 -07:00
0b9664f524 fix: make_filter_cmd for :! powershell #15913
Problem:
Nvim fails to create tempfile "…/nvim6UJx04/7" when 'shell' is set to
pwsh (PowerShell Core). This breaks filtered shell commands ":{range}!".
With shell set to cmd, it works.

Solution:
PowerShell doesn't use "<" for stdin redirection. Instead, use
"-RedirectStandardInput".

Closes #15913
2022-06-25 07:20:58 -07:00
2217ab42c5 refactor: enable -Wconversion warning for ex_cmds.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-25 15:49:32 +02:00
b7084fef4c fix(build): strip trailing newline from variable (#19084)
Problem: #19029 added a new fallback that sets
`$MACOSX_DEPLOYMENT_TARGET` to the local macOS version via `sw_vers`.
However, the output included a newline, which broke the generated Ninja
build script.

Solution: use `OUTPUT_STRIP_TRAILING_WHITESPACE` for `execute_process`.
2022-06-25 13:45:20 +02:00
a5175fe489 vim-patch:8.2.5022: 'completefunc'/'omnifunc' error does not end completion (#19083)
Problem:    'completefunc'/'omnifunc' error does not end completion.
Solution:   Check if there was an error or exception. (closes vim/vim#10486,
            closes vim/vim#4218)
9bcb9ca9c7
2022-06-25 18:38:35 +08:00
5c2c88717a Merge pull request #19029 from carlocab/macos-universal
ci: build universal release on macOS
2022-06-25 12:16:04 +02:00
ece2960f1b build(gen_vimdoc): remove needless list creation and unused variable (#19079)
build(gen_vimdoc): remove needless list creation
2022-06-25 18:03:02 +08:00
88a5941598 Merge pull request #19041 from lewis6991/globallocal
fix(api): nvim_set_option_value for global-local options
2022-06-25 11:09:55 +02:00
35e89bf903 fix(filetype.lua): always return a string in getlines function (#19080)
This re-introduces the fix that the filetype.lua refactor inadvertently reverted.
The fix ensures that in the case when end_lnum is omitted, a string is always returned.
2022-06-24 19:53:44 +02:00
d0644fa9bf ci(release): build a universal binary on macOS
After some tweaks to our dep builds, we can now build a universal binary
for macOS by using `CMAKE_OSX_ARCHITECTURES`. So, let's do that. This
requires a number of additional changes:

1. We need to build on macOS 11, since earlier versions do not support
   building universal (M1 + Intel) binaries.
2. We need to provision a universal `libintl`. The linker will look for
   an ARM64 version of this library when linking the `nvim` binary.

While we're here:
1. Link statically to `libintl`. This allows to to avoid having to do
   any install name rewriting or codesigning to package Neovim.
2. Bump the `MACOSX_DEPLOYMENT_TARGET` to `11`. We're already using a
   `libintl` built by Homebrew (through the pre-installed version of
   `gettext`), and that is built for macOS 11.

In order to ensure we link to `libintl.a` instead of `libintl.dylib`, we
have to make sure that CMake can't find the latter. This ideally should
be a matter of doing `brew unlink gettext`. However, CMake is too adept
at finding things that Homebrew has installed (even when not linked), so
we have to do a bit more than that. This appears in the additional step
ensuring static linkage to `libintl`.

We end up breaking some Homebrew-installed software in the process, and
some of these software is called during our build (e.g. curl, git,
wget). To avoid any adverse effects, let's just uninstall them.
2022-06-25 00:25:05 +08:00
b70f160414 build(deps): support universal builds on macOS
CMake can handle building universal binaries on macOS using the
`CMAKE_OSX_ARCHITECTURES` variable. Let's pass this variable to the
relevant dep builds. We use the `LIST_SEPARATOR` argument to prevent the
shell from interpreting the `;` that CMake uses as a list separator.

For dependencies that don't build using CMake, we only need to make sure
that the compiler is invoked with the correct `-arch` flags. The
compiler does the rest.

The only exception to this is the LuaJIT build, which we handle
separately as a special case.
2022-06-24 23:43:11 +08:00
adcaf24f42 build(luajit): support universal builds on macOS
To build universal binaries on macOS, one typically only needs to pass
multiple `-arch` flags to `clang`.

Unfortunately, this strategy causes LuaJIT builds to fail. To work
around this, we build LuaJIT for each requested architecture
individually first and then use `lipo` to package each architecture
slice into a universal binary.

To be able to do this on an Intel macOS host or an M1 macOS host without
a Rosetta installation, we need some special flags in order to tell
LuaJIT that it is cross-compiling for a different target. See [1] for
details.

[1] https://luajit.org/install.html#cross
2022-06-24 23:34:57 +08:00
12c62ddea6 Merge pull request #19071 from bfredl/minimap
perf(map): some optimizations when setting mappings
2022-06-24 16:20:13 +02:00
823d9e0af1 vim-patch:a57b553b4328 (#19076)
Update runtime files
a57b553b43
2022-06-24 14:45:07 +02:00
777faa29b3 refactor(map): statically initialize maphash array 2022-06-24 14:40:27 +02:00
f3ee62a743 refactor(map): simplify free_all_mem handling 2022-06-24 14:40:09 +02:00
a8ecc1ae6d perf(map): avoid extraneous heap allocations when setting mappings
- don't immediately vim_strsave and then xfree a heap buffer.
- allow replace_termcodes to take in a buffer instead of allocating it
- grug! memory allocation bad!
2022-06-24 13:53:42 +02:00
614fd3a883 perf(map): visit only one hash bucket instead of all, like an actual hash table 2022-06-24 12:56:24 +02:00
fd3008a6ae fix(coverity/348313): don't exit too early in runtime_default 2022-06-24 09:41:13 +02:00
7add9ea0e7 fix(coverity/352829): correctly free memory in f_call
This function was not freeing allocated memory that it owns when calling
functions from lua.
2022-06-24 09:41:12 +02:00
3a4fa22bad Merge pull request #19072 from zeertzjq/vim-8.2.4628
vim-patch:8.2.{4628,4895,4977,5146,5154}
2022-06-24 09:04:56 +08:00
affeb5c6dd vim-patch:8.2.5146: memory leak when substitute expression nests
Problem:    Memory leak when substitute expression nests.
Solution:   Use an array of expression results.
44ddf19ec0

Cherry-pick a comment change from patch 8.2.5057.

N/A patches for version.c:

vim-patch:8.2.5154: still mentioning version8, some cosmetic issues

Problem:    Still mentioning version8, some cosmetic issues.
Solution:   Prefer mentioning version9, cosmetic improvements.
abd56da30b
2022-06-24 07:26:06 +08:00
589f418fce vim-patch:8.2.4977: memory access error when substitute expression changes window
Problem:    Memory access error when substitute expression changes window.
Solution:   Disallow changing window in substitute expression.
e2bd8600b8

"textwinlock" was renamed back to "textlock" in patch 8.2.5029.
2022-06-24 07:26:06 +08:00
0cf0be302b vim-patch:8.2.4895: buffer overflow with invalid command with composing chars
Problem:    Buffer overflow with invalid command with composing chars.
Solution:   Check that the whole character fits in the buffer.
d88934406c
2022-06-24 07:26:06 +08:00
764dc7c383 vim-patch:8.2.4628: not enough testing for 2/3 letter substitute commands
Problem:    Not enough testing for 2/3 letter substitute commands.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#10019)
5e877baf87
2022-06-24 07:26:06 +08:00
a9cb0b8a5a fix(tests): remove misleading $TEST_PATH segment #19050
Problem:
RunTests.cmake adds $TEST_PATH to $TMPDIR with the implication that it
gives more isolation. But this is misleading because $TEST_PATH is only
defined once. Full test runs use the same $TMPDIR for all tests.

This was likely added with the intention of invoking RunTests.cmake
once-per-testfile from a wrapper than does the isolation/orchestration.
But even so, Nvim's vim_maketempdir() / vim_mktempdir() _already_
creates a unique tempdir per session.

Solution:
Don't append $TEST_PATH to $TMPDIR. Avoids confusion and makes the path
shorter.
2022-06-23 16:15:55 -07:00
c00a3f45d4 vim-patch:8cc5b559f700 (#19066)
Update runtime files
8cc5b559f7
2022-06-23 15:57:51 +02:00
3c85fd817e fix(api): check for inclusive buffer line index out of bounds correctly (#19056) 2022-06-23 21:38:00 +08:00
7718b75846 refactor: move some mapping-related code to a separate file (#19061)
This marks the following Vim patches as ported:

vim-patch:8.1.1785: map functionality mixed with character input

Problem:    Map functionality mixed with character input.
Solution:   Move the map functionality to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#4740)  Graduate the +localmap feature.
b66bab381c

vim-patch:8.2.3643: header for source file is outdated

Problem:    Header for source file is outdated.
Solution:   Make the header more accurate. (closes vim/vim#9186)
a3f83feb63

Also cherry-pick a change for <unique> mappings from patch 8.2.0807.
Rename map_clear_mode() to do_mapclear().
2022-06-23 21:17:11 +08:00
05ca14a881 Merge pull request #19058 from bfredl/miniopt
perf(highlight): use binary search to lookup RGB color names
2022-06-23 13:42:57 +02:00
84de4d8655 vim-patch:8.2.5152: search() gets stuck with "c" and skip evaluates to true (#19064)
Problem:    search() gets stuck with "c" and skip evaluates to true.
Solution:   Reset the SEARCH_START option. (closes vim/vim#10608)
180246cfd1
2022-06-23 19:34:43 +08:00
a3ce03bef1 Merge pull request #19020 from echasnovski/screenchar-float
fix(float): make `screen*()` functions respect floating windows
2022-06-23 12:01:27 +02:00
9690f8c57b perf(highlight): use binary search to lookup RGB color names 2022-06-23 11:48:12 +02:00
9f28eddfab fix(float): make screen*() functions respect floating windows
Resolves #19013.
2022-06-23 10:34:02 +03:00
e694e56422 vim-patch:8.2.2068: transparent syntax item uses start/end of containing region (#19055)
Problem:    Transparent syntax item uses start/end of containing region.
Solution:   Do not change the startpos and endpos of a transparent region to
            that of its containing region. (Adrian Ghizaru, closes vim/vim#7349,
            closes vim/vim#7391)
b46f57e87b
2022-06-23 13:01:31 +08:00
1b75094e3e Merge pull request #19054 from zeertzjq/vim-8.2.5150
vim-patch:8.2.{5150,5151}: reading beyond the end of the line
2022-06-23 07:37:54 +08:00
a4d7394bc8 vim-patch:8.2.5151: reading beyond the end of the line with lisp indenting
Problem:    Reading beyond the end of the line with lisp indenting.
Solution:   Avoid going over the NUL at the end of the line.
8eba2bd291
2022-06-23 06:34:56 +08:00
f088915495 vim-patch:8.2.5150: read past the end of the first line with ":0;'{"
Problem:    Read past the end of the first line with ":0;'{".
Solution:   When on line zero check the column is valid for line one.
f7c7c3fad6
2022-06-23 06:25:05 +08:00
801faeaae2 fix(input): use correct grid when restoring cursor for <expr> mapping (#19047) 2022-06-23 06:04:03 +08:00
c94325288a fix(api): check error after getting win/buf handle (#19052) 2022-06-22 13:19:03 -06:00
b20b28249b fix(build): only pass -municode if MINGW #19049
Avoids this warning in the Windows build:

    2022-06-22T08:58:13.0542153Z LINK : warning LNK4044: unrecognized option '/municode'; ignored [D:\a\neovim\neovim\build\test\functional\fixtures\printenv-test.vcxproj]
2022-06-22 07:09:19 -07:00
d23465534a fix(api): nvim_set_option_value for global-local options
global-local window options need to be handled specially. When `win` is
given but `scope` is not, then we want to set the local version of the
option but not the global one, therefore we need to force
`scope='local'`.

Note this does not apply to window-local only options (e.g. 'number')

Example:

   nvim_set_option_value('scrolloff', 10, {})       -- global-local window option; set global value
   nvim_set_option_value('scrolloff', 20, {win=0})  -- global-local window option; set local value
   nvim_set_option_value('number', true, {})        -- local window option

is now equivalent to:

   nvim_set_option_value('scrolloff', 10, {})
   nvim_set_option_value('scrolloff', 20, {win=0, scope='local'})  -- changed from before
   nvim_set_option_value('number', true, {win=0})                  -- unchanged from before

Only the global-local option with a `win` provided gets forced to local
scope.
2022-06-22 11:08:30 +01:00
dd591adf8a Merge pull request #19039 from bfredl/multicolor
perf: get rid of unnecessary allocations in highlight groups
2022-06-22 10:49:36 +02:00
f17d88c47a vim-patch:8.2.5132: :mkview test doesn't test much (#19045)
Problem:    :mkview test doesn't test much.
Solution:   Save the view with the folds closed. (James McCoy, closes vim/vim#10596)
c829faa821
2022-06-22 11:08:00 +08:00
34ae896b82 refactor(option): DRY get/set option value #19038
The main motivation for this is for the buf and win cases which need to
set up and restore context, and it's what specifically makes the
semantics of options nuanced, and thus this should not be repeated more
than once.

- nvim_get/set_option_value now share argument validation.
2022-06-21 19:09:50 -07:00
04592759fa Merge pull request #19043 from dundargoc/cmake
build(cmake): use glob_wrapper instead of file(GLOB ...) in main CMakeLists
2022-06-22 00:06:35 +02:00
230cb00cc5 build(cmake): use glob_wrapper instead of file(GLOB in main CMakeLists
This will allow cmake to check if any directories needs re-globbing, in
other words, if any new file has been added since last time cmake was
run. This will (allegedly) make the configure stage slower but I have
not noticed any difference so I believe this is well worth it.
2022-06-21 23:29:05 +02:00
e3b51d5842 refactor(runtime): refactor filetype.lua (#18813)
Move some filetype detection functions to detect.lua,
sort patterns by detected filetype.
2022-06-21 11:29:52 -06:00
8cd94e3bc0 perf(ui): remove spurious allocations from mode_style_array() 2022-06-21 18:40:35 +02:00
a9442c532e perf(highlight): allocate permanent names in an arena for fun and cache locality 2022-06-21 18:40:35 +02:00
1dad288432 refactor: remove atrocious HL_TABLE()[idx] syntax before I poke my eyes out 2022-06-21 18:40:35 +02:00
ce7d18f86a refactor(highlight): get rid of syn_unadd_group()
This is a sham. if the user does

  hi ExistingGroup guifg=AliceBlue invalidkey=foobar

the "guifg" part will still be executed. No need to micro-manage
the same case where ANewGroup is added instead.
2022-06-21 18:40:35 +02:00
374e0b6678 perf(highlight): don't allocate duplicates for color names 2022-06-21 18:40:33 +02:00
5ad97fcc0e perf(highlight): get rid of local memory allocations for "{key}={arg}" 2022-06-21 18:09:11 +02:00
f479dd0bbe docs(deprecated): alternatives for $NVIM_LISTEN_ADDRESS 2022-06-21 10:25:44 +02:00
6d52a29c3b Merge pull request #18743 from gpanders/bowooptvalue
Add "buf" and "win" to nvim_get_option_value and use them in vim.bo and vim.wo
2022-06-20 17:28:37 -06:00
bc6a5943de Merge pull request #19030 from zeertzjq/vim-8.2.5138
vim-patch:8.2.{5107,5138}: various small issues
2022-06-21 07:06:56 +08:00
7a309311a2 vim-patch:d799daa660b8 (#19031)
Update runtime files
d799daa660
2022-06-20 18:47:30 +02:00
87a68b6a3a refactor: use nvim_{get,set}_option_value for vim.{b,w}o
`nvim_get_option_value` and `nvim_set_option_value` better handle
unsetting local options. For instance, this is currently not possible:

    vim.bo.tagfunc = nil

This does not work because 'tagfunc' is marked as "local to buffer" and
does not have a fallback global option. However, using :setlocal *does*
work as expected

    :setlocal tagfunc=

`nvim_set_option_value` behaves more like :set and :setlocal (by
design), so using these as the underlying API functions beneath vim.bo
and vim.wo makes those two tables act more like :setlocal. Note that
vim.o *already* uses `nvim_set_option_value` under the hood, so that
vim.o behaves like :set.
2022-06-20 09:16:21 -06:00
58d028f64b feat(api): add "buf" and "win" to nvim_get_option_value
These mirror their counterparts in nvim_set_option_value.
2022-06-20 09:16:21 -06:00
99ef06d846 refactor(provider): use list comprehension #19027
- list(filter(lambda x: x != "", sys.path))
+ [p for p in sys.path if p != ""]
2022-06-20 06:17:00 -07:00
e3bfc1293e Merge pull request #18988 from bfredl/uipack
refactor(ui): encode "redraw" events without intermediate allocations
2022-06-20 15:04:40 +02:00
9aaff18489 vim-patch:8.2.5138: various small issues
Problem:    Various small issues.
Solution:   Various small improvments.
8088ae95bb

N/A patches for version.c:

vim-patch:8.2.5107: some callers of rettv_list_alloc() check for not OK

Problem:    Some callers of rettv_list_alloc() check for not OK. (Christ van
            Willegen)
Solution:   Use "==" instead of "!=" when checking the return value.
93a1096fe4
2022-06-20 20:51:11 +08:00
5d69872105 perf(ui): reduce allocation overhead when encoding "redraw" events
Note for external UIs: Nvim can now emit multiple "redraw" event batches
before a final "flush" event is received. To retain existing behavior,
clients should make sure to update visible state at an explicit "flush"
event, not just the end of a "redraw" batch of event.

* Get rid of copy_object() blizzard in the auto-generated ui_event layer
* Special case "grid_line" by encoding screen state directly to
  msgpack events with no intermediate API events.
* Get rid of the arcane notion of referring to the screen as the "shell"
* Array and Dictionary are kvec_t:s, so define them as such.
* Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with
  a predetermined size within an arena.
* Eliminate redundant capacity checking when filling such kvec_t:s
  with values.
2022-06-20 12:44:56 +02:00
b2ed439bd5 Merge #19015 delete cmake code 2022-06-19 19:51:16 +02:00
a195dc7c83 fix(decorations): nvim_buf_set_extmark breaks conceal #19010
Closes #19007

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-19 10:33:54 -07:00
ae7a4ad3d7 build: remove FindLua.cmake since it's already built into cmake
FindLua.cmake is a copy from the cmake repo:
0419ecbcad/Modules/FindLua.cmake.
It's a cmake module, meaning it's already shipped with cmake by default.
There have been two changes done to our version of FindLua.cmake.

The first change is that

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

was changed to

include(FindPackageHandleStandardArgs.cmake)

This change is required only because we have imported FindLua.cmake
module but not FindPackageHandleStandardArgs module. Had FindLua been
called as a module as intended then this file would not need changing.

The second change is that support for Lua 5.4 is added. However, support
for any version of Lua except for 5.1 is disabled since
e322b5c864.

Because these changes from the upstream FindLua.cmake is unnecessary I
believe we can and should use the builtin FindLua.cmake instead of our
own.
2022-06-19 18:34:28 +02:00
636a309981 build(cmake): simplify def_cmd_target function
Instead of appending to a command output, append to an existing target
instead. The primary benefit is intermediary ...-cmd targets aren't
needed, we can instead append commands to the relevant target directly.
2022-06-19 18:34:28 +02:00
cd1b2998d3 build(cmake): simplify and speed up the uninstall target
More specifically, replace exec_program with file(REMOVE ...) so that
the uninstall target is run during the build stage instead of the
configure stage, significantly speeding up the target.

The code snippet that was removed is taken from the cmake FAQ
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake.
However, this uses undocumented features such as IMMEDIATE when calling
configure_file, which is an artifact from cmake 2.x (it's so old it's
difficult to find information on it). Similarly, this particular code
snippet has been around for a long time and originated from the cmake
mailing lists. Based on this I believe the in-file was a workaround for
the limitations of cmake back then and that it's not required anymore.
2022-06-19 18:34:28 +02:00
668591ae04 build(cmake): remove unnecessary globbing with file
There's no need to use globbing since there's only one file.
2022-06-19 18:34:28 +02:00
8a6f728315 build(cmake): remove unnecessary *-prereqs targets
Running the tests on their own works just fine.
2022-06-19 18:34:28 +02:00
837ea6da9f fix(tui): piping nodejs to nvim breaks input handling #18932
Problem:
Piping NodeJS output into Neovim makes the editor unusable.
This happens because NodeJS changes the tty state on exit after
Nvim calls uv_tty_set_mode(). (May not always happen due to race
condition.)
This should have been fixed by 4ba5b4a864 #13084. But some
commands and functions (:sleep, system(), …) call ui_flush()
internally, in particular the first tui_mode_change() is called before
the end of startup.

Steps to reproduce:
1. node -e "setTimeout(()=>{console.log('test')}, 1000)" | nvim -u NORC +"sleep 500m" -
2. The cursor key letters just overwrite the editor screen, and CTRL+C exits.

Solution:
Skip pending_mode_update during startup.
Note: Delaying ui_flush() entirely could be a more general solution
(emit a new UI event on VimEnter?). But "remote/coprocess TUI" #18375
could make all of this moot anyway.
Fixes #18470
2022-06-19 08:22:39 -07:00
c5c5d980a1 ci(release): skip CoreServices system library on macOS (#19021)
Problem:
The release script bundles a system library (CoreServices) that was
added in #18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that #18294 replaced with CoreServices).
2022-06-19 16:20:27 +02:00
7b2b44bce4 fix(ci): noisy logs, unreliable test #19019
Problem:
1. CI logs have too many (40+) logs mentioning SIGHUP:
   ```
   WRN 2022-06-18T16:05:47.075 T3568.22499.0/c deadly_signal:177: got signal 1 (SIGHUP)
   WRN 2022-06-18T16:05:47.273 T3569.91095.0/c deadly_signal:177: got signal 1 (SIGHUP)
   WRN 2022-06-18T16:05:47.651 T3570.59545.0/c deadly_signal:177: got signal 1 (SIGHUP)
   ```
2. TS parser test still sometimes fails on BSD CI.
3. remote_spec test fails too often.

Solution:
1. Log deadly signals at INFO level. It hasn't been helpful in CI, and
   for local troubleshooting it's reasonable to adjust the loglevel as
   needed.
2. Adjust the TS parser test again. ref #18911
3. Skip the remote_spec test. The `--remote` feature was merged before
   it was fully formed and needs to be revisited.
2022-06-18 19:19:08 -07:00
605631ac29 build(lint): set some linters as non-fatal #19018
luacheck and clint are the most important, and they are bundled.
The others are nice-to-have, and not always available (and not bundled),
so make them optional. This allows the "lint" target to function as
a convenient and low-hassle handle for contributors.

We still get the full power of lint in CI.

TODO: bundle uncrustify (and then set it as required for "lint")?
2022-06-18 11:10:10 -07:00
ff6b8f5435 fix(terminal): coverity USE_AFTER_FREE #18978
Problem:
Coverity reports use after free:

    *** CID 352784:  Memory - illegal accesses  (USE_AFTER_FREE)
    /src/nvim/buffer.c: 1508 in set_curbuf()
    1502         if (old_tw != curbuf->b_p_tw) {
    1503           check_colorcolumn(curwin);
    1504         }
    1505       }
    1506
    1507       if (bufref_valid(&prevbufref) && prevbuf->terminal != NULL) {
    >>>     CID 352784:  Memory - illegal accesses  (USE_AFTER_FREE)
    >>>     Calling "terminal_check_size" dereferences freed pointer "prevbuf->terminal".
    1508         terminal_check_size(prevbuf->terminal);
    1509       }
    1510     }
    1511
    1512     /// Enter a new current buffer.
    1513     /// Old curbuf must have been abandoned already!  This also means "curbuf" may

Solution:
Change terminal_destroy and terminal_close to set caller storage to NULL,
similar to XFREE_CLEAR. This aligns with the pattern found already in:
terminal_destroy e897ccad3e
term_delayed_free 3e59c1e20d
2022-06-18 09:53:12 -07:00
9c0f2253a5 fix(logging): try harder to resolve Nvim "name" #19016
Problem:
If startup finishes (starting=false) before the logger ever happens to
see a v:servername, we're stuck with the "?.<PID>" fallback name
forever.

Solution:
Drop the `starting` condition. Discard the "?.<PID>" fallback after
using it for the current log message. So logging will always check
v:servername next time.
2022-06-18 09:30:54 -07:00
1ad6423f02 fix(highlight): use ctermbg/fg instead of bg/fg when use_rgb=false #18982
If `use_rgb` was false, we would attempt to set the `cterm_bg_color` to the
variable `bg`, which is only retrieved from `bg` and `background` keys, not
`ctermbg`. Same for `fg`. This means the values would be `-1` (the default,
un-got value) and we'd always set the returned values to `0`.

My understanding is `fg/bg` is always "gui" values, so instead we should be
using `ctermbg` when needed.

Nb: when looking around I think this function is currently *always* called with
`use_rgb = true`.
2022-06-18 08:33:58 -07:00
901fde60c6 Merge pull request #19011 from zeertzjq/vim-8.2.5120
vim-patch:8.2.{5120.5121}
2022-06-18 20:02:52 +08:00
dc56b442d8 vim-patch:8.2.5121: interrupt test sometimes fails
Problem:    Interrupt test sometimes fails.
Solution:   Use a different file name.
8d6420631c

Add a modeline to test_interrupt.vim.
2022-06-18 19:37:45 +08:00
aab05cd5ff vim-patch:8.2.5120: searching for quotes may go over the end of the line
Problem:    Searching for quotes may go over the end of the line.
Solution:   Check for running into the NUL.
2f074f4685
2022-06-18 19:36:43 +08:00
966d55effe vim-patch:8.2.5116: "limit" option of matchfuzzy() not always respected (#19005)
Problem:    "limit" option of matchfuzzy() not always respected.
Solution:   Remove "else". (Kazuyuki Miyagi, closes vim/vim#10586)
47f1a55849
2022-06-18 13:43:02 +08:00
e651ae5864 vim-patch:d592deb33652 (#19002)
Update runtime files
d592deb336
2022-06-17 20:38:21 +02:00
98e2da7d50 fix(hl): return cterm fg/bg even if they match Normal #18981
Fixes #18980

- 831fa45ad8 is related but this doesn't regress that
- The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally
  carried from patch to patch starting all the way back in 29bc6dfabd where it
  was avoiding setting a HL attr. But `hlattrs2dict()` now is just
  informational.
2022-06-16 18:33:58 -07:00
e0aa1d87e8 test(treesitter): add benchmark #18989
add benchmark from #18109
2022-06-16 17:22:43 -07:00
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
c57f6b28d7 Merge #8519 feat: name, test ids, sockets in stdpath(state) 2022-06-17 01:23:48 +02:00
279bc71f3c Merge pull request #18760 from kevinhwang91/fix-treesitter-fold
fix(treesitter): new iter if folded
2022-06-16 18:29:27 +02:00
8780076a78 fix(treesitter): new iter if folded 2022-06-16 17:38:10 +02:00
35c9fe9895 vim-patch:8.2.5110: icon filetype not recognized from the first line (#18987)
Problem:    Icon filetype not recognized from the first line.
Solution:   Add a check for the first line. (Doug Kearns)
bf6614643f
2022-06-16 15:53:38 +02:00
179faa3edd fix(lua): clear got_int when calling vim.on_key() callback (#18979) 2022-06-16 18:51:36 +08:00
0e8186bdd8 fix(lua): highlight.on_yank can close timer in twice #18976
Steps to reproduce:

1. setting `vim.highlight.on_yank`
   ```
   vim.api.nvim_create_autocmd({ "TextYankPost" }, {
     pattern = { "*" },
     callback = function()
       vim.highlight.on_yank({ timeout = 200 })
     end,
   })
   ```
2. repeat typing `yeye` ...
3. causes the following error.
   ```
   Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x01e96970 is already closing
   stack traceback:
           [C]: in function 'close'
           vim/_editor.lua: in function ''
           vim/_editor.lua: in function <vim/_editor.lua:0>
   ```

📝 Test result before fix:

    [----------] Global test environment setup.
    [----------] Running tests from test/functional/lua/highlight_spec.lua
    [ RUN      ] vim.highlight.on_yank does not show errors even if buffer is wiped before timeout: 15.07 ms OK
    [ RUN      ] vim.highlight.on_yank does not show errors even if executed between timeout and clearing highlight: 15.07 ms ERR
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (string) 'Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x02025260 is already closing
    stack traceback:
            [C]: in function 'close'
            vim/_editor.lua: in function ''
            vim/_editor.lua: in function <vim/_editor.lua:0>'
    Expected:
    (string) ''
2022-06-15 19:39:55 -07:00
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
b6467dfc23 test(report): formatting, drop dumplog()
Don't need to dumplog() on each failed test because we now have test-ids
that associate log messages with tests.
2022-06-15 19:23:10 -07:00
8f06520594 feat(logging): include test-id in log messages
Problem:
1. Log messages (especially in CI) are hard to correlate with tests.
2. Since b353a5c05f #11886, dumplog() prints the logs next to test
   failures. This is noisy and gets in the way of the test results.

Solution:
1. Associate an incrementing id with each test and include it in log
   messages.
    - FUTURE: add v:name so Nvim instances can be formally "named"?
2. Mention "child" in log messages if the current Nvim is a child (based
   on the presence of $NVIM).

BEFORE:

    DBG … 12345      UI: event
    DBG … 12345      log_server_msg:722: RPC ->ch 1: …
    DBG … 12345      UI: flush
    DBG … 12345      inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … 23454      UI: stop
    INF … 23454      os_exit:594: Nvim exit: 0

AFTER:

    DBG … T57        UI: event
    DBG … T57        log_server_msg:722: RPC ->ch 1: …
    DBG … T57        UI: flush
    DBG … T57        inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … T57/child  UI: stop
    INF … T57/child  os_exit:594: Nvim exit: 0
2022-06-15 19:23:10 -07:00
fa4b0c3ba5 refactor(log): use msg_schedule_semsg #18950 2022-06-15 17:23:13 -07:00
4cc05a75ea vim-patch:8.2.5097: using uninitialized memory when using 'listchars' (#18974)
Problem:    Using uninitialized memory when using 'listchars'.
Solution:   Use the length returned by mb_char2bytes(). (closes vim/vim#10576)
74ac29cecd
2022-06-16 07:18:27 +08:00
0c6ad03c3f fix(ui): do not call showmode() when setting window height (#18969) 2022-06-15 19:41:58 +08:00
504d7decbd vim-patch:8c1b8cb2e0b5 (#18966)
Update runtime files
8c1b8cb2e0
2022-06-15 09:20:32 +02:00
1493efdc14 test: correct check for v:errmsg in inccommand test (#18968)
After the first separator is typed v:errmsg can be set.
Check for its value before typing the first separator.
2022-06-15 10:18:43 +08:00
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
8ba64dd3ad Merge pull request #18947 from zeertzjq/vim-8.2.1897
vim-patch:8.2.{1897,1898,5088}
2022-06-14 21:57:08 +08:00
2a2fb8be74 Merge pull request #18880 from bfredl/arena
perf(memory): use an arena for RPC decoding
2022-06-14 15:20:37 +02:00
0a0cda9528 vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to use
Problem:    Value of cmod_verbose is a bit complicated to use.
Solution:   Use zero for not set, value + 1 when set. (closes vim/vim#10564)
cd7496382e

Omit has_cmdmod(): only used for Vim9 script
2022-06-14 21:12:27 +08:00
6130b4a84b vim-patch:8.2.1898: command modifier parsing always uses global cmdmod
Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
e100440158
2022-06-14 20:58:34 +08:00
dad898b665 refactor(api): remove redundant fields of CmdParseInfo 2022-06-14 20:58:34 +08:00
da41ca299f vim-patch:8.2.1897: command modifiers are saved and set inconsistently
Problem:    Command modifiers are saved and set inconsistently.
Solution:   Separate parsing and applying command modifiers.  Save values in
            cmdmod_T.
5661ed6c83

Cherry-pick: :0verbose fix from patch 8.2.4741
2022-06-14 20:58:34 +08:00
cd9e08cb94 refactor: enable -Wconversion warning for eval.c (#18448)
Work on https://github.com/neovim/neovim/issues/567
2022-06-14 20:57:06 +08:00
3f5c647de9 perf(memory): use an arena for RPC decoding
drawback: tracing memory errors with ASAN is less accurate for arena
allocated memory.
Therefore, to start with it is being used for Object types around
serialization/deserialization exclusively. This is going to have
a large impact especially when TUI is refactored as a co-prosess
as all UI events will be serialized and deserialized by nvim itself.
2022-06-14 14:33:04 +02:00
2f2022773f vim-patch:6ba83ba9ee29 (#18948)
Update runtime files.
6ba83ba9ee
2022-06-14 08:52:04 +02:00
619eb32c75 fix(inccommand): never preview if parsing command failed (#18944)
`errormsg` is not always set when parsing the command failed (e.g. when
the range contains invalid marks). Check the return value is better.
2022-06-14 10:55:04 +08:00
7f8f8d6cb7 feat(lsp): sort codelens if multiple item per line (#18951) 2022-06-13 19:31:48 +02:00
e13c36e312 vim-patch:8.2.0577: not all modifiers supported for :options (#18952)
Problem:    Not all modifiers supported for :options.
Solution:   Use all cmdmod.split flags. (closes vim/vim#4401)
7a1637f4c0

Cherry-pick Test_options_command() change from patch 8.2.0540
2022-06-13 22:04:39 +08:00
837360868b fix(tests): missing clear() #18927
This was caught in #18674 since it allows test isolation
2022-06-13 04:05:17 -07:00
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
2f71d4708e Merge pull request #18902 from bfredl/fulexit
fix(tests): check for EOF in requests to nvim properly
2022-06-13 11:23:40 +02:00
a68f5fccb3 Merge pull request #18934 from zeertzjq/vim-8.2.5079
vim-patch:8.2.{5079,5081,5083}
2022-06-13 16:30:13 +08:00
e3281d992e fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
e95f32a717 vim-patch:8.2.5083: autocmd test still fails on MS-Windows
Problem:    Autocmd test still fails on MS-Windows.
Solution:   Change backward to forward slashes.
db77c49401
2022-06-13 16:05:26 +08:00
1c16e5bb11 vim-patch:8.2.5081: autocmd test fails on MS-Windows
Problem:    Autocmd test fails on MS-Windows.
Solution:   Set shellslash to get forward slashes.
7c0d0c3c75
2022-06-13 16:05:19 +08:00
254454d0c5 vim-patch:8.2.5079: DirChanged autocommand may use freed memory
Problem:    DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution:   Free the memory later. (closes vim/vim#10555)
d8c9d32c89

Code change is N/A as Nvim gets the full current directory again before
applying the autocommand, so this just ports the tests.
2022-06-13 16:05:02 +08:00
dd8b6094c0 build(lint): fix lintuncrustify #18945
Problem:
lintuncrustify doesn't actually do anything.

Solution:
- Fix the parameters.
- Fail correctly on nonzero result.

followup to #18940
2022-06-12 18:49:38 -07:00
e420cd6c67 test: dismiss quit_more from Lua #11226
Add a test for what #16537 fixed.
2022-06-12 16:45:44 -07:00
c665773897 Merge pull request #18931 from zeertzjq/regexp-num-escaped
fix(substitute): subtract number of backslashes later
2022-06-13 07:18:38 +08:00
3c7b91da10 build: remove CMAKE_CROSSCOMPILING code #18914
This is rarely, if ever, used and certainly not tested. It's likely this
isn't functional anymore.
2022-06-12 15:11:14 -07:00
f90174c98c build(lint): fix luacheck not found #18940
Problem:
Since 6d57bb89c1 #18543, luacheck is not found on some systems when
running the "lintlua" target.

Solution:
- Move the find_program() to the top-level CMakeLists.txt
- Define a def_cmd_target() function with fewer assumptions than the old
  lint() function.
- Move "lintuncrustify" to src/nvim/CMakeLists.txt so it can reuse the
  $LINT_NVIM_SOURCES already defined there.
- Make the lint targets _fatal_ by default. There is little reason for
  the "lint" umbrella target defined in Makefile to exist if it's going
  to ignore the absence of the actual linters.
- For now, keep the uncrustify call in a separate cmake script so that
  it can be silenced (too noisy).
2022-06-12 15:08:01 -07:00
429c40cce3 fix(buffer): disable buffer-updates before removing from window #18933
There can be other places that access window buffer info (e.g.
`tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't
solve the crash in all cases, and may also cause Nvim's behavior to
diverge from Vim.

Fix #14998
2022-06-12 15:02:00 -07:00
feba56af7d Merge pull request #18936 from bfredl/apioption
refactor(api): reorganize code
2022-06-12 21:01:16 +02:00
2de0d67144 fix(inccommand): skip split window if not enough room #18937
Command preview now behaves like inccommand=nosplit when there's not
enough room for the preview window to be opened instead of aborting,
which is consistent with old behavior of 'inccommand'.
2022-06-12 10:59:04 -07:00
f4967828f9 feat(contrib): asan debugging script #18892
Opted to use a shell script because it's simpler to manipulate
environment variables than in makefiles.
2022-06-12 10:54:14 -07:00
612944c586 refactor(api): update vimdoc 2022-06-12 19:45:39 +02:00
0d63fafcda refactor(api): move command related API to separate file 2022-06-12 19:45:39 +02:00
a907d6f517 refactor(api): move extmark specific functions to api/extmark.c 2022-06-12 16:45:18 +02:00
4a275e3291 refactor(api): move option code to own file 2022-06-12 16:09:42 +02:00
8bc48273eb vim-patch:8.2.5078: substitute test has a one second delay
Problem:    Substitute test has a one second delay.
Solution:   Use ":silent!".  Add another test case. (closes vim/vim#10558)
3269efdf01
2022-06-12 20:42:30 +08:00
41bb81a2df fix(substitute): subtract number of backslashes later 2022-06-12 20:42:30 +08:00
502f03fc06 Merge pull request #18919 from bfredl/multiattr
fix(messages): add color when showing nvim_echo in :messages history
2022-06-11 23:06:05 +02:00
f4121c52b9 fix(messages): add color when showing nvim_echo in :messages history 2022-06-11 22:29:51 +02:00
c87a5ebbc3 Merge pull request #18428 from bfredl/do_source
feat(api): nvim__get_runtime do_source
2022-06-11 11:32:23 +02:00
e92fcdbab2 feat(api): nvim__get_runtime do_source 2022-06-11 10:25:59 +02:00
2b539d6fdf fix(inccommand): clear cmdpreview state if preview is not shown (#18923) 2022-06-11 13:04:19 +08:00
2b252430aa vim-patch:8.2.5076: unnecessary code (#18922)
Problem:    Unnecessary code.
Solution:   Remove code and replace with function call. (closes vim/vim#10552)
2e7cba347f
2022-06-11 07:00:56 +08:00
673b3a780e Merge pull request #18461 from dundargoc/refactor/change-linenr-to-int32
refactor: change type of linenr_T from long to int32_t
2022-06-10 19:28:47 +02:00
a732c253b7 refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the
MAXLNUM constant which sets the maximum allowable number of lines to
2^32-1. This discrepancy may lead to hard to detect bugs, for example
https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a
fix maximum size of 2^32-1 will prevent this type of errors in the
future.

Also change the variables `amount` and `amount_after` to be linenr_T
since they're referring to "the line number difference" between two
texts.
2022-06-10 16:16:41 +02:00
e15d31b530 fix(input): fix macro recording with ALT and special key (#18917) 2022-06-10 17:13:57 +08:00
6eaf10502c vim-patch:partial:63f32603789d (#18916)
Update runtime files
63f3260378

skip translations
skip user manual rewrite
2022-06-10 08:40:32 +02:00
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
28e43881b7 refactor(ops): doxygen docstrings #17743 2022-06-09 08:12:07 -07:00
6d57bb89c1 build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake
Cmake is our source of truth. We should have as much of our build
process there as possible so everyone can make use of it.

* build: remove redundant check for ninja generator
The minimum cmake version as of writing this is 3.10, which has ninja
support.
2022-06-09 08:09:24 -07:00
9662cd7f48 fix(tests): unreliable parser_spec #18911
The "first run" has high variability. Looks like the test failures
correlate with 545dc82c1b
, which makes sense because that improves "first run" performance.

So the `1000*` factor of this test could be adjusted to e.g. `300*` or `500*`.

ref https://github.com/neovim/neovim/pull/16945
2022-06-09 08:07:54 -07:00
bf327368d8 fix: segfault in find_tagfunc_tags #18841
fixes #15221

I tried to reproduce with a test, but failed. The below patch is able to
cause the out of bound access (I verified by adding a check to the
code), but it doesn't seg fault or trigger asan/valgrind errors.

```
diff --git a/src/nvim/testdir/test_tagfunc.vim b/src/nvim/testdir/test_tagfunc.vim
index ffc1d63b9..22828a39f 100644
--- a/src/nvim/testdir/test_tagfunc.vim
+++ b/src/nvim/testdir/test_tagfunc.vim
@@ -117,4 +117,26 @@ func Test_tagfunc_settagstack()
   delfunc Mytagfunc2
 endfunc

+func Test_tagfunc_settagstack_many()
+
+  func Mytagfunc1(pat, flags, info)
+    return [{'name' : 'mytag', 'filename' : 'Xtest', 'cmd' : '1'}]
+  endfunc
+  set tagfunc=Mytagfunc1
+  call writefile([''], 'Xtest')
+
+  for i in range(0,20)
+    let pos = [bufnr()]  + getcurpos()[1:]
+    let newtag = [{'tagname' : 'mytag' + i, 'from' : pos}]
+    call settagstack(1, {'items' : newtag}, 'a')
+    call settagstack(1, {'curidx' : 21})
+  endfor
+
+  tag
+
+  call delete('Xtest')
+  set tagfunc&
+  delfunc Mytagfunc1
+endfunc
```
2022-06-09 08:05:36 -07:00
11e0fea8ba fix: correct nlua_wait error message #18867
the message is wrapped in `if (timeout < 0)`, which means 0 is a valid value
2022-06-09 08:02:32 -07:00
d189bfaeb2 Merge pull request #18908 from zeertzjq/vim-8.2.5066
vim-patch:8.2.{5066,5070}: lcs-leadmultispace
2022-06-09 22:01:32 +08:00
b8742afb6f vim-patch:8.2.5070: unnecessary code
Problem:    Unnecessary code.
Solution:   Remove code that isn't needed. (closes vim/vim#10534)
b5f0801b1f
2022-06-09 21:26:24 +08:00
d6247a575c vim-patch:8.2.5066: lcs-leadmultispace
aca12fd89b
2022-06-09 21:26:23 +08:00
3da3cfc864 feat(autocmds): retrieve lua callback (#18642)
add a new `callback` field to `nvim_get_autocmds`
2022-06-09 07:18:56 -06:00
c5720c7221 Merge pull request #18904 from jamessan/no-parser-ci
ci: run tests with no treesitter parsers installed
2022-06-08 21:55:05 -04:00
a4e1b76f55 test: allow running CI without ts parsers installed 2022-06-08 21:10:49 -04:00
950ab00c2b ci: run tests with no treesitter parsers installed 2022-06-08 21:10:34 -04:00
8a70c53dad Merge pull request #18903 from jamessan/skip-test-parsers
test(ts): skip test if C parser is not available
2022-06-08 21:10:01 -04:00
916d848049 fix(terminal): scrollback delete lines immediately #18832
* on_scrollback_option_changed renamed to adjust_scrollback. The
  function name did not correspond to what it was doing. It is
  called unconditionally in every refresh of the terminal
  unrelated if the scrollback option was changed.
* new on_scrollback_option_changed function, which calls
  refresh_terminal, which then calls adjust_scrollback
* terminal_check_size is not the appropriate function to call when the
  option is changed since it only conditionally adjusts the scrollback.
  Use the new on_scrollback_option_changed

fixes #15477
fixes #11811
2022-06-08 17:46:57 -07:00
10291bb854 Merge pull request #18788 from dundargoc/ci/api-docs/color
ci(api-docs): show required changes with color
2022-06-08 19:55:51 -04:00
6b0595d7cc test(ts): skip test if C parser is not available 2022-06-08 18:04:25 -04:00
94181ad7dc fix(diagnostic): check for negative column value (#18868) 2022-06-08 12:55:39 -06:00
4d9e2247c9 refactor(log): simplify log_path_init #18898
Problem:
Since 22b52dd462 #11501, log_path_init is called in log_init, so it is
now called at a deterministic time. So the "just in time" complexity of
log_path_init is no longer needed.

Solution:
Remove logic intended to try to "heal" partial initialization.
2022-06-08 08:47:34 -07:00
f48aa68e08 Merge pull request #18896 from famiu/fix/nvim_create_user_command/smods
fix(nvim_create_user_command): make `smods` work with `nvim_cmd`
2022-06-08 12:41:59 +02:00
c84bd9e21f fix(nvim_create_user_command): make smods work with nvim_cmd
Closes #18876.
2022-06-08 15:24:52 +06:00
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
057a280867 Merge pull request #18870 from zbirenbaum/winhl-cursor
fix(highlight): let winhighlight use cursor
2022-06-07 14:52:35 +02:00
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
df70a3abcd fix(highlight): let winhighlight use cursor 2022-06-07 02:15:32 -04:00
9e442c17ee fix(input): allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885) 2022-06-07 12:41:18 +08:00
ab1f96e1d5 vim-patch:8.2.5064: no test for what 8.1.0052 fixes (#18881)
Problem:    No test for what 8.1.0052 fixes.
Solution:   Add a test. (closes vim/vim#10531)
3760bfddc4
2022-06-07 00:19:57 +08:00
41a49dd9c8 refactor(runtime): port remaining patterns from filetype.vim to filetype.lua (#18814) 2022-06-06 09:25:33 -06:00
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
ae02c02f1f vim-patch:8.2.5058: input() does not handle composing characters properly (#18872)
Problem:    input() does not handle composing characters properly.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
            (closes vim/vim#10527)
e3a529bc87

Cherry-pick all of Test_input_func() from patch 8.2.0316.
2022-06-06 05:45:59 +08:00
e4df1c9b9e fix(lsp): fix multi client handling in code action (#18869)
Fixes https://github.com/neovim/neovim/issues/18860
2022-06-05 16:43:32 +02:00
214f866fe5 fix(terminfo): disable smglr for vtpcon and conemu (#18855) 2022-06-05 14:39:56 +02:00
e13dcdf162 Merge pull request #18864 from bfredl/optcut
perf(tests): don't invoke nvim_get_all_options_info until needed
2022-06-05 00:48:43 +02:00
545dc82c1b perf(tests): don't invoke nvim_get_all_options_info until needed
This call alone is responible of 40 000 000 out of 80 000 000
individual alloc/free calls in the test suite.
2022-06-05 00:11:57 +02:00
9ce720a601 docs: specify CMAKE_BUILD_TYPE=RelWithDebInfo in README (#18859)
There have been complaints about the installation instructions being
inconsistent around the build type e.g.
https://github.com/neovim/neovim/issues/18670#issuecomment-1146468741.
Use CMAKE_BUILD_TYPE for both examples in the README.
2022-06-05 03:15:06 +08:00
79a194a278 Merge pull request #18861 from bfredl/norplugin
fix(startup): nvim with --clean should not load user rplugins
2022-06-04 19:25:52 +02:00
aad20de5ab fix(startup): nvim with --clean should not load user rplugins
runtime rplugins such like legacy script providers are not affected
by this change.
2022-06-04 18:37:54 +02:00
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
9961a9702e fix(lsp): set buflisted before switching to buffer (#18854) 2022-06-04 10:23:43 +02:00
e6fa4cca24 vim-patch:8.2.5054: no good filetype for conf files similar to dosini (#18851)
Problem:    No good filetype for conf files similar to dosini.
Solution:   Add the confini filetype. (closes vim/vim#10510)
635f48010d
2022-06-04 09:49:01 +02:00
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
86cc33a464 fix(filetype): fix typo in starsetf function (#18856) 2022-06-03 21:52:59 -06:00
c6d747e6a5 feat(lsp): send didChangeConfiguration after init (#18847)
Most LSP servers require the notification to correctly load the
settings and for those who don't it doesn't cause any harm.

So far this is done in lspconfig, but with the addition of vim.lsp.start
it should be part of core.
2022-06-03 18:16:11 +02:00
9aba204335 fix(hl): set Normal hl group sg_attr value #18820
fix #18024
2022-06-03 08:29:49 -07:00
84d8cc3ae5 ci: use python3 explicitly to fix macos warnings #18837
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020

Testing `pynvim` compatibility with python2 should not be done in core,
and there's only a provider_spec for python3 either way.
2022-06-03 08:15:45 -07:00
64e946c50f Merge pull request #18848 from bfredl/backevenagain
fix(log): back even again
2022-06-03 17:02:47 +02:00
8c86feb930 fix(log): back even again 2022-06-03 16:26:50 +02:00
dd0e9910da Merge pull request #18846 from bfredl/unpackfix
fix(api): some robustness issues in api_parse_enter
2022-06-03 15:02:10 +02:00
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
61e33f312e Merge pull request #18845 from bfredl/threadlog
fix(logging): make logmsg() thread-safe again
2022-06-03 14:55:56 +02:00
7264444873 fix(api): some robustness issues in api_parse_enter 2022-06-03 12:01:24 +02:00
640c695a7b fix(logging): make logmsg() thread-safe again
problem: data race when `recursive` is read outside of mutex by thread A
while thread B has taken the mutex and modifies it.

solution: use a recursive lock.

ref #18764
2022-06-03 11:08:32 +02:00
9745941ef6 Merge pull request #18730 from bfredl/apiconvert
convert API types using mpack instead of msgpack
2022-06-02 23:01:21 +02:00
26966688aa fix(treesitter): correct region for string parser (#18794)
fixes injections for string parsers after eab4d03a32
2022-06-02 17:35:16 +02:00
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
d93ba03c71 build(deps): bump Luv to HEAD - 9f8038633 (#18834) 2022-06-02 11:13:42 +02:00
d5651a4183 fix(lua): stop pending highlight.on_yank timer, if any (#18824)
When yanking another range while previous yank is still highlighted, the
pending timer could clear the highlight almost immediately (especially
when using larger `timeout`, i.e. 2000)
2022-06-02 09:49:57 +02:00
285f6518e6 Merge pull request #18831 from dundargoc/ci/disable-perl-macos
ci(provider): skip perl provider tests on macos
2022-06-02 09:46:37 +02:00
79bf507449 ci(provider): skip installing perl provider on macOS
The macOS CI jobs fail to properly install the perl provider, making the
entire thing fail.
2022-06-01 23:05:17 +02:00
57a296d899 fix(inccommand): avoid crash if callback changes inccommand option (#18830)
clang: Result of operation is garbage or undefined
clang: Uninitialized argument value

Also check for == 's' instead of != 'n' as it is more straightforward.

Also fix another unrelated PVS warning:
PVS/V1071: Return value of win_comp_pos() is not always used
2022-06-02 03:48:36 +08:00
209824ce2c fix(lsp): adjust offset encoding in lsp.buf.rename() (#18829)
Fix a bug in lsp.buf.rename() where the range returned by the server in
textDocument/prepareRename was interpreted as a byte range directly,
instead of taking the negotiated offset encoding into account. This
caused the placeholder value in vim.ui.input to be incorrect in some
cases, for example when non-ascii characters are used earlier on the
same line.
2022-06-01 18:56:18 +02:00
19e80738e0 fix(screen): restart win_update() if a decor provider changes signcols (#18768) 2022-06-01 22:53:29 +08:00
9f1ec825cd refactor(clang-tidy): remove nested redundant ifdefs #18811 2022-06-01 07:27:39 -07:00
d837b6d50c fix(checkhealth): skip vim.health #18816
Problem:
https://github.com/neovim/neovim/pull/18720#issuecomment-1142614996

The vim.health module is detected as a healthcheck, which produces spurious errors:

    vim: require("vim.health").check()
    ========================================================================
    - ERROR: Failed to run healthcheck for "vim" plugin. Exception:
      function health#check, line 20
      Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to call field 'check' (a nil value)
      stack traceback:
      [string "luaeval()"]:1: in main chunk

Solution:
Skip vim.health when discovering healthchecks.
2022-06-01 07:10:10 -07:00
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
f40adf770d fix(inccommand): do not try to preview an ambiguous command (#18827) 2022-06-01 20:17:52 +08:00
c632f64e24 Merge pull request #18583 from gpanders/path-root
feat(fs): add vim.fs module
2022-05-31 14:00:11 -06:00
046b4ed461 feat(fs): add vim.fs.normalize() 2022-05-31 13:30:10 -06:00
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
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
b740709431 feat(fs): add vim.fs.basename() 2022-05-31 13:04:41 -06:00
c5526a27c3 feat(fs): add vim.fs.dirname() 2022-05-31 13:04:41 -06:00
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
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
7380ebfc17 Merge pull request #18194 from famiu/feat/usercmd_preview
feat: user command "preview" (like inccommand)
2022-05-31 17:44:13 +02:00
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
5d840fa7e6 Merge pull request #18219 from kessejones/filetype-lua
feat(filetype): add more filetype patterns to Lua
2022-05-31 07:58:51 -06:00
0c95028688 vim-patch:8.2.5046: vim_regsub() can overwrite the destination (#18812)
Problem:    vim_regsub() can overwrite the destination.
Solution:   Pass the destination length, give an error when it doesn't fit.
4aaf3e7f4d
2022-05-31 19:55:04 +08:00
1a20aed3fb fix(lsp): include cancellable in progress message table (#18809)
Currently the `title`, `message` and `percentage` is stored for a
progress, but there is also an optional `cancellable` that comes in with
both the `WorkDoneProgressBegin` and also `WorkDoneProgressReport`. This
change also stores that value so that a plugin can access it when they
do a lookup in `client.messages`.
2022-05-31 13:19:45 +02:00
bfc85eab12 build(deps): bump Luv to HEAD - 02d703b42 (#18808) 2022-05-31 10:58:30 +02:00
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
b66e9e0baa feat(filetype): convert more patterns to filetype.lua 2022-05-30 20:32:35 -03:00
d092e377c4 test(oldtest): disable legacy detect for filetype.lua 2022-05-30 20:32:35 -03:00
d404d68c92 docs: clarify that nvim_strwidth counts control characters as one cell (#18802) 2022-05-31 07:06:34 +08:00
b5dd562e08 fix(docs): correct obsolete note about 'writedelay' in dev docs 2022-05-31 00:20:10 +02:00
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
8427da9299 Merge pull request #18798 from bfredl/doublehash
refactor(api): use hashy hash for looking up api method and event names
2022-05-30 20:09:51 +02:00
e86901eb68 docs(clang-format): one space in directives indent (#18800)
PPIndentWidth
The number of columns to use for indentation of preprocessor statements.
When set to -1 (default) IndentWidth is used also for preprocessor statements.
2022-05-30 23:49:11 +08:00
1f63052b68 refactor(api): use hashy hash for looking up api method and event names
This avoids generating khash tables at runtime, and is consistent with
how evalfuncs lookup work.
2022-05-30 14:11:01 +02:00
e9803e1de6 Merge pull request #18789 from dundargoc/ci/api-docs/run-in-drafts
ci(api-docs): run in drafts as well
2022-05-29 09:51:18 -04:00
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
d4bb15af52 test: add tests for inccommand with c_CTRL-R_= and c_CTRL-\_e (#18796) 2022-05-29 20:52:53 +08:00
015656abd7 fix(winbar): set w_winrow_off when initializing firstwin size (#18793) 2022-05-29 16:26:55 +08:00
6d30efddb7 test(job_spec): remove Xtest_jobstart_env log file 2022-05-29 15:40:59 +08:00
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
f31a10204c ci(uncrustify): show diff on failure #18780
This will make it possible to see what needs to be fixed without having
uncrustify installed locally.
2022-05-28 17:00:25 -07:00
772ae3e656 vim-patch:8.2.5037: cursor position may be invalid after "0;" range (#18782)
Problem:    Cursor position may be invalid after "0;" range.
Solution:   Check the cursor position when it was set by ";" in the range.
4d97a565ae
2022-05-29 07:00:18 +08:00
39613b6a2d ci(api-docs): run in drafts as well
A contributor should be able to be sure their PR passes the CI before
clicking "Ready for review".
2022-05-29 00:55:12 +02:00
d353d5f002 ci(api-docs): show required changes with color
It makes it easier to see what needs to be changed.
2022-05-28 21:42:40 +02:00
840b7576e9 Merge pull request #18786 from jamessan/latest-ci
ci: use ubuntu-latest for vim-patches and coverity-scan
2022-05-28 14:43:47 -04:00
a3df012845 ci: use ubuntu-latest for vim-patches and coverity-scan
Since we're not running tests or other things that are more sensitive to
changes in the VM environment, use ubuntu-latest to avoid the busy work
of updating the VM image.
2022-05-28 14:22:42 -04:00
f914b4e7a8 test: fixeol cleanup created files #18785
The async nature of feed_command caused a race condition on the calls
to delete, leaving the files on the root of the repo. Just use os.remove
and no need to wipeout.
2022-05-28 10:34:18 -07:00
c43e2874c0 fix(vim-patch.sh)
In scripts/vim-patch.sh line 335:
      printf '
             ^-- SC2183 (warning): This format string has 4 variables, but is passed 3 arguments.

    In scripts/vim-patch.sh line 597:
      list_missing_vimpatches 1 "$@" | while read -r vim_commit; do
                                                     ^--------^ SC2030 (info): Modification of vim_commit is local (to subshell caused by pipeline)

    In scripts/vim-patch.sh line 626:
      done < <(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id --name-only -r "${vim_commit}" -- . ':!src/version.c')
                                                                                   ^-----------^ SC2031 (info): vim_commit was modified in a subshell. That change might be lost.

    For more information:
      https://www.shellcheck.net/wiki/SC2183 -- This format string has 4 variable...
      https://www.shellcheck.net/wiki/SC2030 -- Modification of vim_commit is loc...
      https://www.shellcheck.net/wiki/SC2031 -- vim_commit was modified in a subs...
2022-05-28 10:30:03 -07:00
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
081eb72a80 refactor(regexp_nfa.c): match where Vim calls fopen() (#18778) 2022-05-28 19:26:19 +08:00
0dd3798dbb Merge pull request #18776 from famiu/fix/winbar_noroom
fix(winbar): only allow adding winbar when there is space
2022-05-28 12:18:04 +02:00
9cf1ac0377 fix(winbar): only allow adding winbar when there is space 2022-05-28 15:29:56 +06:00
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
77d9c672f8 fix(winbar): fix winbar disappear or glitch when moving a split (#18775) 2022-05-28 15:12:42 +08:00
285e738942 test(unit): use setup()/teardown() in buffer_spec.lua (#18739) 2022-05-28 10:14:12 +08:00
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
e2940d3c79 vim-patch:8.2.5024: using freed memory with "]d" (#18762)
Problem:    Using freed memory with "]d".
Solution:   Copy the pattern before searching.
e2fa213cf5
2022-05-27 05:59:05 +08:00
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
497046466e Merge pull request #17742 from dundargoc/doxygen/normal
refactor(normal): convert function comments to doxygen format
2022-05-26 18:55:56 +08:00
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
ec1bd06e10 refactor(normal): convert function comments to doxygen format 2022-05-26 10:16:41 +02:00
7b952793d5 refactor: missing parenthesis may cause unexpected problems (#17443)
related vim-8.2.{4402,4639}
2022-05-26 10:49:25 +08:00
f246a929e7 Merge pull request #18738 from zeertzjq/vim-8.2.5010
vim-patch:8.2.5010: the terminal debugger uses various global variables
2022-05-26 08:08:35 +08:00
068fb748e1 vim-patch:8.2.5015: Hoon and Moonscript files are not recognized (#18747)
Problem:    Hoon and Moonscript files are not recognized.
Solution:   Add filetype patterns. (Goc Dundar, closes vim/vim#10478)
bf82df0dd4
2022-05-25 18:07:58 -06:00
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
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
6db3f3f624 Merge pull request #18748 from dundargoc/ci/msvc
ci(mingw): only enable -municode for MinGW
2022-05-25 19:43:34 -04:00
cbf57fa353 vim-patch:8.2.5016: access before start of text with a put command (#18742)
Problem:    Access before start of text with a put command.
Solution:   Check the length is more than zero.
2a585c8501
2022-05-26 07:20:39 +08:00
e21899ac4f ci(mingw): only enable -municode for MinGW
When enabling -municode for MSVC the following warning shows up:
"LINK : warning LNK4044: unrecognized option '/municode'; ignored".
This will ensure cleaner logs for the MSVC job.
2022-05-25 22:23:27 +02:00
9fec6dc9a2 refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695) 2022-05-25 12:31:14 -06:00
8c4e62351f refactor(lsp): remove redundant client cleanup (#18744)
The client state is cleaned up both in client.stop() as well as in the
client.on_exit() handler. Technically, the client has not actually
stopped until the on_exit handler is called, so we should just do this
cleanup there and remove it from client.stop().
2022-05-25 11:45:45 -06:00
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
c6d6b8c7eb fix(lsp): respect global syntax setting in open float preview (#15225) 2022-05-25 18:47:49 +02:00
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
802a23926d build: require exact Lua version when using PREFER_LUA (#16633) 2022-05-25 08:11:53 -06:00
af2899aee0 vim-patch:8.2.5012: cannot select one character inside () (#18731)
Problem:    Cannot select one character inside ().
Solution:   Do not try to extend the area if it is empty. (closes vim/vim#10472,
            closes vim/vim#6616)
53737b5eee
2022-05-25 07:16:12 +08:00
2f974736ac fix(coverity): bail out if mouse_find_win() returns NULL (#18726) 2022-05-25 07:14:50 +08:00
e5490b38b7 docs(api): floating wins omitted under :mksession (#18721) 2022-05-24 11:32:01 -06:00
eebd682221 Merge pull request #18728 from dundargoc/ci/api/upgrade-to-ubuntu-22
ci(api-docs): upgrade to ubuntu 22 and remove conda dependency
2022-05-24 07:20:40 -04:00
d7e45ee4b9 Merge pull request #18626 from dundargoc/ci/shallow-clone
ci(api-docs): add comment explaining why full clone is needed
2022-05-24 07:20:04 -04:00
4fab52908b Merge pull request #18607 from dundargoc/build/mingw
restore mingw in cmake
2022-05-24 07:19:12 -04:00
db059ed1f1 ci(api-docs): add comment explaining why full clone is required 2022-05-24 12:29:58 +02:00
e9f8a478fc ci(api-docs): upgrade to ubuntu 22 and remove conda dependency
Ubuntu 22 has doxygen version 1.9.1 available in apt, which means we
don't need to use conda anymore. This will somewhat simplify the
workflow.
2022-05-24 12:21:17 +02:00
307c5c63e1 vim-patch:8.2.4999: filetype test table is not properly sorted (#18719)
Problem:    Filetype test table is not properly sorted.
Solution:   Sort by filetype. (Doug Kearns)
aa9729b652
2022-05-24 09:29:40 +08:00
5eaf9ef811 fix(filetype): correct vim.fn.did_filetype() handling (#18725) 2022-05-23 18:55:03 -06:00
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
37ee800b51 vim-patch:8.2.5009: fold may not be closeable after appending (#18722)
Problem:    Fold may not be closeable after appending.
Solution:   Set the fd_small flag to MAYBE. (Brandon Simmons, closes vim/vim#10471)
e8c4a64bff
2022-05-23 20:13:22 +01:00
c2f4920d3b Merge pull request #18712 from famiu/feat/ui/winbar_redraw
fix(ui): redraw winbar alongside statusline
2022-05-23 16:32:35 +02:00
353553f913 fix(ui): redraw winbar alongside statusline
Remove `w_redr_winbar` and use `w_redr_status` to redraw the winbar to
ensure that winbar redraw is triggered alongside the statusline redraw.
2022-05-23 19:35:46 +06:00
4b4643be07 vim-patch:8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment (#18717)
Problem:    When 'formatoptions' contains "/" wrongly wrapping a long trailing
            comment.
Solution:   Pass the OPENLINE_FORMAT flag.
7e66778815
2022-05-23 21:27:57 +08:00
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
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
a7e0a02031 Merge pull request #18691 from zeertzjq/vim-8.2.4996
vim-patch:8.2.{4996.5002}: setbufline(), deletebufline() may change Visual selection
2022-05-23 07:27:26 +08:00
39fb97b2a5 vim-patch:8.2.5001: checking translations affects the search pattern history (#18709)
Problem:    Checking translations affects the search pattern history.
Solution:   Use "keeppatterns". (Doug Kearns)
8a3704723c
2022-05-23 07:24:44 +08:00
bcfc97e8d8 vim-patch:8.2.5002: deletebufline() may change Visual selection
Problem:    deletebufline() may change Visual selection.
Solution:   Disable Visual mode when using another buffer. (closes vim/vim#10469)
9b2edfd3bf
2022-05-23 06:57:30 +08:00
eae4eddc54 vim-patch:8.2.4996: setbufline() may change Visual selection
Problem:    setbufline() may change Visual selection. (Qiming Zhao)
Solution:   Disable Visual mode when using another buffer. (closes vim/vim#10466)
0ad00a7fd3
2022-05-23 06:54:12 +08:00
378615b8ee fix(lsp): do not detach LSP servers on Windows #18703
Detaching the process seems to have unintended side effects on Windows,
so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907
Closes https://github.com/neovim/nvim-lspconfig/pull/1913
2022-05-22 12:21:44 -07:00
52623ce935 refactor(runtime): convert the remaining dist#ft functions to lua (#18623) 2022-05-22 12:16:04 -06:00
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
5250d5c1b1 Merge pull request #18646 from bfredl/winbarruler
fix(winbar): allow winbar to display a ruler
2022-05-22 19:43:30 +02:00
47d9a393de fix(cid/352839): USE_AFTER_FREE in create_user_command #18669 2022-05-22 10:29:15 -07:00
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
060ef52d8b fix(winbar): allow winbar to display the ruler 2022-05-22 18:56:07 +02:00
3fe6bf3a1e fix(mksession): don't store floats in session #18635
Problem:
If there are floating windows when `:mksession` runs, the session cannot
be properly restored.

Solution:
Change `:mksession` to skip floating windows. This matches Vim's
treatment of popup windows.

An alternative approach could have `:mksession` save floating windows
that can be _properly_ restored (rather than skip them entirely, which
is what this PR does). While that would seemingly be a more complete
fix, that could present additional issues since floating windows are
ordinarily created by plugins, and they may no longer be properly under
a plugin's control when restored.

closes #18432
2022-05-22 09:03:56 -07:00
b863c150c9 Merge pull request #18696 from bfredl/quickinc
fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
2022-05-22 17:51:31 +02:00
63741176ce ci(commitlint): only trigger on PRs to master #18679
This will prevent a failure for backported PRs as they use a different
commit message.
2022-05-22 08:03:06 -07:00
9b34723bcc Merge pull request #18693 from bfredl/quicklsp
fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
2022-05-22 16:25:17 +02:00
e01c197eab fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
from ~30 to ~20 secs with ASAN build

- feedkeys test: the same substitute was repeated, and not even correctly spelled
- don't clear() in a tight loop. "bwipe!" is enough to erase undo history
- error in cnoremap mapping causes a check_for_delay(). <c-c> it away.
2022-05-22 16:17:37 +02:00
566ee48f05 vim-patch:8.2.4935: with 'foldmethod' "indent" some lines not included in fold (#18694)
Problem:    With 'foldmethod' "indent" some lines are not included in the
            fold. (Oleg Koshovetc)
Solution:   Fix it. (Brandon Simmons, closes vim/vim#10399, closes vim/vim#3214)
d98e75e236
2022-05-22 21:37:25 +08:00
70e3caec4a fix(folds): fix fold regression with :move (#18685) 2022-05-22 21:03:22 +08:00
e7b3fd8ad6 Merge pull request #18681 from bfredl/uitest
fix(tests): fix some screen.lua warnings
2022-05-22 14:32:38 +02:00
58b9b7e7c4 fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
Cuts down typical run time for `plugin/lsp_spec.lua`
from 70 secs to 12 secs in ASAN CI build.

This happens in ASAN/EXIT_FREE builds where nvim waits 2000ms due to
unclosed handled. I wasn't able to pin-point the exact cause.
But these tests ran in nested context where two server/client pairs
were setup for no good reason. Moving these tests out so only one client
is being setup fixed the exit hang.
2022-05-22 14:14:58 +02:00
2cab6bea09 docs: remove "Vi default" #18672
It's not relevant and clutters the documentation.
2022-05-22 04:38:59 -07:00
5193b17839 vim-patch:8.2.4993: smart/C/lisp indenting is optional (#18684)
Problem:    smart/C/lisp indenting is optional, which makes the code more
            complex, while it only reduces the executable size a bit.
Solution:   Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
8e145b8246
2022-05-22 07:52:11 +08:00
0c4086faa1 vim-patch:8.2.4987: after deletion a small fold may be closable (#18683)
Problem:    After deletion a small fold may be closable.
Solution:   Check for a reverse range. (Brandon Simmons, closes vim/vim#10457)
3fcccf94e8
2022-05-22 07:27:54 +08:00
f0717ffade Merge pull request #18682 from zeertzjq/vim-8.1.0535
vim-patch:8.1.0535,8.2.4991: increment/decrement might get interrupted by updating folds
2022-05-22 07:27:26 +08:00
c3568b31f4 vim-patch:8.2.4991: no test for hwat patch 8.1.0535 fixes
Problem:    No test for hwat patch 8.1.0535 fixes.
Solution:   Add a test. (closes vim/vim#10462)
93c1573dd2
2022-05-22 06:41:31 +08:00
a1df7c5771 vim-patch:8.1.0535: increment/decrement might get interrupted by updating folds
Problem:    Increment/decrement might get interrupted by updating folds.
Solution:   Disable fold updating for a moment. (Christian Brabandt,
            closes vim/vim#3599)
6b731886ca
2022-05-22 06:41:31 +08:00
cbf0360179 Merge pull request #13729 from devbhansingh/ui_enter_prompt
feat(ui): clear message history explicitly with msg_history_clear event
2022-05-21 23:59:14 +02:00
646e1c3a3a feat(ui): clear message history explicitly with msg_history_clear event 2022-05-21 23:22:23 +02:00
3c1bc75447 fix(tests): fix some screen.lua warnings 2022-05-21 23:07:34 +02:00
1f1a65a9e4 ci: fix lint errors caused by missing includes (#18673)
This will fix the `check-single-includes` check which started failing
after https://github.com/neovim/neovim/pull/18663/.
2022-05-21 17:27:54 +02:00
55246d44f9 fix(autocmds): separate command from desc (#18617) 2022-05-21 15:55:48 +02:00
976f32aa7a refactor: add warnings for deprecated functions (#18662) 2022-05-21 09:51:03 +02:00
12f45fd697 ci: bump github actions versions #18616 2022-05-20 20:45:10 -07:00
79469e61d5 build(clint.py): remove rules for includes, whitespace, tabs #18611
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563

Closes https://github.com/neovim/neovim/issues/17763
2022-05-20 20:43:30 -07:00
045aacc384 ci: lint with uncrustify #18563
This lint job will ensure that the C codebase is properly formatted at
all times. This helps eliminate most of clint.py.

To save CI time, it's faster to manually compile uncrustify and cache
the binary instead of using homebrew (the apt-get package is too old).
2022-05-20 20:41:57 -07:00
4c97e17d38 refactor: remove unused USE_WCHAR_FUNCTIONS #18618
USE_WCHAR_FUNCTIONS is never defined and we don't trust libc wchar
functions anyway.
2022-05-20 20:31:32 -07:00
afa99f42b3 fix(unittests): coredump when running unit tests #18663
fs_init() must be called before early_init() in init/helpers.lua

If I run 'make unittest' on my Mac (macOS 10.14/Mojave or 12/Big Sur, intel
CPU), every test produce a core dump.

Call sequence in the core is:
    early_init()            main.c:197
    set_init_1()            option.c:508
    runtimepath_default()   runtime.c:1205
    get_lib_dir()           runtime.c:1175
    os_isdir()              fs.c:137
    os_getperm()            fs.c:777
    os_stat()               fs.c:761
    fs_loop_lock()          fs.c:72
    uv_mutex_lock(&fs_loop_mutex)   thread.c:352
    abort()

.deps/build/src/libuv/src/unix/thread.c:

    void uv_mutex_lock(uv_mutex_t* mutex) {
      if (pthread_mutex_lock(mutex))
        abort();	// line 352
    }

So pthread_mutex_lock(&fs_loop_mutex) failed. The reason seems to be simple.
fs_init() was not called and fs_loop_mutex has not been initialized. fs_init()
was moved out from early_init() in main.c by
b87867e69e, but unit/helpers.lua was not updated
accordingly.
2022-05-20 20:18:17 -07:00
b3453ea4a6 Merge pull request #18648 from jamessan/coverity-fixes 2022-05-20 14:22:15 -04:00
c847a0eeb7 Merge pull request #18664 from famiu/fix/winbar_crash
fix: prevent crash when statusline expression sets value of 'winbar'
2022-05-20 19:29:34 +02:00
cda0ef23cf build(deps): bump LuaJIT to HEAD - 4ef96cff8 (#18656) 2022-05-20 19:19:37 +02:00
e884e460bc fix: prevent crash when statusline expression sets value of 'winbar'
Closes #18649
2022-05-20 23:03:06 +06:00
ffb55261a8 Merge pull request #18653 from dundargoc/refactor/move-reverse-text
refactor: move reverse_text to strings.c as it's a string operation
2022-05-20 17:00:51 +02:00
76691bea04 Merge pull request #18657 from dundargoc/vim-8.2.4985
vim-patch:8.2.4985: PVS warns for possible array underrun
2022-05-20 22:23:20 +08:00
1a0de90068 refactor: move reverse_text to strings.c as it's a string operation
Also add tests for reverse_text.

Co-authored-by: Kalle Ranki <kalle.ranki@gmail.com>
2022-05-20 16:11:54 +02:00
02fd4ec83f vim-patch:8.2.4985: PVS warns for possible array underrun
Problem:    PVS warns for possible array underrun.
Solution:   Add a check for a positive value. (closes vim/vim#10451)
875339b22a
2022-05-20 15:15:13 +02:00
1d160a76ec Merge pull request #18641 from famiu/fix/nvim_cmd/keymap_error_suppress
fix: make `nvim_cmd` not suppress errors inside key mapping
2022-05-20 14:22:44 +02:00
3e627f9e55 ci(coverity): run every day instead of once/week
Neovim currently falls in the 100 kLOC - 500 kLOC bucket, which can scan
3x/day.
2022-05-20 08:17:47 -04:00
83f42e086a perf(cid/350479): avoid copying ExtmarkInfo when calling extmark_to_array() 2022-05-20 08:17:39 -04:00
501ee06d3a fix(cid/352782): assert str->items is non-NULL to hint static analyzers
The earlier vsnprintf() call checks whether str->items is NULL, sets of
the "possible NULL" spidey sense.  kv_ensure_space() guarantees
str->items is non-NULL but since it doesn't use NULL checks to decide
whether to alloc, static analyzers can't tell this code path is safe.
2022-05-20 08:17:33 -04:00
d31e68d5d0 fix(cid/348314): free user_copy, not user
user is passed in by the caller, which we internally copy.  We should be
freeing our copy, not the caller's string.
2022-05-20 08:15:13 -04:00
f15122e8a2 fix(cid/351940): free compl_arg in create_user_commands()'s error path exit 2022-05-20 08:15:07 -04:00
6954c0ba0d ci(coverity): annotate register_cfunc as leaking memory
register_cfunc allocates a ufunc_T, but doesn't store the pointer
anywhere before returning.  The uf_name member variable is stored in a
hashtable and used to lookup the ufunc_T later, but that's too much for
Coverity to track.

Adding the annotation ensures that any new callers to register_cfunc
don't pop up as new "leaks" in the Coverity scans.
2022-05-20 08:14:37 -04:00
1da7e2b8ca ci(coverity): model our allocation functions
Coverity was reporting false positives, particularly around for non-NUL
terminated strings around uses of xmemdupz().  The updated model
ensures Coverity understands xmemdupz allocates an extra byte and sets it
to NUL as well as the main details of our other allocation related
wrappers.
2022-05-20 08:14:20 -04:00
a4862cbb5f fix(lsp): only send diagnostics from current buffer in code_action() (#18639)
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
2022-05-20 13:11:23 +02:00
eb0aa8bb0e vim-patch:8.2.4980: when 'shortmess' contains 'A' loading session may still warn (#18636)
Problem:    When 'shortmess' contains 'A' loading a session may still warn for
            an existing swap file. (Melker Österberg)
Solution:   Keep the 'A' flag to 'shortmess' in the session file.
            (closes vim/vim#10443)
aaadb5b6f7

Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
2022-05-20 07:20:38 +08:00
69853a622a Merge pull request #18629 from famiu/fix/ui/winbar
fix(ui): make `winbar` properly equalize window heights for local value
2022-05-19 21:58:48 +02:00
bb8d05f932 Merge pull request #18638 from zeertzjq/fix-winbar-mouse
Fix mouse drag position with winbar
2022-05-20 03:34:34 +08:00
fb8fa004d8 fix: make nvim_cmd not suppress errors inside key mapping
Closes #18632
2022-05-19 22:23:14 +06:00
643cc94e7e fix(ui): make winbar properly equalize window heights for local value
Fixes `'winbar'` not properly equalizing window heights for splits when
the global value is empty and a window-local value is set instead.
2022-05-19 19:14:54 +06:00
f971536f46 fix(mouse): fix mouse drag position with winbar or border in multigrid 2022-05-19 19:16:49 +08:00
0997884ae2 fix(mouse): fix mouse drag position with winbar 2022-05-19 19:16:31 +08:00
d200ba654a Merge pull request #18502 from drybalka/fix-languagetree-contains-description
treesitter: small improvements of languagetree.lua
2022-05-19 09:17:10 +02:00
95580f31b3 test(mksession_spec): only sleep on Windows (#18637) 2022-05-19 10:42:05 +08:00
341d0ec3b3 vim-patch:8.2.4979: accessing freed memory when line is flushed (#18634)
Problem:    Accessing freed memory when line is flushed.
Solution:   Make a copy of the pattern to search for.
28d032cc68
2022-05-19 09:56:44 +08:00
6a2883c171 Merge pull request #18630 from dundargoc/refactor/remove-remap 2022-05-18 17:37:15 -06:00
18fbdaeeab fix(termopen): avoid ambiguity in URI when CWD is root dir (#16988) 2022-05-19 06:47:33 +08:00
97fc68850f refactor!: remove 'terse' option
Having two methods of setting the same option is redundant and can be
potentially confusing. Recommend adding 's' to 'shortmess' instead.
2022-05-19 00:15:40 +02:00
11957f51cc refactor!: remove 'remap' option
An option that should always be kept on except for when working with old
Vi scripts is of little use to us.
2022-05-19 00:15:36 +02:00
86db222469 docs(extmark): remove message about passing in id=0
The docs for `nvim_buf_set_extmark` mention that you can create a new
extmark when passing in `id=0`, however if you do this you'll get an
error since the code checks that id is positive.

```
id is not a positive integer
```

This change re-words the sentence to make it clearer.
2022-05-18 21:49:31 +02:00
6f0baa0bb7 Merge pull request #18620 from bfredl/multibar
fix(ui): make winbar work with floats and multigrid
2022-05-18 21:18:34 +02:00
3eea66d65a feat(lsp): option to reuse_win for jump actions (#18577) 2022-05-18 21:03:24 +02:00
503d8b0892 refactor(events): remove unnecessary fudging of updating_screen
This was not necessary after the introduction of `resize_events`,
after which ui resizes are not `fast_events` anymore.
2022-05-18 20:16:19 +02:00
17758fe7ad fix(ui): make winbar work with floats and multigrid 2022-05-18 20:16:18 +02:00
c28192e6f9 refactor: move more grid functions to grid.c. Clean up some variables 2022-05-18 20:16:18 +02:00
03a8269e3a Merge pull request #18507 from gpanders/au-lsp-attached 2022-05-18 11:59:03 -06:00
b840b5b6a9 Merge pull request #18624 from famiu/feat/ui/winbar
fix(ui): set correct position on mouse click when 'winbar' is enabled
2022-05-18 19:55:01 +02:00
fec944142b refactor: simple logic in tree_contains() 2022-05-18 19:28:49 +02:00
f66a60805d docs: correct description of LanguageTree:contains() 2022-05-18 19:28:41 +02:00
ed93186ee2 feat(lsp): add filter to vim.lsp.get_active_clients()
Allow get_active_clients() to filter on client name, id, or buffer. This
(soft) deprecates lsp.buf_get_clients().
2022-05-18 11:21:00 -06:00
2ffafc7aa9 feat(lsp): add LspAttach and LspDetach autocommands
The current approach of using `on_attach` callbacks for configuring
buffers for LSP is suboptimal:

1. It does not use the standard Nvim interface for driving and hooking
   into events (i.e. autocommands)
2. There is no way for "third parties" (e.g. plugins) to hook into the
   event. This means that *all* buffer configuration must go into the
   user-supplied on_attach callback. This also makes it impossible for
   these configurations to be modular, since it all must happen in the
   same place.
3. There is currently no way to do something when a client detaches from
   a buffer (there is no `on_detach` callback).

The solution is to use the traditional method of event handling in Nvim:
autocommands. When a LSP client is attached to a buffer, fire a
`LspAttach`. Likewise, when a client detaches from a buffer fire a
`LspDetach` event.

This enables plugins to easily add LSP-specific configuration to buffers
as well as enabling users to make their own configurations more modular
(e.g. by creating multiple LspAttach autocommands that each do
something unique).
2022-05-18 11:21:00 -06:00
8a9ab88945 feat(api): enable nvim_exec_autocmds to pass arbitrary data (#18613)
Add a "data" key to nvim_exec_autocmds that passes arbitrary data (API
objects) to autocommand callbacks.
2022-05-18 09:51:26 -06:00
288819c9cc fix(ui): set correct position on mouse click when 'winbar' is enabled 2022-05-18 21:15:34 +06:00
d7dd600716 Merge pull request #18562 from famiu/feat/ui/winbar
feat(ui): add `'winbar'`
2022-05-18 13:08:07 +02:00
028329850e refactor: grid->rows and grid->cols 2022-05-18 13:06:02 +02:00
2d27732029 build(deps): bump libuv to HEAD - 730e07e2f (#18606) 2022-05-18 11:22:46 +02:00
93d24a63b2 test: fix mksession terminal CWD test again (#18615) 2022-05-18 16:07:16 +08:00
6e414b698c test: unskip tests on Windows (#18600)
Remove the command('qall!') from mksession_spec.lua because it prevents
helpers.rmdir() from retrying.

Allow extra trailing spaces when matching terminal lines.
2022-05-18 12:57:04 +08:00
e1bdb2a258 feat(ui): add 'winbar'
Adds support for a bar at the top of each window, enabled through the
`'winbar'` option.

Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-18 09:27:08 +06:00
b70856009d Merge #18605 PVS fixes 2022-05-18 02:32:15 +02:00
7ded303d68 vim-patch:8.2.4975: recursive command line loop may cause a crash (#18614)
Problem:    Recursive command line loop may cause a crash.
Solution:   Limit recursion of getcmdline().
51f0bfb88a

Cherry-pick e_command_too_recursive from patch 8.2.3957.
2022-05-18 08:21:24 +08:00
10868dbf89 fix(PVS/V1044): suppress warning 2022-05-17 22:26:25 +02:00
5084b6fb92 fix(PVS/V568): correct placement of ignore directive 2022-05-17 22:26:25 +02:00
65f585ce9b fix(PVS/V547): "expression is always false"
Suppress warning in loop.c, the expression can be true if EXITFREE isn't
defined.
2022-05-17 22:26:25 +02:00
e75ccc3b3a fix(PVS/V1028): prevent potential overflow 2022-05-17 22:26:25 +02:00
38cbca3eea fix(health): handle non-existent log file #18610
Problem:
    vim.lsp: require("vim.lsp.health").check()
    ========================================================================
      - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
        function health#check, line 20
        Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
        stack traceback:
        ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
        [string "luaeval()"]:1: in main chunk

Solution:
Check for nil.

fix #18602
2022-05-17 11:11:14 -07:00
7ffa9073a3 refactor(runtime): convert more dist#ft functions to lua (#18430) 2022-05-17 19:48:45 +02:00
8a39032fdd Merge pull request #18554 from kevinhwang91/perf-timerstart
perf(_editor): no need to stop inside vim.defer_fn
2022-05-17 18:59:48 +02:00
a4c0c07043 revert: "ci: remove mingw job #18580"
This partially reverts commit f8af81445b.

The mingw parts of cmake was removed to see if it was still used
(ref: https://github.com/neovim/neovim/pull/18580). It turns out it is,
so this will fix that.

Closes: https://github.com/neovim/neovim/issues/18597
2022-05-17 17:07:45 +02:00
6219331c4d feat(api): add win and buf to nvim_set_option_value
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-05-17 14:48:10 +01:00
8a73e60eb9 fixup: update test/functional/lua/vim_spec.lua
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-05-17 14:25:56 +01:00
f49699737c fix(terminal): do not trim whitespace that is actually in the terminal (#16423) 2022-05-17 21:09:28 +08:00
bbfc4567df fix(health): correct shada file path #18603 2022-05-17 05:43:35 -07:00
b239db3cb5 feat(lintcommit): remove "chore", add "dist" #18594
"chore" is never necessary, choose "fix" or "feat" if nothing else applies.
2022-05-17 05:42:48 -07:00
54b5222fbb docs(api): update v:errmsg behavior #18593 2022-05-17 05:27:33 -07:00
5c41165c8e feat(lua): allow some viml functions to run in fast
This change adds the necessary plumbing to annotate functions in funcs.c
as being allowed in run in luv fast events.
2022-05-17 10:29:33 +01:00
6613f58ceb Merge pull request #18598 from zeertzjq/vim-8.2.4968
vim-patch:8.2.{4121,4968,4969}: invalid memory access
2022-05-17 08:47:45 +08:00
527e861cbb vim-patch:8.2.4969: changing text in Visual mode may cause invalid memory access
Problem:    Changing text in Visual mode may cause invalid memory access.
Solution:   Check the Visual position after making a change.
7ce5b2b590
2022-05-17 08:16:37 +08:00
26c906f54d vim-patch:8.2.4968: reading past end of the line when C-indenting
Problem:    Reading past end of the line when C-indenting.
Solution:   Check for NUL.
60ae0e7149
2022-05-17 08:16:31 +08:00
b8c0eeaa30 vim-patch:8.2.4121: Visual test fails on MS-Windows
Problem:    Visual test fails on MS-Windows.
Solution:   Set 'isprint' so that the character used is not printable.
262898ae43
2022-05-17 08:16:31 +08:00
07ade91f21 docs: vim.regex is case sensitive by default (#18595) 2022-05-16 13:30:00 -06:00
b9b5577d6d Merge pull request #18578 from dundargoc/refactor/remove-char_u
refactor: remove char_u
2022-05-16 14:24:29 +02:00
14d653b421 feat(man.vim): list command flags in "gO" outline #17558 2022-05-16 04:49:44 -07:00
f0148de790 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-16 13:27:06 +02:00
7adecbcd29 fix(version.c): mark N/A vim patches #18587
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in https://github.com/neovim/neovim/issues/5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0056

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in https://github.com/neovim/neovim/issues/5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in https://github.com/neovim/neovim/issues/1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
2022-05-16 03:23:36 -07:00
cd998f8804 ci(coverity): correct cron job time #18590
The comment says it should be run at 00:10 UTC, and in cron job format
minutes come before hours.
2022-05-16 03:21:55 -07:00
e501e4ed4b feat(lua): add traceback to vim.deprecate #18575 2022-05-15 18:07:36 -07:00
b2799518c7 feat(terminfo): bump built-in terminfo entries (#18570)
Removes NOLINT, which is pointless for the generated terminfo_defs.h.

Adds `uncrustify:off`, so it is not uncrustify which complains about the same
things (too long lines, no space after comma) instead.
2022-05-16 01:45:34 +02:00
f8af81445b ci: remove mingw job #18580
Unnecessary CI builds increase the change of spurious failures, which are costly
noise. Of course, we should fix all legitimate bugs, but we also cannot
micro-manage every platform, so there needs to be a clear motivation for the CI
builds that we maintain.

Reasons against maintaining a mingw CI job:
1. The windows mingw build is slow.
2. Failures:
    - https://github.com/neovim/neovim/issues/18494
    - https://github.com/neovim/neovim/issues/18495
3. The mingw artifact is 10x bigger than the windows MSVC artifact:
   https://github.com/neovim/neovim/issues/10560
4. Our releases publish the MSVC (not mingw) artifact for Windows users:
   https://github.com/neovim/neovim/releases
5. Non-MSVCRT has limitations documented by libuv: http://docs.libuv.org/en/v1.x/process.html
   > On Windows file descriptors greater than 2 are available to the child process only if the child processes uses the MSVCRT runtime.

Closes https://github.com/neovim/neovim/issues/18551
2022-05-15 15:59:58 -07:00
59ba66d1ab ci(clint): remove checks for whitespace after comma/semicolon (#18584)
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-16 00:14:31 +02:00
5e3b16836a docs(api): nvim_set_hl attributes #18558 2022-05-15 14:06:06 -07:00
0a3d615b1c fix(api): nvim_eval_statusline should validate input #18347
Fix #18112

Make an exception for strings starting with "%!".
2022-05-15 13:06:23 -07:00
19da1071dc ci(clint): remove clint.py line length check #18574
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-15 12:01:29 -07:00
717560d221 Merge pull request #18581 from famiu/refactor/ui/vertsplit
refactor(ui)!: link `VertSplit` to `Normal` by default
2022-05-15 20:01:17 +02:00
bbf58e6bbc refactor(ui)!: link VertSplit to Normal by default
Avoids using `gui=reverse` on `VertSplit` and makes window separators
look much nicer by default.
2022-05-15 22:37:35 +06:00
a098e304b0 ci: enable tests on drafts as well #18566
previous: https://github.com/neovim/neovim/pull/14123

CI tests were disabled on drafts #18566 to manage the
large number of incoming jobs. While this did help, it had the drawback
of making the purpose of the ready-for-review a bit fuzzier. It went
from a clear "my PR is ready" signal to maintainers to somewhere between
"my PR is ready but I need the tests to confirm" to "please don't merge
yet, I just need to see the test results". Worse is that the specific
case of wanting to see the test results but not wanting it merged is
that this needs to be actively conveyed to the maintainers with a [DNM]
or a comment to not merge the PR yet. All of this causes weird
workarounds and noises which I believe isn't necessary.

The reason why I don't think this workaround is needed anymore is that
our CI now aborts a job if a new job from the same pull requests is
created, which makes the "10 simultaneous jobs per PR" situations that
triggered this not possible.
2022-05-15 08:18:38 -07:00
793496aecc fix PVS warnings (#18459)
* fix(PVS/V547): remove ifs that are always true or false

* fix(PVS/V560): remove partial conditions that are always true

* fix(PVS/V1044): suppress warning about loop break conditions

* fix(PVS/V1063): suppress "modulo by 1 operation is meaningless"

* fix(PVS/V568): suppress "operator evaluates the size of a pointer"

Also mark vim-patch:8.2.4958 as ported.
2022-05-15 21:04:56 +08:00
4c7462fdb3 build: enable EXITFREE on Debug builds (#17783)
This makes it more convenient to find memory leaks since you don't need
to remember to set the EXITFREE flag every time you use valgrind or a
sanitizer.
2022-05-15 11:41:17 +02:00
b1b5802009 build(gen_vimdoc): eliminate non-constant global variables (#17781) 2022-05-15 11:23:56 +02:00
0a66c4a72a docs(nvim_set_keymap): specify that optional arguments defaults to false (#18177)
Closes: https://github.com/neovim/neovim/issues/16919
2022-05-15 16:44:48 +08:00
bc45b5be1c vim-patch:partial: 30ab04e16e1e (#18568)
Update runtime files, new color schemes
30ab04e16e

Skip: doc/* (in-progress rewrite of the user manual on creating vim(9)script plugins)
2022-05-15 10:25:02 +02:00
0adc66171a refactor(uncrustify): enable formatting for regexp and indent files (#18549)
The formatting for these files were originally disabled as to signal
that "we don't own these files", meaning we intentionally want to
minimize the amount of work put in these files as the return will be
very little. This unfortunately conflicts with other refactoring efforts
that happen to touch these files, and it's easier to simply enable
formatting.
2022-05-14 20:35:39 +02:00
83da441d16 Merge pull request #18537 from dundargoc/ci/clint
ci(clint): remove check for include order
2022-05-14 19:09:33 +02:00
3bd7246f5a ci(clint): remove check for include order
Uncrustify and clang-format are already both excellent at ordering
includes; this isn't something we need to check for ourselves. Also
remove the section on include order in the dev-style documentation.
2022-05-14 15:09:02 +02:00
adf967331f ci(clint): fix all pyright warnings 2022-05-14 15:09:02 +02:00
d547e21f9e Merge pull request #18567 from zeertzjq/vim-8.2.4951
vim-patch:8.2.{4951,4953}: with 'si' inserting char after completion goes wrong
2022-05-14 20:48:05 +08:00
dca0412d37 vim-patch:8.2.4953: with 'si' inserting '}' after completion goes wrong
Problem:    With 'smartindent' inserting '}' after completion goes wrong.
Solution:   Check the cursor is in indent.  (closes vim/vim#10420)
2e444bbef0
2022-05-14 20:05:39 +08:00
24eb1af475 vim-patch:8.2.4951: smart indenting done when not enabled
Problem:    Smart indenting done when not enabled.
Solution:   Check option values before setting can_si. (closes vim/vim#10420)
de5cf28781
2022-05-14 20:05:39 +08:00
99f3e74fc2 Merge pull request #18542 from famiu/feat/api/nvim_cmd/kvec_t
refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline string
2022-05-14 11:20:13 +02:00
566f8f80d6 refactor(api/nvim_cmd): use kvec_t for constructing cmdline string
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-14 10:25:52 +06:00
Roj
9e4286294f build(nvim.desktop): central Kurdish translation #17065
Co-authored-by: Sarchia <74000088+Sarchia@users.noreply.github.com>
2022-05-13 11:58:22 -07:00
f6ba7d69be fix(man.vim): q in "$MANPAGER mode" does not quit #18443
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
    nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")

Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.

Fixes #18281
Ref #17791

Helped-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-05-13 07:49:08 -07:00
eb4b337d9e vim-patch:partial:3f32a5f1601a (#18555)
Update runtime files and translations
3f32a5f160

skip eval.txt (requires 8.2.4883)
2022-05-13 15:20:58 +02:00
c196119acb vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947)
Problem:    Search highlight disappears in the Visual area.
Solution:   Combine the search attributes. (closes vim/vim#8134)
2d5f385cee
2022-05-13 21:20:15 +08:00
2875d45e79 ci(commitlint): ignore "fixup" commits #18556 2022-05-13 05:37:33 -07:00
a33caf9b45 perf(_editor): no need to stop inside vim.defer_fn
uv_run:
1. remove timer handle from heap
2. will start again if repeat is not 0
2022-05-13 14:16:47 +08:00
030417d80b revert: "feat(mappings): do not simplify the rhs of a mapping" (#18553)
This reverts commit 7ac5359143.
This fix can cause more problems than it solves.
2022-05-13 11:31:17 +08:00
233c41cb8c feat(defaults): search selection by * and # in visual mode (#18538) 2022-05-13 08:28:10 +08:00
b96037e42d ci: remove remnants of gperf #18550
gperf was removed in 36613b888b
yay!
2022-05-12 16:55:27 -07:00
0d5d9e90ab fix(windows): stdpath("state") => "nvim-data" #18546
This was missed in https://github.com/neovim/neovim/pull/15583
2022-05-12 16:54:44 -07:00
aaeffba684 vim-patch:8.2.4943: changing 'switchbuf' may have no effect (#18545)
Problem:    Changing 'switchbuf' may have no effect.
Solution:   Handle 'switchbuf' in didset_string_options(). (Sean Dewar,
            closes vim/vim#10406)
39c46b4378

Guess it doesn't hurt to cherry-pick didset_string_options from v8.1.2045
(but in option.c, for now).
2022-05-13 00:41:20 +01:00
af9c1e572d Merge pull request #18489 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-13 00:14:46 +02:00
e2d3e73748 Merge pull request #18544 from bfredl/hashyhash
refactor(eval): use Hashy McHashFace instead of gperf
2022-05-12 21:24:33 +02:00
36613b888b refactor(eval): use Hashy McHashFace instead of gperf
this removes gperf as a build dependency
2022-05-12 20:01:04 +02:00
a9d25e9472 fix(lsp): perform client side filtering of code actions (#18392)
Implement filtering of actions based on the kind when passing the 'only'
parameter to code_action(). Action kinds are hierachical with a '.' as
the separator, and the filter thus allows, for example, both 'quickfix'
and 'quickfix.foo' when requestiong only 'quickfix'.

Fix https://github.com/neovim/neovim/pull/18221#issuecomment-1110179121
2022-05-12 18:48:02 +02:00
de5ccf2348 Merge pull request #18540 from zeertzjq/vim-8.2.4919
vim-patch:8.2.{4919,4921}: can add invalid bytes with :spellgood
2022-05-12 23:48:58 +08:00
0c8e48c78d chore(editorconfig): remove "charset" (#18541)
Hardcoding a charset causes trouble when porting Vim patches.
I previously tried to unset "charset" for certain file extensions, but
vim-patch.sh can generate more files, and automatically detecting file
encoding is more correct anyway.
2022-05-12 23:48:42 +08:00
a200ce0d85 vim-patch:8.2.4941: '[ and '] marks may be wrong after undo (#18539)
Problem:    '[ and '] marks may be wrong after undo.
Solution:   Adjust the '[ and '] marks if needed. (closes vim/vim#10407, closes vim/vim#1281)
82444cefa3
2022-05-12 23:38:26 +08:00
8c0510af71 vim-patch:8.2.4921: spell test fails because of new illegal byte check
Problem:    Spell test fails because of new illegal byte check.
Solution:   Remove the test.
fe978c2b6b
2022-05-12 23:09:41 +08:00
274f260806 vim-patch:8.2.4919: can add invalid bytes with :spellgood
Problem:    Can add invalid bytes with :spellgood.
Solution:   Check for a valid word string.
7c824682d2
2022-05-12 23:07:35 +08:00
8fba428bc6 fix(cmd): make :-tabmove work with modifiers (#18447)
`:tabmove` takes either an argument (`:tabmove -`) or an address (`:-tabmove`).

The code assumed that `:tabmove` is the first command on the cmdline, but that
is not the case when using additional modifiers like `:silent`.

Make the addr parsing more robust by searching the command first, then going
back to check for a potential address `-`.
2022-05-12 16:43:20 +02:00
78a1e6bc00 feat(defaults): session data in $XDG_STATE_HOME #15583
See: 4f2884e16d

- Move session persistent data to $XDG_STATE_HOME Change 'directory',
  'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to
  $XDG_STATE_HOME/nvim.
- Move logs to $XDG_STATE_HOME, too.
- Add stdpath('log') support.

Fixes: #14805
2022-05-12 07:13:45 -07:00
a1b663cce8 build(lua2dox): add parenthesis around parameter types in documentation (#18532)
This will check if the string after the variable in a @param is either
"number", "string", "table", "boolean" and "function" and if so add a
parenthesis around it. This will help separate the variable type with
the following text. Had all our functions been annotated with emmylua
then a more robust solution might have been preferable (such as always
assuming the third string is parameter type without making any checks).
I believe however this is a clear improvement over the current situation
and will suffice for now.
2022-05-12 08:02:46 -06:00
2bbd588e73 feat(lua): vim.cmd() with kwargs acts like nvim_cmd() #18523 2022-05-12 06:34:38 -07:00
963cfa7020 fix(terminal): invalid pointer comparison #18453
At the moment of comparison, the pointer save_curwin can be invalid (as
suggested by the comment) because it has been free'd. Worst, the new
curwin could have been re-allocated to that same pointer, altering the
execution flow unpredictably.

While there are many other potential similar cases to fix in the
codebase, the presented scenario is not hypothetical and does happen in
practice (while spawning new windows from fzf for instance).

There are numerous other instances of curwin comparisons in the
codebase, and they may need further investigation.

closes #16941
2022-05-12 05:53:08 -07:00
3a91adabda refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)
Most code in keymap.h is for keycode definitions, while most code in
keymap.c is for the parsing and conversion of keycodes.

The name "keymap" may also make people think these two files are for
mappings, while in fact keycodes are used even when no mappings are
involved, so "keycodes" should be a better file name than "keymap".
2022-05-12 20:19:29 +08:00
a2d4b862f1 ci(bsd): conditional runs for faster builds #18439
(undocumented) sourcehut feature for conditionally running consequent tasks.

ref:
https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C3cd90a91b7ce113bb3c5f07898c77543%40hacktivista.com%3E
https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/worker/tasks.go#L196-198
2022-05-11 18:26:07 -07:00
c24b442e31 fix(runtime/genvimvim): omit s[ubstitute] from vimCommand #18480
It's special cased by the vimSubst syntax group, and isn't present in Vim's
vimCommand group.

For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the
`s` is parsed as vimCommand rather than as vimUserFunc since
`contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update.

Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc.
Vim also has that problem, so it should ideally be fixed upstream.

We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but
it doesn't work in some cases, like when there's a `:` before the command. Also,
Vim matches only `g` in vimCommand for some reason, which doesn't produce any
highlight for `:global/foo/bar` (with Nvim you at least get some highlights on
the `global` bit despite the leading `:`).

Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems
to have no problems finding it.
2022-05-11 17:08:25 -07:00
60b1e314ed docs: nvim_buf_[get|set]_[text|lines] (#18404)
- Use consistent formatting for args docs.
- Clarify inclusivity/exclusivity in `nvim_buf_[get|set]_text`.
2022-05-11 17:05:56 -07:00
7900a8b713 docs(api): how to check if window is floating #18503 2022-05-11 16:49:19 -07:00
85aae12a6d refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-11 23:19:57 +02:00
cf68f0a512 fix(api): make nvim_cmd work correctly with empty arguments list (#18527)
Closes #18526.
2022-05-11 10:51:53 -06:00
a6f4cfdefa docs(api): improve shared lua functions docs (#17933) 2022-05-11 10:23:46 -06:00
e36e0f7b2f vim-patch:8.2.4939: matchfuzzypos() with "matchseq" does not have all positions (#18525)
Problem:    matchfuzzypos() with "matchseq" does not have all positions.
Solution:   Also add a position for white space. (closes vim/vim#10404)
9af2bc0751
2022-05-11 21:51:31 +08:00
b13089c956 Merge pull request #18522 from zeertzjq/vim-8.2.4901
vim-patch:8.2.{4901,4938}: NULL pointer access when using invalid pattern
2022-05-11 19:47:05 +08:00
6f52bc5dee vim-patch:8.2.4938: crash when matching buffer with invalid pattern
Problem:    Crash when matching buffer with invalid pattern.
Solution:   Check for NULL regprog.
a59f2dfd0c
2022-05-11 19:13:07 +08:00
0019886a84 vim-patch:8.2.4901: NULL pointer access when using invalid pattern
Problem:    NULL pointer access when using invalid pattern.
Solution:   Check for failed regexp program.
8e4b76da1d
2022-05-11 19:09:21 +08:00
96a125b207 Merge pull request #18366 from famiu/feat/api/nvim_cmd
feat(api): add `nvim_cmd`
2022-05-11 10:39:02 +02:00
3a5abcd649 chore: git-blame-ignore stylua format PR (#18516)
add aefdc6783c
to .git-blame-ignore-revs
2022-05-11 09:31:58 +02:00
dfcc584665 feat(api): add nvim_cmd
Adds the API function `nvim_cmd` which allows executing an Ex-command through a Dictionary which can have the same values as the return value of `nvim_parse_cmd()`. This makes it much easier to do things like passing arguments with a space to commands that otherwise may not allow it, or to make commands interpret certain characters literally when they otherwise would not.
2022-05-11 13:12:16 +06:00
39afa64eed build(deps): bump Luv to HEAD - c51e7052e (#18510) 2022-05-11 08:58:06 +02:00
cb7ab98925 Merge pull request #18487 from clason/stylua
CI: format and lint runtime with Stylua
2022-05-11 08:54:24 +02:00
e50b1fe60d vim-patch:921bde888046 (#18511)
Update runtime files, translations
921bde8880

skip: translations
skip: builtin.txt (requires 8.2.4861)
2022-05-10 10:55:33 +02:00
5359be7893 Merge pull request #18509 from zeertzjq/vim-8.2.4929
vim-patch:8.2.4929: off-by-one error in in statusline item
2022-05-10 08:54:37 +08:00
65df08aade test: convert two statusline oldtests to Lua screen tests 2022-05-10 08:15:46 +08:00
406c2e35b3 vim-patch:8.2.4929: off-by-one error in in statusline item
Problem:    Off-by-one error in in statusline item.
Solution:   Subtrace one less. (closes vim/vim#10394, closes vim/vim#5599)
57ff52677b
2022-05-10 07:59:43 +08:00
9aa5647e68 vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)
Problem:    The mode #defines are not clearly named.
Solution:   Prepend MODE_.  Renumber them to put the mapped modes first.
249591057b

A hunk from the patch depends on patch 8.2.4861, which hasn't been
ported yet, but that should be easy to notice.
2022-05-10 07:58:58 +08:00
c55867b46d docs(lsp): fix description of only in vim.lsp.buf.code_action() (#18492) 2022-05-09 18:08:04 +02:00
aefdc6783c chore: format runtime with stylua 2022-05-09 16:31:55 +02:00
676e9e9334 ci: lint runtime with stylua 2022-05-09 16:31:55 +02:00
77863b8e96 feat(keyset): allow hash conflicts 2022-05-09 19:53:47 +06:00
8658e82357 vim-patch:8.2.4925: trailing backslash may cause reading past end of line (#18493)
Problem:    Trailing backslash may cause reading past end of line.
Solution:   Check for NUL after backslash.
53a70289c2

N/A patches for version.c:

vim-patch:8.2.4926: #ifdef for crypt feature around too many lines

Problem:    #ifdef for crypt feature around too many lines.
Solution:   Move code outside of #ifdef. (closes vim/vim#10388)
51f0bc31d3
2022-05-09 21:10:53 +08:00
f0135d9cd9 Merge pull request #18491 from zeertzjq/vim-8.2.4924
vim-patch:8.2.4924: maparg() may return a string that cannot be reused
2022-05-09 19:44:31 +08:00
db506d991d vim-patch:8.2.4924: maparg() may return a string that cannot be reused
Problem:    maparg() may return a string that cannot be reused.
Solution:   use msg_outtrans_special() instead of str2special().
            (closes vim/vim#10384)
0519ce0039
2022-05-09 19:19:21 +08:00
41ce7b07e2 Merge pull request #18490 from zeertzjq/vim-8.2.4918
vim-patch:8.2.{4918,4923}: conceal character from matchadd() displayed too many times
2022-05-09 18:39:32 +08:00
79929cf44d vim-patch:8.2.4923: test checks for terminal feature unnecessarily
Problem:    Test checks for terminal feature unnecessarily.
Solution:   Remove CheckRunVimInTerminal. (closes vim/vim#10383)
194843028e
2022-05-09 18:07:09 +08:00
a56a43614c vim-patch:8.2.4918: conceal character from matchadd() displayed too many times
Problem:    Conceal character from matchadd() displayed too many times.
Solution:   Check the syntax flag. (closes vim/vim#10381, closes vim/vim#7268)
9830db6305
2022-05-09 18:06:55 +08:00
5382ed8028 Merge pull request #18485 from zeertzjq/vim-8.2.4915
vim-patch:8.2.{4916,4922}: mouse in Insert mode test fails
2022-05-09 17:42:06 +08:00
84c031fade vim-patch:8.2.4922: mouse test fails on MS-Windows
Problem:    Mouse test fails on MS-Windows.
Solution:   Set 'mousemodel' to "extend".
b370771bff
2022-05-09 17:16:22 +08:00
a501127899 vim-patch:8.2.4916: mouse in Insert mode test fails
Problem:    Mouse in Insert mode test fails.
Solution:   Fix the text and check relevant positions.
8e8dc9b323

Use nvim_input_mouse() to set mouse position, and discard mouse event
using getchar().
2022-05-09 17:16:22 +08:00
dfeb5b47bc Merge pull request #18466 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-09 10:29:51 +02:00
e31b32a293 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-09 10:03:29 +02:00
dbdd58e548 feat: cmdline funcs (#18284)
vim-patch:8.2.4903: cannot get the current cmdline completion type and position

Problem:    Cannot get the current cmdline completion type and position.
Solution:   Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
            closes vim/vim#10344)
79d599b877

vim-patch:8.2.4910: imperfect coding

Problem:    Imperfect coding.
Solution:   Make code nicer.
9ff7d717aa
2022-05-09 12:52:31 +08:00
f6be28c61a Merge pull request #18478 from bfredl/gridfile
refactor(grid): move out grid_* functions from screen.c
2022-05-09 00:44:33 +02:00
6cfb1d4c28 fix(lsp): detach spawned LSP server processes (#18477)
LSP servers should be daemonized (detached) so that they run in a
separate process group from Neovim's. Among other things, this ensures
the process does not inherit Neovim's TTY (#18475).

Make this configurable so that clients can explicitly opt-out of
detaching from Nvim.
2022-05-08 13:00:30 -06:00
df41d884a7 refactor(grid): move out grid_* functions from screen.c
Also normalize some types. use "size_t" for unsigned array offsets.
Fix -Wconversion issues missed as screen.c is missing this check.
2022-05-08 13:22:09 +02:00
0d3f17a6c3 vim-patch:partial:d899e5112079 (#18474)
Update runtime files
d899e51120

- Skip vimhelp.vim stuff (syntax/help.vim, syntax.txt; v8.2.4891).
- Skip :let heredoc eval stuff (eval.txt; v8.2.4770).
- Skip uk.cp1251.po.
- Skip `*hl-CurSearch*` change (syntax.txt):
  - Vim's CurSearch works differently (Nvim's uses current cursor pos).
    Dunno know how applicable the redrawing comment is to Nvim...
  - Might be preferred to move it under `*hl-Search*` like Vim?
2022-05-08 10:15:36 +01:00
1b1cc4d864 vim-patch:8.2.4908: no text formatting for // comment after a statement (#18472)
Problem:    No text formatting for // comment after a statement.
Solution:   format a comment when the 'c' flag is in 'formatoptions'.
48a8a83303
2022-05-08 07:51:12 +08:00
0a00792332 vim-patch:8.2.4907: some users do not want a line comment always inserted (#18463)
Problem:    Some users do not want a line comment always inserted.
Solution:   Add the '/' flag to 'formatoptions' to not repeat the comment
            leader after a statement when using "o".
2bf875f881
2022-05-07 16:49:36 +02:00
03471e292d Merge pull request #18425 from dundargoc/refactor/char_u/1
refactor: replace char_u variables and functions with char
2022-05-07 16:40:00 +02:00
eccb989689 Merge pull request #18460 from bfredl/decor33
refactor(decor): use decor levels properly
2022-05-07 14:57:23 +02:00
2a378e6e82 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-07 14:54:01 +02:00
add3ad6a48 Merge pull request #18450 from dundargoc/build/clint/remove-function-size-warning
build(clint): remove "function size is too large" warning
2022-05-07 14:21:01 +02:00
5e2346178c refactor(decor): use decor levels properly 2022-05-07 14:08:21 +02:00
d306210641 docs: change wrap_at type to number (#18456) 2022-05-07 10:35:08 +02:00
6c39f9d427 Merge pull request #18457 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` work correctly with both range and count
2022-05-07 09:46:06 +02:00
14f3383c0d fix(api): make nvim_parse_cmd work correctly with both range and count
It seems range and count can be used together in commands. This PR fixes
the behavior of `nvim_parse_cmd` for those cases by removing the mutual
exclusivity of "range" and "count". It also removes range line number
validation for `nvim_parse_cmd` as it's not its job to validate the
command.
2022-05-07 12:26:49 +06:00
cd8edb551b Merge pull request #18455 from zeertzjq/extmarksplice
fix(extmarks): revert to int for extmark row
2022-05-07 11:09:08 +08:00
f1bc321b56 Merge pull request #18444 from zeertzjq/ci-unsigned-char
ci: add a check with -funsigned-char
2022-05-06 22:47:24 -04:00
f5ed1b3908 fix(extmarks): revert to int for extmark row 2022-05-07 09:55:13 +08:00
b2a8ed0855 Merge pull request #18452 from dundargoc/vim-8.2.4469
vim-patch:8.2.4469: Coverity warns for uninitialized variable
2022-05-07 06:47:56 +08:00
11631354cb vim-patch:8.2.4469: Coverity warns for uninitialized variable
Problem:    Coverity warns for uninitialized variable.
Solution:   Set the value to zero.
05c1734c4f
2022-05-06 23:17:56 +02:00
44a4af0ed0 fix(lsp): skip clients without rename capability (#18449)
Follow up to https://github.com/neovim/neovim/pull/18441
This way rename should "just work" in most cases without having to
manually filter the client
2022-05-06 18:57:08 +02:00
d0897243f6 build(clint): remove "function size is too large" warning
This warning is essentially only triggered for ported vim functions.
It's unlikely that we'll refactor vim functions solely based on their
size since it'd mean we'd greatly deviate from vim, which is a high cost
when it comes to importing the vim patches. Thus, this warning only
serves as an annoyance and should be removed.
2022-05-06 18:03:57 +02:00
d9ec57e16a Merge pull request #18302 from dundargoc/refactor/enable-conversion-warning/edit
refactor: enable -Wconversion warning for edit.c
2022-05-06 15:00:40 +02:00
7978660efb vim-patch:8.2.4881: "P" in Visual mode still changes some registers (#18445)
Problem:    "P" in Visual mode still changes some registers.
Solution:   Make "P" in Visual mode not change any register. (Shougo
            Matsushita, closes vim/vim#10349)
509142ab7a
2022-05-06 19:26:28 +08:00
21a31ea929 refactor: enable -Wconversion warning for edit.c
Work on https://github.com/neovim/neovim/issues/567
2022-05-06 11:00:29 +02:00
8bbeab9989 Merge pull request #18442 from dundargoc/uncrustify
refactor: upgrade uncrustify configuration to version 0.75
2022-05-06 10:41:51 +02:00
e3edcd06e3 Merge pull request #18438 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` propagate errors
2022-05-06 10:30:48 +02:00
21abb24bd0 ci: add a check with -funsigned-char 2022-05-06 08:49:26 +08:00
544ef994df refactor: upgrade uncrustify configuration to version 0.75 2022-05-06 00:46:30 +02:00
eb0cc2a62e refactor: move macro definiton outside of enums
Uncrustify version 0.75 assumes the macro inside the enum is an enum
element, and thus adds a comma after it. This breaks neovim and makes it
impossible to build it.
2022-05-06 00:45:57 +02:00
55187de115 fix(lsp): fix rename capability checks and multi client support (#18441)
Adds filter and id options to filter the client to use for rename.
Similar to the recently added `format` function.

rename will use all matching clients one after another and can handle a
mix of prepareRename/rename support. Also ensures the right
`offset_encoding` is used for the `make_position_params` calls
2022-05-05 23:56:00 +02:00
d14d308ce8 Merge pull request #18431 from famiu/feat/api/nvim_get_autocmds/group_name
feat(api): add `group_name` to `nvim_get_autocmds`
2022-05-05 20:17:11 +02:00
96289f2416 feat(api): add group_name to nvim_get_autocmds 2022-05-05 23:17:36 +06:00
511f06a56e fix(api): make nvim_parse_cmd propagate errors
Makes `nvim_parse_cmd` propagate any errors that occur while parsing to
give the user a better idea of what's wrong with the command.
2022-05-05 23:11:57 +06:00
94eb72cc44 fix(lsp): make sure to always reset active codelens refreshes (#18331)
This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.

Examples of how such scenarios would occur are:
  - A textDocument/codeLens result yielded an error.
  - The 'textDocument/codeLens' handler was overriden in such a way that
    it no longer called vim.lsp.codelens.on_codelens().
2022-05-05 18:50:12 +02:00
b2fb3614b0 Revert "ci(bsd): conditional runs for faster builds" #18437
The change has a syntax error.

This reverts commit 3e3e9c3125.
2022-05-05 09:47:53 -07:00
d4f47fe17d Merge pull request #18416 from dundargoc/refactor/remove-char_u
refactor/remove char u
2022-05-05 18:42:00 +02:00
3e3e9c3125 ci(bsd): conditional runs for faster builds #18434
sourcehut undocumented feature for conditionally running tasks.

The current condition is based on git's pathspec, see `man gitglossary(7)`, to
skip commits that only changed files under `.github/*`.

refs
- https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
- https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C3cd90a91b7ce113bb3c5f07898c77543%40hacktivista.com%3E
- https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/worker/tasks.go#L196-198
2022-05-05 09:35:14 -07:00
7fa8109881 Merge pull request #18314 from tk-shirasaka/global-statusline-on-ext_messages
fix: display global statusline correctly with ext_messages
2022-05-05 18:33:52 +02:00
9a671e6a24 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-05 18:10:46 +02:00
1eecea8449 Merge pull request #18417 from famiu/feat/api/nvim_parse_cmd
refactor(api): make `range` in `nvim_parse_cmd` an array
2022-05-05 17:31:02 +02:00
7aedcd8feb refactor(api): make range in nvim_parse_cmd an array
Changes the `range` value in `nvim_parse_cmd` into an array to describe
range information more concisely. Also makes `range` and `count` be
mutually exclusive by making count `-1` when command takes a range
instead of a count. Additionally corrects the behavior of `count` for
built-in commands by making the default count `0`.
2022-05-05 20:35:14 +06:00
82c7a82c35 vim-patch:8.2.4868: when closing help window autocmds triggered for wrong window (#18420)
Problem:    When closing help window autocmds triggered for the wrong window.
Solution:   Figure out the new current window earlier. (closes vim/vim#10348)
2a2707d033
2022-05-05 07:26:42 +08:00
beb8f48489 vim-patch:8.2.4867: listing of mapping with K_SPECIAL is wrong (#18419)
Problem:    Listing of mapping with K_SPECIAL is wrong.
Solution:   Adjust escaping of special characters. (closes vim/vim#10351)
ac402f4d64

Avoid overshadowing.
Cherry-pick Test_list_mapping() from Vim patches 8.2.{0148,2994}.
Fix rhs_is_noop.
2022-05-05 07:23:27 +08:00
6798f1fab0 vim-patch:8.2.4865: :startinsert right after :stopinsert may not work (#18418)
Problem:    :startinsert right after :stopinsert does not work when popup menu
            is still visible.
Solution:   Use ins_compl_active() instead of pum_visible(). (closes vim/vim#10352)
cd5dbad184
2022-05-05 06:58:20 +08:00
b5957c3c32 fix: display global statusline correctly with ext_messages 2022-05-05 06:15:09 +09:00
e6c71574a0 Merge pull request #18386 from ii14/version_dict_prerelease
feat: add "prerelease" to version dict
2022-05-04 18:49:05 +02:00
f98149d87a Merge pull request #18413 from dundargoc/refactor/remove-char_u-autocmd
refactor/remove char u autocmd
2022-05-04 10:23:21 -06:00
f08477789f refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-04 17:49:37 +02:00
4f17e7e1c3 Merge pull request #18387 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-04 17:34:25 +02:00
5576d30e89 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-04 15:25:54 +02:00
3ec93ca92c feat(nvim_parse_cmd): add range, count, reg #18383
Adds range, count and reg to the return values of nvim_parse_cmd. Also makes
line1 and line2 be -1 if the command does not take a range. Also moves
nvim_parse_cmd to vimscript.c because it fits better there.
2022-05-04 05:04:01 -07:00
95b7851f62 build(deps): bump LuaJIT to HEAD - 91bc6b8ad (#18378) 2022-05-04 08:38:07 +02:00
c051ea83dd refactor(lua): replace hard-coded gsub with vim.pesc() (#18407) 2022-05-04 08:13:01 +02:00
815b65d777 fix(filetype): fixup scd filetype detection (#18403) 2022-05-03 23:03:42 +02:00
9005ffbe77 Merge pull request #18398 from vigoux/perf/ts_reuse_list
perf(treesitter): use a reuse list for query cursors
2022-05-03 21:11:10 +02:00
8ef03188e6 refactor(runtime): convert dist#ft functions to lua (#18247)
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-05-03 12:29:04 -06:00
1924883796 Merge pull request #18397 from vigoux/fix/ts_match_limit
fix(treesitter): bump match limit up
2022-05-03 20:18:15 +02:00
a0f17fd4d8 perf(treesitter): use a reuse list for query cursors 2022-05-03 19:51:30 +02:00
e453b6391e fix(treesitter): bump match limit up
This avoids ignoring too many match results, and avoid highlighting
being blank in some files.
2022-05-03 19:46:11 +02:00
4df11463b2 Merge pull request #15674 from yatli/ui_event_extmark
API/UI: ui_event_extmark
2022-05-03 16:59:24 +02:00
70e2c5d10d feat(lsp): add logging level "OFF" (#18379) 2022-05-03 08:49:23 -06:00
29a6cda3ff feat(api/ui): win_extmarks 2022-05-03 22:26:02 +08:00
73741e9486 feat(lua): vim.deprecate() #18320
This is primarily intended to act as documentation for the developer so
they know exactly when and what to remove. This will help prevent the
situation of deprecated code lingering for far too long as developers
don't have to worry if a function is safe to remove.
2022-05-03 06:42:41 -07:00
4fb48c5654 feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
2022-05-03 06:08:35 -07:00
b5c15ba7e5 fix(lsp): add missing bufnr argument (#18382) 2022-05-03 08:54:49 -04:00
20aaa59fb3 ci(MinGW): run pacman -Syu twice (#18384) 2022-05-03 20:38:24 +08:00
b2c92f36e1 feat: add "prerelease" to version dict 2022-05-03 11:33:55 +02:00
8ea84eee57 Merge pull request #18345 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-03 11:02:04 +02:00
b9bdd0f61e refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-03 10:33:40 +02:00
46734cf7c1 vim-patch:8.2.4859: wget2 files are not recognized (#18385)
Problem:    wget2 files are not recognized.
Solution:   Add patterns to recognize wget2. (Doug Kearns)
3a974a8933
2022-05-03 10:23:11 +02:00
13520aae16 fix(coverity): use xstrndup() instead of vim_strsave() (#18363) 2022-05-03 09:29:55 +08:00
cf474021ed Merge pull request #18381 from zeertzjq/vim-8.2.4858
vim-patch:8.2.4858: K_SPECIAL may be escaped twice
2022-05-03 07:30:12 +08:00
15602a7ce4 test: add more tests for K_SPECIAL escaping in <Cmd> mapping 2022-05-03 06:44:14 +08:00
27149e0071 vim-patch:8.2.4858: K_SPECIAL may be escaped twice
Problem:    K_SPECIAL may be escaped twice.
Solution:   Avoid double escaping. (closes vim/vim#10340)
db08887f24
2022-05-03 06:21:50 +08:00
ddf7bb24f9 Merge pull request #18357 from bfredl/ui_stdin
feat(ui): allow embedder to emulate "cat data | nvim -" behaviour
2022-05-02 23:24:37 +02:00
ad63b94b03 refactor(ui): simplify stdin handling 2022-05-02 22:19:41 +02:00
a1542b091d Merge pull request #18353 from jamessan/ft-match-fix 2022-05-02 11:01:51 -04:00
619c8f4b91 feat(api): support handling stdin stream in remote ui 2022-05-02 16:27:29 +02:00
88595fbb21 fix(filetype.lua): escape expansion of ~ when used as a pattern 2022-05-02 08:38:35 -04:00
af53fa0663 Merge pull request #18342 from kylo252/msgpack-bump
build: bump msgpack to 4.0.0
2022-05-02 08:10:51 -04:00
e6d62d5a3d vim-patch:8.2.4857: Yaml indent for multiline is wrong (#18365)
Problem:    Yaml indent for multiline is wrong.
Solution:   Adjust patterns. (closes vim/vim#10328, closes vim/vim#8740)
f4f579b46b
2022-05-02 13:57:33 +02:00
d23ce6ef76 vim-patch:8.2.4855: robot files are not recognized (#18364)
Problem:    Robot files are not recognized.
Solution:   Add patterns for robot files. (Zoe Roux, closes vim/vim#10339)
2096a5f128
2022-05-02 13:54:07 +02:00
e5f6f20968 Merge pull request #18356 from dundargoc/ci/gen_vimdoc/conda-edge-case
build(gen_vimdoc): handle conda edge case when parsing doxygen version
2022-05-02 06:24:54 -04:00
40864126d5 fix(mac): add CoreServices to flake.nix #18358
The `include` was added in e038625b87
2022-05-02 03:17:38 -07:00
59162584b1 build(gen_vimdoc): print user's doxygen version if it's too old
@theHamsta suggested in
https://github.com/neovim/neovim/pull/18348#discussion_r862594173 to
also print the users doxygen version if the version is too old.
2022-05-02 11:17:06 +02:00
327a6d885c vim-patch:8.2.1835: ":help ??" finds the "!!" tag (#18350)
* vim-patch:8.2.1835: ":help ??" finds the "!!" tag

Problem:    ":help ??" finds the "!!" tag.
Solution:   Do not translate "?" into ".".  (Naruhiko Nishino, closes vim/vim#7114,
            closes vim/vim#7115)
6eb36ade98

Change test because patch 8.2.1794 hasn't been ported yet.
2022-05-02 17:01:40 +08:00
649cdc14ba ci(gen_vimdoc): handle edge case when checking doxygen version
When checking the version of the doxygen installed from conda the output
has the following format:

1.9.2 (ee54ebd4f0ad83d9c44f19a459146de64d0ffba2*)

This would cause an error in the "Missing API docs" CI job. This fix
will correctly parse the doxygen version for both stable releases
("1.9.2") as well as the version with the git commit hash attached.
2022-05-02 10:58:40 +02:00
1e970c003f vim-patch:8.2.3306: unexpected "No matching autocommands" (#17912)
Problem:    Unexpected "No matching autocommands".
Solution:   Do not give the message when aborting.  Mention the arguments in
            the message. (closes vim/vim#8690)
1b154ea121
2022-05-02 16:39:05 +08:00
a23440bf7c Merge pull request #18354 from famiu/feat/api/parse_cmd
fix(api): make `nvim_parse_cmd` preserve command modifiers
2022-05-02 08:27:20 +02:00
bfb72f637b fix(api): preserve cmdmod on nvim_parse_cmd 2022-05-02 11:46:24 +06:00
371dfb1746 Merge pull request #18294 from mhinz/mac/simpler-locale-fallback
fix(mac): use same $LANG fallback mechanism as Vim
2022-05-01 19:15:11 -04:00
c04b979331 Merge pull request #18348 from dundargoc/build/abort-if-old-doxygen
build(gen_vimdoc): abort if doxygen version is too old
2022-05-01 18:47:43 -04:00
069da468d5 fix(shared): avoid indexing unindexable values in vim.tbl_get() (#18337) 2022-05-01 21:08:05 +02:00
5fc251daeb build(gen_vimdoc): abort if doxygen version is too old
There have been a few instances where developers got confused as to why
their generated documentation differs from the one generated by the CI.
More often than not, the reason is that their doxygen version is older
than 1.9.0, which is the current minimum version. Having a simple
version check will help save future developers avoid this problem.
2022-05-01 18:05:12 +02:00
651b595271 build: bump msgpack to 4.0.0
see https://github.com/msgpack/msgpack-c/releases/tag/c-4.0.0
2022-05-01 13:40:10 +02:00
65b4bf055f docs: syntax is enabled by default (#17637)
`:syntax enable` is no longer necessary (and may even be harmful). Do not recommend it in `usr_05.txt` and `usr_06.txt`, and mention the new default in `syntax.txt`.
2022-05-01 13:31:49 +02:00
d9dcfd0219 Merge pull request #18334 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-01 10:35:48 +02:00
07660193a3 chore(editorconfig): unset "charset" for *.vim and *.po files
There  are *.vim and *.po files ported from Vim that use a non-UTF-8 encoding.
2022-05-01 12:57:55 +08:00
7502f1cae0 docs(api): more API attributes #18336 2022-04-30 16:16:16 -07:00
7e10b0dae6 docs: move "hl-VertSplit" to deprecated.txt #18328 2022-04-30 15:23:30 -07:00
af782a6306 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-30 23:39:17 +02:00
039d60bd9c fix(lsp): fix infinite loop in resolved_capabilities deprecation message (#18333)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-04-30 23:22:47 +02:00
0344736aa6 fix(lsp): handle textDocumentSync.save bool capability (#18332)
Follow up to https://github.com/neovim/neovim/pull/17814
2022-04-30 22:13:26 +02:00
cc27540560 Merge pull request #18231 from famiu/feat/api/parse_cmdline
feat(api): `nvim_parse_cmd`
2022-04-30 18:41:17 +02:00
872622bcdb vim-patch:8.2.4849: Gleam filetype not detected (#18326)
Problem:    Gleam filetype not detected.
Solution:   Add a pattern for Gleam files. (Mathias Jean Johansen,
            closes vim/vim#10326)
917c32c4f7
2022-04-30 17:31:53 +02:00
88411613e2 feat(lsp): add async option to vim.lsp.buf.format (#18322)
Deprecates the existing `vim.lsp.buf.formatting` function.
With this, `vim.lsp.buf.format` will replace all three:

- vim.lsp.buf.formatting
- vim.lsp.buf.formatting_sync
- vim.lsp.buf.formatting_seq_sync
2022-04-30 17:23:50 +02:00
338b903219 Merge pull request #18323 from zeertzjq/vim-8.1.2191
vim-patch:8.1.2191,8.2.4848: mappings for completion keys not ignored
2022-04-30 23:09:58 +08:00
8dbb11ebf6 feat(api): add nvim_parse_cmdline
Adds an API function to parse a command line string and get command information from it.
2022-04-30 21:04:51 +06:00
3c23100130 refactor: replace char_u variables and functions with char (#18288)
Work on https://github.com/neovim/neovim/issues/459
2022-04-30 16:48:00 +02:00
0b12f6d7be vim-patch:8.2.4848: local completion with mappings and simplification not working
Problem:    Local completion with mappings and simplification not working.
Solution:   Fix local completion <C-N>/<C-P> mappings not ignored if keys are
            not simplified. (closes vim/vim#10323)
ee44603069
2022-04-30 22:27:27 +08:00
db355ca4e5 vim-patch:8.1.2191: when using modifyOtherKeys CTRL-X mode may not work
Problem:    When using modifyOtherKeys CTRL-X mode may not work.
Solution:   Recognize a control character also in the form with a modifier.
88d3d09e07
2022-04-30 22:27:27 +08:00
fcdf24d8be fix(tui): disable extended keys before exiting alternate screen (#18318) 2022-04-30 22:18:14 +08:00
5b04e46d23 feat(lsp): add vim.lsp.buf.format (#18193) 2022-04-30 15:36:40 +02:00
eecc6535eb fix(handlers): more specific error messages (#16772)
Specify which message, or request, was last received in case of an error
instead of the same generic message
2022-04-30 13:55:26 +02:00
c618b314c6 chore(lsp): remove capabilities sanitization (#17814)
* feat(lsp)!: remove capabilities sanitization

Users must now access client.server_capabilities which matches the same
structure as the protocol.

https://microsoft.github.io/language-server-protocol/specification

client.resolved_capabilities is no longer used to gate capabilities, and
will be removed in a future release.

BREAKING CHANGE


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-04-30 11:22:30 +02:00
df09e03cf7 feat(lsp): options to filter and auto-apply code actions (#18221)
Implement two new options to vim.lsp.buf.code_action():
 - filter (function): predicate taking an Action as input, and returning
   a boolean.
 - apply (boolean): when set to true, and there is just one remaining
   action (after filtering), the action is applied without user query.

These options can, for example, be used to filter out, and automatically
apply, the action indicated by the server to be preferred:

    vim.lsp.buf.code_action({
        filter = function(action)
            return action.isPreferred
        end,
        apply = true,
    })

Fix #17514.
2022-04-30 10:14:31 +02:00
de2232878f vim-patch:8.2.0144: some mapping code is not fully tested (#18313)
Problem:    Some mapping code is not fully tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5519)
c2a60ae10e
2022-04-30 14:00:53 +08:00
2ba539f449 fix(input): only disable mapped CTRL-C interrupts when getting input (#18310) 2022-04-30 13:11:35 +08:00
7df25a1372 Merge pull request #18309 from zeertzjq/vim-8.2.4845
vim-patch:8.2.{4844,4845,4846}
2022-04-30 07:04:53 +08:00
1f72e31550 vim-patch:8.2.4845: duplicate code
Problem:    Duplicate code.
Solution:   Move code below if/else. (closes vim/vim#10314)
590f365f91

N/A patches for version.c:

vim-patch:8.2.4844: <C-S-I> is simplified to <S-Tab>

Problem:    <C-S-I> is simplified to <S-Tab>.
Solution:   Do not simplify CTRL if there is also SHIFT. (closes vim/vim#10313)
758a8d1999

vim-patch:8.2.4846: termcodes test fails

Problem:    Termcodes test fails.
Solution:   use CTRL-SHIFT-V to insert an unsimplified key. (closes vim/vim#10316)
bad8a013c2
2022-04-30 06:07:00 +08:00
02e9a402ca test: add test for <Cmd> mapping with character containing K_SPECIAL byte 2022-04-30 06:06:11 +08:00
9a1920e223 feat(lsp): show feedback on empty hover response (#18308)
Without any feedback it gives the impression that the language server is
not working properly, which isn't the case.
2022-04-29 23:04:00 +02:00
6d4180a0d2 Merge pull request #18162 from dundargoc/refactor/unctustify
refactor/uncrustify
2022-04-29 19:33:05 +02:00
d5dc3dad80 Merge pull request #18305 from zeertzjq/mapping-rhs
feat(mappings): do not simplify the rhs of a mapping
2022-04-29 22:10:25 +08:00
7ac5359143 feat(mappings): do not simplify the rhs of a mapping 2022-04-29 21:12:48 +08:00
98f62a2cfa feat(mappings): allow special keys and modifiers in <Cmd> mapping 2022-04-29 21:12:48 +08:00
eef8de4df0 refactor(uncrustify): change rules to better align with the style guide
Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
2022-04-29 14:13:06 +02:00
0b3ae64480 refactor(uncrustify): format all c code under /src/nvim/ 2022-04-29 13:52:43 +02:00
995c186368 refactor(uncrustify): disable formatting in problematic code sections 2022-04-29 13:52:12 +02:00
8c548c9e54 Merge pull request #18301 from zeertzjq/fix-lua-unmap-crash
fix(mappings): fix double-free when unmapping simplifiable Lua mapping
2022-04-29 18:09:25 +08:00
c8e45366b9 fix(mappings): fix double-free when unmapping simplifiable Lua mapping 2022-04-29 17:39:24 +08:00
35a7b0f9b9 Merge pull request #17932 from zeertzjq/vim-8.1.2145
vim-patch:8.1.{2145,2159,2165,2167,2333,2346,2350},8.2.{0839,0851,0855,0867,0916,0919,2084,2728,3595,4504,4819,4824,4827,4828,4829,4833,4837}
2022-04-29 17:13:28 +08:00
c671822d4d ci: remove mjlbach from reviewers (#18297) 2022-04-29 10:48:12 +02:00
3601cef137 feat(mappings): do not replace existing mapping for simplified form 2022-04-29 15:51:04 +08:00
4adf2123dd vim-patch:8.2.4837: modifiers not simplified when timed out
Problem:    Modifiers not simplified when timed out or using feedkeys() with
            'n" flag.
Solution:   Adjust how mapped flag and timeout are used. (closes vim/vim#10305)
68a573ce2b
2022-04-29 15:51:04 +08:00
1d97781dc5 vim-patch:8.2.4833: failure of mapping not checked for
Problem:    Failure of mapping not checked for.
Solution:   Check return value of ins_typebuf(). (closes vim/vim#10299)
12e21e387b
2022-04-29 15:51:04 +08:00
bf065d9bb6 vim-patch:8.2.4829: a key may be simplified to NUL
Problem:    A key may be simplified to NUL.
Solution:   Use K_ZERO instead.  Use macros instead of hard coded values.
            (closes vim/vim#10290)
17c95d9608
2022-04-29 15:51:04 +08:00
f2b512ad75 vim-patch:8.2.4828: fix for unmapping simplified key not fully tested
Problem:    Fix for unmapping simplified key not fully tested.
Solution:   Add a test case. (closes vim/vim#10292)
abeb09b2c5
2022-04-29 15:51:04 +08:00
11b5a376bc vim-patch:8.2.4827: typo in variable name
Problem:    Typo in variable name. (Gabriel Dupras)
Solution:   Rename the variable.
87f74106f9
2022-04-29 15:51:04 +08:00
e38cddc989 vim-patch:8.2.4824: expression is evaluated multiple times
Problem:    Expression is evaluated multiple times.
Solution:   Evaluate expression once and store the result. (closes vim/vim#10278)
23d5770ef5
2022-04-29 15:51:04 +08:00
c14d89f306 vim-patch:8.2.4819: unmapping simplified keys also deletes other mapping
Problem:    Unmapping simplified keys also deletes other mapping.
Solution:   Only unmap a mapping with m_simplified set. (closes vim/vim#10270)
a4e3332650
2022-04-29 15:51:04 +08:00
04a437b280 vim-patch:8.2.4504: when there is a partially matching map full map may not work
Problem:    When there is a partially matching map and modifyOtherKeys is
            active a full map may not work.
Solution:   Only simplify modifiers when there is no matching mapping.
            (closes vim/vim#8792)
196c3850db

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
096923e990 vim-patch:8.2.3595: check for signed overflow might not work everywhere
Problem:    Check for signed overflow might not work everywhere.
Solution:   Limit to 32 bit int. (closes vim/vim#9043, closes vim/vim#9067)
0d5a12ea04
2022-04-29 15:51:04 +08:00
4531ddaa62 vim-patch:8.2.2728: special key names don't work if 'isident' is cleared
Problem:    Special key names don't work if 'isident' is cleared.
Solution:   Add vim_isNormalIDc() and use it for special key names.
            (closes vim/vim#2389)
e3d1f4c982

Code is N/A as Nvim already has ascii_isident(), so just port the test.
2022-04-29 15:51:04 +08:00
78a7e2d55c vim-patch:8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Problem:    CTRL-R CTRL-R doesn't work with modifyOtherKeys.
Solution:   Allow key codes when fetching argument for CTRL-R. (closes vim/vim#5266)
            Also fix CTRL-G in Insert mode.
38571a04b4

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
3090648584 test: revert test and doc changes from #6724, add a test for #6716
Multi-char 'pastetoggle' now works without breaking character-find.
2022-04-29 15:51:04 +08:00
9660ddd512 vim-patch:8.2.0919: merging modifier for modifyOtherKeys is done twice
Problem:    Merging modifier for modifyOtherKeys is done twice.
Solution:   Remove the merging done in vgetc().
673fc3e23f

Omit ex_getln.c change as it was removed in patch 8.2.2084, so
no_reduce_keys is still not needed in Nvim.
2022-04-29 15:51:04 +08:00
32da3e56cd vim-patch:8.2.0916: mapping with partly modifyOtherKeys code does not work
Problem:    Mapping with partly modifyOtherKeys code does not work.
Solution:   If there is no mapping with a separate modifier include the
            modifier in the key and then try mapping again. (closes vim/vim#6200)
975a880a13

Cherry-pick applicable part of put_string_in_typebuf().
Revert related changes from 10a5825.
Use KEYLEN_PART_KEY for incomplete modifier sequence.
Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
f6afc7c324 revert: "refactor: Remove allow_keys global (#6346)" 2022-04-29 15:51:04 +08:00
d531ef6813 vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice
Problem:    Using \{xxx} for encoding a modifier is not nice.
Solution:   Use \<*xxx> instead, since it's the same as \<xxx> but producing a
            different code.
fccd93f091

Use this notation in langmap_spec.
2022-04-29 15:51:04 +08:00
abe91e1efe vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem:    GUI tests fail because the test doesn't use a modifier.
Solution:   Add "\{xxx}" to be able to encode a modifier.
ebe9d34aa0

Change macros to enums to use them in unit tests.
2022-04-29 15:51:04 +08:00
6832b626ea vim-patch:8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Problem:    Can't distinguish <M-a> from accented "a" in the GUI.
Solution:   Use another way to make mapping <C-bslash> work. (closes vim/vim#6163)
f4ae6b245a
2022-04-29 15:51:04 +08:00
66747f18de vim-patch:8.2.0839: dropping modifier when putting a character back in typeahead
Problem:    Dropping modifier when putting a character back in typeahead.
Solution:   Add modifier to ins_char_typebuf(). (closes vim/vim#6158)
b42c0d5427

Vim's test doesn't seem to work properly as the hit-enter prompt seems
to be delayed. Add a Lua screen test.
2022-04-29 15:51:04 +08:00
82a13a78bb vim-patch:partial: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

This only includes the "lhs" value part.
2022-04-29 15:51:04 +08:00
212349c100 feat(edit): insert an unsimplified key using CTRL-SHIFT-V
This marks the following Vim patches as ported:

vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work

Problem:    With modifyOtherKeys CTRL-^ doesn't work.
Solution:   Handle the exception.
828ffd5963

vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys

Problem:    Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution:   Convert the Escape sequence back to key as if modifyOtherKeys is
            not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
            (closes vim/vim#5254)
fc4ea2a72d

vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character

Problem:    CTRL-V U doesn't work to enter a Unicode character when
            modifyOtherKeys is effective. (Ken Takata)
Solution:   Add a flag to get_literal() for the shift key. (closes vim/vim#7413)
0684e36a7e

Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
2022-04-29 15:51:03 +08:00
44269c73a3 vim-patch:8.1.2167: mapping test fails on MS-Windows
Problem:    Mapping test fails on MS-Windows.
Solution:   Remove all the existing Insert-mode mappings.
2559a47823
2022-04-29 15:51:03 +08:00
b5837e55e6 vim-patch:8.1.2165: mapping test fails on Mac
Problem:    Mapping test fails on Mac.
Solution:   Remove the default Mac mapping.
4f2f61a014
2022-04-29 15:51:03 +08:00
c3634a0261 vim-patch:8.1.2159: some mappings are listed twice
Problem:    Some mappings are listed twice.
Solution:   Skip mappings duplicated for modifyOtherKeys. (closes vim/vim#5064)
fafb4b18cd
2022-04-29 15:51:03 +08:00
7029b4b44a feat(input): delay all simplifications
Avoid unsimplfied Ctrl-C in input buffer when it is not mapped.
2022-04-29 15:51:03 +08:00
68ddbdd03b test(old): revert changes from ed88ca7503
Copy test_regex_char_classes.vim from upstream to avoid future encoding
problems.
2022-04-29 15:51:03 +08:00
dde4f09f51 vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Problem:    Cannot map <C-H> when modifyOtherKeys is enabled.
Solution:   Add the <C-H> mapping twice, both with modifier and as 0x08.  Use
            only the first one when modifyOtherKeys has been detected.
459fd785e4

Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of
"special" is different between Vim and Nvim.
Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs.
Omit tests as they send terminal codes.
Keep the behavior of API functions.
2022-04-29 15:51:03 +08:00
e038625b87 fix(mac): use same $LANG fallback mechanism as Vim
In a locale "en_US", "en" is the language and "US" is the region.

Before this change, we were too clever for our own good and tried to handle the
region as well. But if the macOS primary language is set to "English" and the
region to "Norway", we would end up with "en_NO", which is a locale that does
not exist.

Now we only take the language into account. Taking the example from above would
yield "en_US", which is a sensible fallback.

If the region is important to you, set $LANG and the more specific LC_*
variables in your shell config or alternatively use `:help :language`.

References https://github.com/neovim/neovim/issues/18292
2022-04-28 23:36:12 +02:00
188537efb3 fix: suppress "is a directory" messages with shortmess 'F' (#18296)
When 'F' is in 'shortmess', don't show messages when editing a
directory. This fixes a regression introduced by 0956283.
2022-04-28 15:27:34 -06:00
521e91e1c4 vim-patch:ce001a337e28 (#18287)
Update runtime files
ce001a337e

also add `vimStdPlugin` keywords missing from previous updates
2022-04-27 17:48:35 +02:00
ee85d8d756 Merge pull request #18254 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-27 13:37:56 +02:00
8e20c04fa0 refactor: enable -Wconversion warning for ex_docmd.c (#18277)
* refactor: enable -Wconversion warning for ex_docmd.c

Work on https://github.com/neovim/neovim/issues/567
2022-04-27 13:35:56 +02:00
0d41c4dee1 refactor(build): remove unused includes #17078
Remove unused includes in src/nvim/buffer.c|h using the IWYU library.
Yet another step towards #6371 and #549
2022-04-26 21:38:12 -07:00
5f3018fa1a refactor(terminal)!: drop winpty, require Windows 10 #18253
Problem:
winpty is only needed for Windows 8.1. Removing it reduces our build and code
complexity.

Solution:
- Remove winpty.
- Require Windows 10.

closes #18252
2022-04-26 21:17:06 -07:00
3933592338 fix: has() should preserve v:shell_error #18280
fixes #18278
2022-04-26 20:58:25 -07:00
d98e5357af feat(checkhealth): check for slow shell #17829
Problem:
I had some issues where multiple plugins (vim-fzf and fugitive) was slow
because of my `.zshenv`.

Solution:
Check shell performance in :checkhealth.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-04-26 20:55:57 -07:00
39d149752f fix(build): missing definitions for sizeof macros #16393
Verified with -Wundef

Fixes #16392
2022-04-26 19:41:11 -07:00
f3e99e691d Merge pull request #18260 from dundargoc/refactor/enable-conversion-warning
refactor: enable -Wconversion warning for funcs.c and userfuncs.c
2022-04-26 19:57:02 +02:00
55135cea61 fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18275)
Some language servers send empty `textDocument/publishDiagnostics`
messages after indexing the project with URIs corresponding to unopened buffers.
This commit guards against opening buffers corresponding to empty diagnostics.
2022-04-26 10:00:28 -07:00
909dbbbd4b refactor: enable -Wconversion warning for funcs.c and userfuncs.c
Work on https://github.com/neovim/neovim/issues/567
2022-04-26 10:43:37 +02:00
a75efc237d Merge pull request #18267 from zeertzjq/test-eq-arg-order
test: correct order of arguments to eq() and neq()
2022-04-26 12:20:19 +08:00
519e4c4472 test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
5d159a7faa feat(tui): query terminal for CSI u support (#18181)
On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
2022-04-25 20:49:45 -06:00
d7a7315957 Merge pull request #18249 from zeertzjq/vim-8.2.4760
vim-patch:8.2.{4760,4765}: matchfuzzy() limit
2022-04-26 08:38:21 +08:00
13e54f7130 vim-patch:8.2.4765: function matchfuzzy() sorts too many items
Problem:    Function matchfuzzy() sorts too many items.
Solution:   Only put matches in the array. (Yegappan Lakshmanan,
            closes vim/vim#10208)
047a7019b2
2022-04-26 08:06:33 +08:00
e6974114fb vim-patch:8.2.4760: using matchfuzzy() on a long list can take a while
Problem:    Using matchfuzzy() on a long list can take a while.
Solution:   Add a limit to the number of matches. (Yasuhiro Matsumoto,
            closes vim/vim#10189)
9029a6e993
2022-04-26 08:06:32 +08:00
af82eab946 vim-patch:8.2.4826: .cshtml files are not recognized (#18259)
Problem:    .cshtml files are not recognized.
Solution:   Use html filetype for .cshtml files. (Julien Voisin, closes vim/vim#10212)
1f435dafff
2022-04-25 20:02:36 +02:00
35aa072647 Merge pull request #18257 from dundargoc/refactor/enable-conversion-warning/tag
refactor: enable Wconversion warning for tag
2022-04-25 18:59:20 +02:00
4d092af32d refactor: enable Wconversion warning for tag
Work on https://github.com/neovim/neovim/issues/567
2022-04-25 18:12:27 +02:00
f765c30b38 Merge pull request #18255 from bfredl/workaround_version
fix(ci): workaround bug in msgpackparse() on windows caused by api level bump
2022-04-25 17:29:54 +02:00
2dddc86a42 fix: show autocmd output when F is in shortmess (#18251)
The default value of including F in 'shortmess' has the unfortunate side
effect of hiding output from autocommands. This is a common source of
confusion and often leads people to think their autocommands are not
working when they are. There is a small snippet in the docs for
'shortmess' indicating that the F flag suppresses autocmd output, but
it's not easy to find if you don't already know to look for it.

This commit removes that behavior of the F flag to make it only suppress
file info when opening a new file.
2022-04-25 08:44:18 -06:00
10693a9e8a fix(ci): workaround bug in msgpackparse() on windows caused by api level bump 2022-04-25 16:30:20 +02:00
4aae0eebb2 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-25 13:32:01 +02:00
440b65c338 revert: "man.vim: Ensure 'modifiable' in man#init_pager" #17791
This reverts commit 526798a941.

This will make man filetype not modifiable by default, as it is the
superior behavior in my opinion. More importantly, also make it possible
for a user to modify man filetypes by adding `set modifiable` in
`~/.config/nvim/ftplugin/man.vim` or its equivalent.

ref #11450
closes #17595

Co-authored-by: Javier López <graulopezjavier@gmail.com>
2022-04-25 01:57:14 -07:00
89df042a89 Merge pull request #18234 from zeertzjq/cursearch-reduce-redraw
perf: only redraw for CurSearch when it is currently in use
2022-04-25 10:53:54 +08:00
0648100fed refactor: convert macros to all-caps (#17895)
Closes https://github.com/neovim/neovim/issues/6297
2022-04-24 20:18:43 -06:00
7813fa2f8c refactor: enable Wconversion warning for diff (#18094)
Work on https://github.com/neovim/neovim/issues/567
2022-04-24 20:13:59 -06:00
cf2d77763f Merge pull request #18110 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-24 20:13:23 -06:00
c582194135 refactor: add pure attribute to pure functions (#18165)
This will allow the compilers that support the pure attribute to make
further optimizations.
2022-04-24 20:12:47 -06:00
38ee2a41df perf: only redraw for CurSearch when it is currently in use
The check in redraw_for_cursorline() is not needed because VALID_VIRTCOL
is always cleared when the cursor moves to another line, so the check in
redraw_for_cursorcolumn() is enough.
2022-04-25 09:57:26 +08:00
933274c438 fix/PVS #17863
* fix(PVS/V002): disable rule completely

V002: "Some diagnostic messages may contain incorrect line number in
this file." This particular check seems unreliable. It says on their
website https://pvs-studio.com/en/docs/warnings/v002/ that this warning
occurs when there are multiline pragmas, but there are none in
extmark.c.

* fix(PVS/V756): ignore "counter is not used inside a nested loop" warning

The nested loop starts with "AutoCmd *ac = ap->cmds" so "ap" is
definitely used.

* fix(PVS/V560): disable "a part of conditional expression is always true"

* fix(PVS/V614): potentially uninitialized variable 'blen' used
2022-04-24 18:51:22 -07:00
68d27e156c build: bump Doxyfile to minimum required version 1.9.0 #18118 2022-04-24 18:50:42 -07:00
b7717ed450 docs: clarify enhanced modifiers, SHIFT usage #18124
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-04-24 18:46:56 -07:00
ac3794c351 ci: label all markdown edits as "documentation" #18120 2022-04-24 18:40:13 -07:00
aede28ab3b fix(packaging): remove excess forward slash in Wix Patch (#18121) 2022-04-24 17:53:09 -07:00
4cf1bcf183 Merge pull request #18248 from zeertzjq/vim-8.2.4806
vim-patch:8.2.{4806,4818}: a mapping using <LeftDrag> does not start Select mode
2022-04-25 07:52:35 +08:00
48a35106ef vim-patch:8.2.4818: no test for what 8.2.4806 fixes
Problem:    No test for what 8.2.4806 fixes.
Solution:   Add a test. (closes vim/vim#10727)
ac92ab7719

Test cannot be used because it must use test_setmouse(). Use a Lua test.
2022-04-25 07:23:24 +08:00
c8fe8c5ea4 vim-patch:8.2.4806: a mapping using <LeftDrag> does not start Select mode
Problem:    A mapping using <LeftDrag> does not start Select mode.
Solution:   When checking for starting select mode with the mouse also do this
            when there is typeahead. (closes vim/vim#10249)
53ef573148
2022-04-25 07:23:23 +08:00
2caf5bbbc5 Merge pull request #18243 from zeertzjq/vim-8.2.4808
vim-patch:8.2.{4808,4810,4813}: pasting text while indent folding may mess up folds
2022-04-24 22:21:54 +08:00
2511f3e76d vim-patch:8.2.4813: pasting text while indent folding may mess up folds
Problem:    Pasting text while indent folding may mess up folds.
Solution:   Adjust the way folds are split. (Brandon Simmons, closes vim/vim#10254)
2c40707baa
2022-04-24 21:49:47 +08:00
3e41e7d9c1 vim-patch:8.2.4810: missing changes in one file
Problem:    Missing changes in one file.
Solution:   Also change the struct initializers.
56dba60216
2022-04-24 21:47:57 +08:00
321db867d5 vim-patch:8.2.4808: unused item in engine struct
Problem:    Unused item in engine struct.
Solution:   Remove "expr".  Add comment with tags.
33d3ce640c
2022-04-24 21:47:25 +08:00
843d9223a1 build(clang-format): align with project style #18192 2022-04-23 20:48:38 -07:00
92f7286377 docs: make docstring consistent with parameters #18178
Closes: https://github.com/neovim/neovim/issues/12691
2022-04-23 17:01:01 -07:00
cfaf7440fc ci(backport): remove triggering by comment (#18210)
Triggering by comment is not needed. Applying the label is enough to
trigger the backport action.
2022-04-23 14:26:42 -07:00
d3df415228 Merge pull request #18197 from dundargoc/build/clint/python3
build/clint/python3
2022-04-23 14:06:50 -06:00
5c53e29ca9 fix(ftdetect): source plugins in autogroup (#18237)
In `filetype.lua`, source runtime `ftdetect` scripts within the `filetypedetect` augroup, same as `filetype.vim` (and only do so if `g:did_load_ftdetect` does not exist).
2022-04-23 17:57:38 +02:00
a98cf154ed Merge pull request #18226 from zeertzjq/vim-8.2.4805
vim-patch:8.2.{4805,4812}: CurSearch used for all matches in current line
2022-04-23 19:51:32 +08:00
79ab277011 vim-patch:8.2.4812: unused struct item
Problem:    Unused struct item.
Solution:   Remove "lines" match_T.  Simplify the code. (closes vim/vim#10256)
8279cfe499
2022-04-23 19:25:51 +08:00
8db55aedb5 vim-patch:8.2.4805: CurSearch used for all matches in current line
Problem:    CurSearch used for all matches in current line.
Solution:   Don't use the non-zero line count. (closes vim/vim#10247)
9b36750640
2022-04-23 19:24:47 +08:00
4e4914ab2e fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)
`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.
2022-04-23 08:01:08 +08:00
116a3f4683 fix(treesitter): create new parser if language is not the same as cached parser (#18149) 2022-04-22 16:15:28 +02:00
f4f593b333 Merge pull request #18211 from clason/update-inspect
chore: update inspect.lua to 3.1.3
2022-04-22 10:53:00 +02:00
6c8a3013ac docs(lua): explain and link to lua patterns (#18206)
also correct explanation of when it's allowed to omit parens in Lua function calls
2022-04-21 21:46:07 +02:00
64784dccb5 chore: update inspect.lua to 3.1.3 2022-04-21 16:23:10 +02:00
28fb40b16f refactor(normal): fix most clint warnings (#18196) 2022-04-21 14:06:23 +01:00
af5a7a0582 Merge pull request #18209 from zeertzjq/vim-8.2.4759
vim-patch:8.2.4759: CurSearch highlight does not work for multi-line match
2022-04-21 20:44:15 +08:00
4b19f94c28 vim-patch:8.2.4759: CurSearch highlight does not work for multi-line match
Problem:    CurSearch highlight does not work for multi-line match.
Solution:   Check cursor position before adjusting columns. (closes vim/vim#10133)
693ccd1160
2022-04-21 20:19:58 +08:00
e6dec30332 Merge pull request #18182 from zeertzjq/vim-8.2.2472
vim-patch:8.1.1756,8.2.{2472,2474,2475,2476,2477,4791,4802}: autocommand fixes
2022-04-21 19:43:09 +08:00
5e9afca1c1 vim-patch:8.2.4802: test is not cleaned up
Problem:    Test is not cleaned up.
Solution:   Make test clean up after itself.  Avoid NUL. (closes vim/vim#10233)
7851c69a12

Adapt test_autocmd_vimgrep() to Nvim.
2022-04-21 19:07:50 +08:00
e69cb86750 test: add a Lua functional test for NoName buffer event order 2022-04-21 19:07:50 +08:00
f531fb97ff vim-patch:8.2.4791: events triggered in different order when reusing buffer
Problem:    Autocmd events triggered in different order when reusing an empty
            buffer.
Solution:   Call buff_freeall() earlier. (Charlie Groves, closes vim/vim#10198)
fef4485ef5

Test failure becomes very strange.
2022-04-21 19:07:50 +08:00
69fc23ed98 vim-patch:8.2.2477: autocommand tests hang on MS-Windows
Problem:    Autocommand tests hang on MS-Windows.
Solution:   Skip a couple of tests.  Fix file name.
dd07c02232
2022-04-21 19:07:50 +08:00
1664e3d4bc vim-patch:8.2.2476: using freed memory when splitting window while closing buffer
Problem:    Using freed memory when using an autocommand to split a window
            while a buffer is being closed.
Solution:   Disallow splitting when the buffer has b_locked_split set.
983d83ff1c

Put the error message in window.c.
Cherry-pick a memory leak fix from Vim patch 8.2.0399.
Test still fails.
2022-04-21 19:07:50 +08:00
407be5975d vim-patch:8.2.2475: autocommand tests hangs on MS-Windows
Problem:    Autocommand tests hangs on MS-Windows.
Solution:   Skip one test.
dfc3db76b9
2022-04-21 19:07:50 +08:00
69ac382a28 vim-patch:8.2.2474: using freed memory when window is closed by autocommand
Problem:    Using freed memory when window is closed by autocommand.
            (houyunsong)
Solution:   Check the window pointer is still valid.
2c7080bf1c

Add missing comment from Vim patch 8.0.1420.
Test fails.
2022-04-21 19:07:50 +08:00
fa15f2f938 vim-patch:8.2.2472: crash when using command line window in an autocommand
Problem:    Crash when using command line window in an autocommand.
            (houyunsong)
Solution:   Save and restore au_new_curbuf.
aad5f9d79a

Nvim has removed :open, so use :edit in the test instead.
2022-04-21 19:07:50 +08:00
9b10b4cc64 vim-patch:8.1.1756: autocommand that splits window messes up window layout
Problem:    Autocommand that splits window messes up window layout.
Solution:   Disallow splitting a window while closing one.  In ":all" give an
            error when moving a window will not work.
1417c766f5

Expected error number was changed to E242 in Vim in patch 8.2.1183, and
patch 8.2.2420 (which has already been ported) made the test no longer
throw E249 in Vim, so just use E242 in the test.
2022-04-21 19:06:50 +08:00
5c4ec25478 Merge pull request #18200 from atusy/doc-vim-keymap-set
docs: vim.keymap.set can specify buffer as an option
2022-04-21 17:31:40 +08:00
5ecbbba6ee docs: vim.keymap.set can specify buffer as an option 2022-04-21 10:45:39 +09:00
db851cb105 Merge pull request #18199 from zeertzjq/vim-8.2.4797
vim-patch:8.2.4797: getwininfo() may get oudated values
2022-04-21 08:06:18 +08:00
a4b75010ba Merge pull request #18180 from zeertzjq/vim-8.2.4792
vim-patch:8.2.{0358,4792,4794}: indent operator creates an undo entry for every line
2022-04-21 07:50:02 +08:00
f9c8ba0b85 vim-patch:8.2.4794: compiler warning for not initialized variable
Problem:    Compiler warning for not initialized variable.
Solution:   Initialize the variable. (John Marriott)
4c84dd33ad
2022-04-21 07:24:50 +08:00
f8b832b171 vim-patch:8.2.4792: indent operator creates an undo entry for every line
Problem:    Indent operator creates an undo entry for every line.
Solution:   Create one undo entry for all lines. (closes vim/vim#10227)
e468698994
2022-04-21 07:24:50 +08:00
c72857d396 vim-patch:8.2.0358: insufficient testing for indent.c
Problem:    Insufficient testing for indent.c.
Solution:   Add indent tests. (Yegappan Lakshmanan, closes vim/vim#5736)
bd7206e02c

Cherry-pick Test_ex_mode() changes from Vim patches 8.2.{0342,0347}.
Reorder test_expand_func.vim to match upstream.
2022-04-21 07:24:47 +08:00
87e1693ba6 vim-patch:8.2.4797: getwininfo() may get oudated values
Problem:    getwininfo() may get oudated values.
Solution:   Make sure w_botline is up-to-date. (closes vim/vim#10226)
8530b41fd3

Correct test order and add a modeline in test_bufwintabinfo.vim.
2022-04-21 07:09:42 +08:00
c6dcc6acd8 Merge pull request #18189 from zeertzjq/vim-8.2.4795
vim-patch:8.2.{4795,4796,4801}: 'cursorbind' scrolling depends on whether 'cursorline' is set
2022-04-21 06:57:13 +08:00
61eca90f65 Merge pull request #18187 from zeertzjq/vim-8.2.4724
vim-patch:8.2.4724: current instance of last search pattern not easily spotted
2022-04-21 06:55:28 +08:00
8145357974 vim-patch:8.2.4724: current instance of last search pattern not easily spotted
Problem:    Current instance of last search pattern not easily spotted.
Solution:   Add CurSearch highlighting. (closes vim/vim#10133)
a43993897a

This fixes CurSearch highlight for multiline match.
Omit screen redrawing code because Nvim redraws CurSearch differently.
2022-04-21 06:24:11 +08:00
94f12e8a59 vim-patch:8.2.4801: fix for cursorbind fix not fully tested
Problem:    Fix for cursorbind fix not fully tested.
Solution:   Add another test case. (Christian Brabandt, closes vim/vim#10240)
3fd7480cd2
2022-04-21 06:10:42 +08:00
4c5a2e8ebf vim-patch:8.2.4796: file left behind after running cursorline tests
Problem:    File left behind after running cursorline tests.
Solution:   Uncomment the line that deletes the file.
da1050cd6f
2022-04-21 06:10:42 +08:00
5600766b41 vim-patch:8.2.4795: 'cursorbind' scrolling depends on whether 'cursorline' is set
Problem:    'cursorbind' scrolling depends on whether 'cursorline' is set.
Solution:   Always call validate_cursor(). (Christian Brabandt, closes vim/vim#10230,
            closes vim/vim#10014)
2c645e8b00
2022-04-21 06:10:42 +08:00
92844b4499 build(clint): remove all python2-isms with pyupgrade
The script is functionally the same, just with some nicer syntactic
sugar thanks to only supporting python3.
2022-04-20 23:15:26 +02:00
df48b355d2 build(clint): change shebang to python3
There are distributions that doesn't symlink python to python3.
This will make clint work for these without any additional steps from
the user.
2022-04-20 23:01:15 +02:00
bfd6eb4404 Merge pull request #18185 from clason/vim-8.2.4781
vim-patch:8.2.{4781,4793}: maxima files are not recognized
2022-04-20 21:45:22 +02:00
85b13f6db4 docs(filetype): proper example for did_load_filetypes (#18191) 2022-04-20 21:41:35 +02:00
a48a0a4f7b docs(api): add example showing necessity to wrap callback function (#18179)
Some people ran into issues trying to use `callback = myluafun` because
of the event data payload.


Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-04-20 18:42:07 +02:00
7e7fdca163 fix(lsp): unify progress message handling (#18040)
The LSP progress handler would put non-progress messages (such as from
clangd or pyls; not part of the LSP spec) directly into
`client.messages`, while `vim.lsp.util.get_progress_messages()` would
try to fetch them from `client.messages.messages` instead (and come up
empty everytime). This would result in these messages never being
cleaned up by `get_progress_messages()`.

This commit fixes that by treating those messages like show-once
progress messages (by setting `done=true` immediately).
2022-04-20 18:40:52 +02:00
6b0d3ae6a8 fix(diagnostic): use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.
2022-04-20 08:16:47 -06:00
81f1e33d15 Merge pull request #18145 from bfredl/term_opt
feat(api): allow remote UI to set terminal options
2022-04-20 14:50:04 +02:00
63eb7e865b vim-patch:8.2.4793: recognizing Maxima filetype even though it might be another
Problem:    Recognizing Maxima filetype even though it might be another.
Solution:   Remove *.mc and *.dem patterns from Maxima files
928a131356
2022-04-20 09:52:31 +02:00
d40b2afda8 vim-patch:8.2.4781: Maxima files are not recognized
Problem:    Maxima files are not recognized.
Solution:   Add patterns to detect Maxima files. (Doron Behar, closes vim/vim#10211)
d0a20c9d11
2022-04-20 09:50:19 +02:00
a391cd517b vim-patch:8.2.4790: lilypond filetype not recognized (#18174)
Problem:    Lilypond filetype not recognized.
Solution:   Add patterns for lilypond. (Doug Kearns)
c448e9c950
2022-04-20 08:35:22 +02:00
245858460f Merge pull request #18157 from famiu/feat/undo!
feat: add `undo!`
2022-04-19 20:55:49 +02:00
1e3d9c7dbc feat: add undo!
Allows using `undo!` to undo changes and remove them from the undo-tree. Can only be used for moving backwards in the same undo branch.
2022-04-20 00:10:02 +06:00
dbc4af7186 Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
2022-04-19 18:56:51 +02:00
0124a7bfa9 vim-patch:75ab590f8504 (#18170)
Update runtime files
75ab590f85

omit builtin.txt change to `expand()` (depends on 8.2.4726)
2022-04-19 15:14:17 +02:00
147cc60d24 fix(tui): update modifyOtherKeys reporting (#18158)
* Use the Eneks and Dseks terminfo attributes if they exist
* Add VTE versions below 0.54.0 to the blacklist
2022-04-18 20:03:26 -06:00
d3121f1e63 Merge pull request #18091 from dundargoc/refactor/pure-attribute
refactor: add pure attribute to pure functions
2022-04-18 21:40:14 +02:00
e73ef5c092 docs(terminal): correct sentence on how to enter terminal mode (#18146)
`o`/`O` is not supported for terminal mode
2022-04-18 11:49:06 +02:00
1facad2347 vim-patch:8.2.4778: pacman files use dosini filetype (#18152)
Problem:    Pacman files use dosini filetype.
Solution:   Use conf instead. (Chaoren Lin, closes vim/vim#10213)
35cff32dd8
2022-04-17 23:30:13 +02:00
b16afe4d55 feat(highlight): implement CurSearch highlight
Adds a `CurSearch` highlight group to highlight the current search result under the cursor.
2022-04-17 19:24:59 +06:00
8973768a4e feat(api): add tests for setting terminal ui options 2022-04-17 11:41:56 +02:00
d63ad42e49 feat(api): ui options relevant for remote TUI 2022-04-17 11:41:56 +02:00
6e6f5a7833 vim-patch:8.2.4767: openscad files are not recognized (#18138)
Problem:    Openscad files are not recognized.
Solution:   Add a filetype pattern. (Niklas Adam, closes vim/vim#10199)
c360b2566c
2022-04-17 10:15:55 +02:00
670ecfc0cd vim-patch:8.2.4766: KRL files using "deffct" not recognized (#18137)
Problem:    KRL files using "deffct" not recognized.
Solution:   Adjust the pattern used for matching. (Patrick Meiser-Knosowski,
            closes vim/vim#10200)
93c7a45e86
2022-04-17 10:15:41 +02:00
ae325e6274 Merge pull request #18139 from zeertzjq/vim-8.2.0791
vim-patch:8.2.0791
2022-04-17 10:42:06 +08:00
f823dce100 test: add a test for #18135 2022-04-17 10:13:47 +08:00
2116ff47ea vim-patch:8.2.0791: a second popup window with terminal causes trouble
Problem:    A second popup window with terminal causes trouble.
Solution:   Disallow opening a second terminal-popup window. (closes vim/vim#6101,
            closes vim/vim#6103) Avoid defaulting to an invalid line number.
b5383b174b

This is the only applicable hunk.
2022-04-17 10:12:50 +08:00
813ecdac79 fix(paste): ignore mappings in Cmdline mode (#18114) 2022-04-17 08:11:53 +08:00
dcf7bc4140 vim-patch:8.2.4762: using freed memory using synstack() and synID() in WinEnter (#18136)
Problem:    Using freed memory when using synstack() and synID() in WinEnter.
Solution:   Check using the syntax window. (closes vim/vim#10204)
ca7e86c237
2022-04-17 03:54:28 +08:00
88270a5735 refactor: add function xstrnsave
xstrnsave is a clone of vim_strnsave that uses char* instead of char_u*.
Its purpose short-term is to help reduce the number of casts and for
long-term to replace vim_strnsave as the need to use char_u is
eliminated.
2022-04-16 18:09:26 +02:00
7a2fcbbbec refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-16 13:07:35 +02:00
3f2e9298bd chore: remove vestigial sfname freeing (#18123)
This freeing is necessary in Vim since the alloc can fail. Since we're
using xcalloc, that's not possible and the freeing will never run.
2022-04-16 09:58:48 +08:00
08a144912c vim-patch:8.2.4752: wrong 'statusline' value can cause illegal memory access (#18117)
Problem:    Wrong 'statusline' value can cause illegal memory access.
Solution:   Properly check the value. (closes vim/vim#10192)
5dc294a7b6

Make two error messages static variables.
2022-04-15 21:21:51 +08:00
a8d5a9e819 version bump 2022-04-15 13:43:50 +02:00
0fb571e3b5 refactor: add pure attribute to pure functions
This will allow compilers that support the pure attribute to make
further optimizations to functions.
2022-04-13 22:12:12 +02:00
1837 changed files with 282851 additions and 183426 deletions

View File

@ -1,40 +0,0 @@
image: freebsd/latest
packages:
- cmake
- gmake
- ninja
- libtool
- automake
- pkgconf
- unzip
- wget
- gettext
- python
- libffi
- gdb
sources:
- https://github.com/neovim/neovim
environment:
SOURCEHUT: 1
LANG: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
cd neovim
gmake deps
- build: |
cd neovim
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
- functionaltest: |
cd neovim
gmake functionaltest
- unittest: |
cd neovim
gmake unittest
- oldtest: |
cd neovim
gmake oldtest

View File

@ -1,44 +0,0 @@
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
image: openbsd/latest
packages:
- autoconf-2.71
- automake-1.16.3
- cmake
- gettext-runtime-0.21p1
- gettext-tools-0.21p1
- gmake
- libtool
- ninja-1.10.2p0
- unzip-6.0p14
- gdb
sources:
- https://github.com/neovim/neovim
environment:
SOURCEHUT: 1
LC_CTYPE: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
mkdir neovim/.deps
cd neovim/.deps
cmake -G Ninja ../third-party/
cmake --build . --config RelWithDebInfo
- build: |
mkdir neovim/build
cd neovim/build
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
cmake --build . --config RelWithDebInfo
./bin/nvim --version
- functionaltest: |
cd neovim/build
cmake --build . --config RelWithDebInfo --target functionaltest
- oldtest: |
cd neovim
gmake oldtest

27
.cirrus.yml Normal file
View File

@ -0,0 +1,27 @@
env:
CIRRUS_CLONE_DEPTH: '2'
LANG: en_US.UTF-8
freebsd_task:
name: FreeBSD
only_if: $BRANCH != "master"
freebsd_instance:
image_family: freebsd-13-1
timeout_in: 30m
install_script:
- pkg install -y cmake gmake ninja pkgconf unzip wget gettext python libffi git
build_deps_script:
- gmake deps
build_script:
- gmake CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON" nvim
workaround_script:
# Run tests as user "cirrus" instead of root. This is required for the
# permission-related tests to work correctly.
- pw useradd cirrus -m
- chown -R cirrus:cirrus .
functionaltest_script:
- sudo -u cirrus gmake functionaltest
unittest_script:
- sudo -u cirrus gmake unittest
oldtest_script:
- sudo -u cirrus gmake oldtest

View File

@ -36,5 +36,32 @@ BraceWrapping:
BeforeElse: false
IndentBraces: false
PointerAlignment: Right
SortIncludes: false
SortIncludes: true
Cpp11BracedListStyle: false
IncludeCategories:
- Regex: '<[/[:alnum:].]+>'
Priority: 0
- Regex: '^"(nvim|vim)/'
Priority: 1
SortPriority: 1
CaseSensitive: false
AlignConsecutiveMacros: AcrossEmptyLines
IndentPPDirectives: AfterHash
SpaceBeforeParens: ControlStatementsExceptControlMacros
PPIndentWidth: 1
ForEachMacros:
- FOR_ALL_AUEVENTS
- FOR_ALL_AUPATS_IN_EVENT
- FOR_ALL_BUFFERS
- FOR_ALL_BUFFERS_BACKWARDS
- FOR_ALL_FRAMES
- FOR_ALL_QFL_ITEMS
- FOR_ALL_SIGNS_IN_BUF
- FOR_ALL_TABS
- FOR_ALL_TAB_WINDOWS
- FOR_ALL_WINDOWS_IN_TAB
- RBUFFER_EACH
- RBUFFER_EACH_REVERSE
- RBUFFER_UNTIL_EMPTY
- RBUFFER_UNTIL_FULL
- kl_iter

43
.clang-tidy Normal file
View File

@ -0,0 +1,43 @@
WarningsAsErrors: '*'
Checks: >
-*,
bugprone-*,
google-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-suspicious-include,
-bugprone-suspicious-memory-comparison,
-bugprone-unused-return-value,
-google-readability-braces-around-statements,
-google-readability-function-size,
-misc-misplaced-const,
-misc-no-recursion,
-misc-unused-parameters,
-modernize-macro-to-enum,
-performance-no-int-to-ptr,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-misleading-indentation,
-readability-redundant-declaration,
-readability-redundant-function-ptr-dereference,
-readability-suspicious-call-argument,

View File

@ -6,11 +6,13 @@ indent_size = 2
tab_width = 8
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.{c,h,in,lua}]
max_line_length = 100
[*.py]
indent_size = 4
[{Makefile,**/Makefile,runtime/doc/*.txt}]
indent_style = tab
indent_size = 8

View File

@ -1,2 +0,0 @@
[flake8]
max-line-length = 88

View File

@ -47,7 +47,35 @@ a68faed02dc8e37b8f10da14dc02e33e6ed93947
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
271bb32855853b011fceaf0ad2f829bce66b2a19
aefdc6783cb77f09786542c90901a9e7120bea42
aa4f9c5341f5280f16cce0630ea54b84eef717b3
0adc66171a355a12494d87ebb767d509540c7ef9
93f24403f8cc760ff47979c596976b53a8b16358
1ffd527c837fb2465c9659273bbe5447a1352db2
2498e9feb025361576603a0101c86393d211e31e
0b3ae64480ea28bb57783c2269a61f0a60ffc55e
0fc8597f011e0927e529abd11bf0ddd8d0d1eaab
6ff245732a5a8ab821598a38fb0c5805e6bd3779
abf758a2977c4e6cab4dfa217f56da853d85851c
cb84f5ee530f0f32b92bed5b4ad41344e8b551aa
# typos
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
4547137aaff32b20172870a549d3a28a3c7adf1c
08616571f47cc367a5fe59b52295708b9fda3b09
09c6ce8c4e4c6415cca9b834539ed0df461373f6
0b0c4f7dfa4a9a564cbf44262d4bea9bdefe2dc9
4a96e7809f4d9f6ce21869817eb95ff6dcaa1693
61205c1defb64ac5466496b5451e4a7f3171e21e
64116d78502e0ca611e13adf9323ef2d3fe708c2
abc087f4c65ca547cae58518b42aee82ff4a07f6
b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b
c815aadfccd6bada47ecfb09fe188ee7f7c5caf3
caa6992a1071a2ac373bec21085685da4a1790d6
df646572c53f55268a5dbb61628d7c3b302d5663
e63e5d1dbd3dd4711efa0ecf9e844ff308b370a6
eb123b565e201418dd135d2602dc20eea3cead39
ff20d40321399fa187bd350f9619cf6418d7eb6e
# generated docs
ea333badd24f691c753d8048f911d1db349bc2cd

17
.gitattributes vendored
View File

@ -1,6 +1,11 @@
*.h linguist-language=C
src/nvim/testdir/test42.in diff
.github/ export-ignore
.travis.yml export-ignore
codecov.yml export-ignore
.builds/ export-ignore
*.h.in linguist-language=C
*.c.in linguist-language=C
*CMakeLists.txt linguist-language=CMake
runtime/doc/* linguist-documentation
src/xdiff/** linguist-vendored
src/cjson/** linguist-vendored
src/unicode/** linguist-vendored
.github/ export-ignore

View File

@ -6,7 +6,32 @@ body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage or "How to" questions belong on the [stackoverflow](https://vi.stackexchange.com/) and will be closed.
- type: textarea
attributes:
label: "Problem"
description: "Describe the current behavior. May include logs, images, or videos."
validations:
required: true
- type: textarea
attributes:
label: "Steps to reproduce"
description: |
- For build failures: list the exact steps including CMake flags (if any).
- For startup or shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
placeholder: |
nvim --clean
:edit foo
yiwp
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect."
validations:
required: true
- type: input
attributes:
@ -47,29 +72,3 @@ body:
placeholder: "Arch User Repository (AUR)"
validations:
required: true
- type: textarea
attributes:
label: "How to reproduce the issue"
description: |
- Steps to reproduce using `nvim --clean` ("factory defaults").
- For build failures: list the exact steps including CMake flags (if any).
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
placeholder: |
nvim --clean
:edit foo
yiwp
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
validations:
required: true
- type: textarea
attributes:
label: "Actual behavior"
validations:
required: true

View File

@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://neovim.discourse.group/
url: https://vi.stackexchange.com/
about: Ask questions about configuration and usage of Neovim

View File

@ -8,14 +8,17 @@ body:
value: |
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
- type: input
- type: textarea
attributes:
label: "Feature already in Vim?"
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
placeholder: "Yes, Vim 7.3.432"
label: "Problem"
description: "Describe the problem to be solved. Include references to other projects (Vim, Emacs, etc.) if relevant."
placeholder: "No smurf icons available. Smurfs are useful because ..."
validations:
required: true
- type: textarea
attributes:
label: "Feature description"
label: "Expected behavior"
description: "Describe what the new feature or behavior would look like. How does it solve the problem? Is it worth the cost?"
validations:
required: true

View File

@ -6,7 +6,56 @@ body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions or "Why isn't X language server/feature working?" belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed.
- type: textarea
attributes:
label: "Problem"
description: "Describe the bug caused by the Nvim LSP client."
validations:
required: true
- type: textarea
attributes:
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
description: |
- Create a minimal_init.lua using vim.lsp.start:
```lua
--- CHANGE THESE
local pattern = 'the-filetype'
local cmd = {'name-of-language-server-executable'}
-- Add files/folders here that indicate the root of a project
local root_markers = {'.git', '.editorconfig'}
-- Change to table with settings if required
local settings = vim.empty_dict()
vim.api.nvim_create_autocmd('FileType', {
pattern = pattern,
callback = function(args)
local match = vim.fs.find(root_markers, { path = args.file, upward = true })[1]
local root_dir = match and vim.fn.fnamemodify(match, ':p:h') or nil
vim.lsp.start({
name = 'bugged-ls',
cmd = cmd,
root_dir = root_dir,
settings = settings
})
end
})
```
See `:h lsp-quickstart` and `:h vim.lsp.start` for more information
- Provide a short code example and describe the folder layout
- Describe how to trigger the issue. E.g. using `:lua vim.lsp.buf.*` commands
_Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
- type: input
attributes:
@ -27,23 +76,6 @@ body:
validations:
required: true
- type: textarea
attributes:
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
description: |
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
- type: textarea
attributes:
label: "Actual behavior"
- type: input
attributes:
label: "Log file"

2
.github/SECURITY.md vendored Normal file
View File

@ -0,0 +1,2 @@
To report a security vulnerability to Neovim, use
https://github.com/neovim/neovim/security/advisories/new

26
.github/actions/cache/action.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: 'Cache'
description: "This action caches neovim dependencies"
runs:
using: "composite"
steps:
- run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV
shell: bash
- if: ${{ matrix }}
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $GITHUB_ENV
shell: bash
- id: image
run: echo "version=$ImageVersion" >> $GITHUB_OUTPUT
shell: bash
# Avoid using '**/CMakeLists.txt' (or any pattern starting with '**/') even
# if it makes the expression below simpler. hashFiles() has a timer that
# will fail the job if it times out, which can happen if there are too many
# files to search through.
- uses: actions/cache@v3
with:
path: .deps
key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**',
'.github/workflows/test.yml', 'CMakeLists.txt',
'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }}

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "ci"

15
.github/labeler.yml vendored
View File

@ -2,10 +2,6 @@
- runtime/lua/vim/lsp.lua
- runtime/lua/vim/lsp/*
"lua":
- runtime/lua/**/*
- src/nvim/lua/*
"tui":
- src/nvim/tui/tui.*
@ -13,12 +9,13 @@
- src/nvim/lua/treesitter.*
- runtime/lua/vim/treesitter.lua
- runtime/lua/vim/treesitter/*
- runtime/queries/**/*
"diagnostic":
- runtime/lua/vim/diagnostic.lua
"dependencies":
- third-party/**/*
- cmake.deps/**/*
"spell":
- src/nvim/spell*
@ -27,8 +24,6 @@
- src/nvim/terminal.*
"column":
- src/nvim/mark.h
- src/nvim/mark.c
- src/nvim/sign*
"folds":
@ -39,6 +34,7 @@
"documentation":
- all: ["runtime/doc/*"]
- all: ["**/*.md"]
"clipboard":
- runtime/autoload/provider/clipboard.vim
@ -63,3 +59,8 @@
"filetype":
- runtime/lua/vim/filetype.lua
- runtime/lua/vim/filetype/detect.lua
"platform:nix":
- contrib/flake.lock
- contrib/flake.nix

34
.github/scripts/build_universal_macos.sh vendored Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash -e
echo "Provision universal libintl"
GETTEXT_PREFIX="$(brew --prefix gettext)"
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
bottle_tag="arm64_big_sur"
brew fetch --bottle-tag="$bottle_tag" gettext
cd "$(mktemp -d)"
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
mv -f libintl.a /usr/local/lib/
echo "Ensure static linkage to libintl"
# We're about to mangle `gettext`, so let's remove any potentially broken
# installs (e.g. curl, git) as those could interfere with our build.
brew uninstall $(brew uses --installed --recursive gettext)
brew unlink gettext
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/include"/* /usr/local/include/
rm -f "$GETTEXT_PREFIX"
echo "Build release"
cd "$GITHUB_WORKSPACE"
MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
export MACOSX_DEPLOYMENT_TARGET
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
cmake --build build
# Make sure we build everything for M1 as well
for macho in build/bin/* build/lib/nvim/parser/*.so; do
lipo -info "$macho" | grep -q arm64 || exit 1
done
cpack --config build/CPackConfig.cmake

55
.github/scripts/close_unresponsive.js vendored Normal file
View File

@ -0,0 +1,55 @@
function labeledEvent(data) {
return data.event === "labeled" && data.label.name === "needs:response";
}
const numberOfDaysLimit = 30;
const close_message = `This has been closed since a request for information has \
not been answered for ${numberOfDaysLimit} days. It can be reopened when the \
requested information is provided.`;
module.exports = async ({ github, context }) => {
const owner = context.repo.owner;
const repo = context.repo.repo;
const issues = await github.rest.issues.listForRepo({
owner: owner,
repo: repo,
labels: "needs:response",
});
const numbers = issues.data.map((e) => e.number);
for (const number of numbers) {
const events = await github.paginate(
github.rest.issues.listEventsForTimeline,
{
owner: owner,
repo: repo,
issue_number: number,
},
(response) => response.data.filter(labeledEvent)
);
const latest_response_label = events[events.length - 1];
const created_at = new Date(latest_response_label.created_at);
const now = new Date();
const diff = now - created_at;
const diffDays = diff / (1000 * 60 * 60 * 24);
if (diffDays > numberOfDaysLimit) {
github.rest.issues.update({
owner: owner,
repo: repo,
issue_number: number,
state: "closed",
});
github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: number,
body: close_message,
});
}
}
};

10
.github/scripts/install_deps.sh vendored Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
os=$(uname -s)
if [[ $os == Linux ]]; then
sudo apt-get update
sudo apt-get install -y build-essential cmake curl gettext locales-all ninja-build pkg-config unzip "$@"
elif [[ $os == Darwin ]]; then
brew update --quiet
brew install ninja "$@"
fi

View File

@ -1,16 +1,16 @@
module.exports = async ({github, context}) => {
module.exports = async ({ github, context }) => {
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
pull_number: context.issue.number,
});
const reviewers = requestedReviewers.data.users.map(e => e.login)
const reviewers = requestedReviewers.data.users.map((e) => e.login);
github.rest.pulls.removeRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: reviewers
reviewers: reviewers,
});
}
};

View File

@ -0,0 +1,19 @@
module.exports = async ({ github, context }) => {
const commenter = context.actor;
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const author = issue.data.user.login;
const labels = issue.data.labels.map((e) => e.name);
if (author === commenter && labels.includes("needs:response")) {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: "needs:response",
});
}
};

View File

@ -1,95 +1,114 @@
module.exports = async ({github, context}) => {
module.exports = async ({ github, context }) => {
const pr_data = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const labels = pr_data.data.labels.map(e => e.name)
pull_number: context.issue.number,
});
const labels = pr_data.data.labels.map((e) => e.name);
const reviewers = new Set();
const reviewers = new Set()
if (labels.includes('api')) {
reviewers.add("bfredl")
reviewers.add("gpanders")
reviewers.add("muniter")
if (labels.includes("api")) {
reviewers.add("bfredl");
reviewers.add("famiu");
}
if (labels.includes('build')) {
reviewers.add("jamessan")
if (labels.includes("build")) {
reviewers.add("dundargoc");
reviewers.add("jamessan");
reviewers.add("justinmk");
}
if (labels.includes('ci')) {
reviewers.add("jamessan")
if (labels.includes("ci")) {
reviewers.add("dundargoc");
reviewers.add("jamessan");
reviewers.add("justinmk");
}
if (labels.includes('column')) {
reviewers.add("lewis6991")
if (labels.includes("column")) {
reviewers.add("lewis6991");
}
if (labels.includes('diagnostic')) {
reviewers.add("gpanders")
if (labels.includes("dependencies")) {
reviewers.add("jamessan");
}
if (labels.includes('diff')) {
reviewers.add("lewis6991")
if (labels.includes("diagnostic")) {
reviewers.add("gpanders");
}
if (labels.includes('dependencies')) {
reviewers.add("jamessan")
if (labels.includes("diff")) {
reviewers.add("lewis6991");
}
if (labels.includes('distribution')) {
reviewers.add("jamessan")
if (labels.includes("distribution")) {
reviewers.add("jamessan");
}
if (labels.includes('documentation')) {
reviewers.add("clason")
if (labels.includes("documentation")) {
reviewers.add("clason");
}
if (labels.includes('extmarks')) {
reviewers.add("bfredl")
if (labels.includes("extmarks")) {
reviewers.add("bfredl");
}
if (labels.includes('filetype')) {
reviewers.add("clason")
reviewers.add("gpanders")
if (labels.includes("filetype")) {
reviewers.add("clason");
reviewers.add("gpanders");
reviewers.add("smjonas");
}
if (labels.includes('gui')) {
reviewers.add("glacambre")
reviewers.add("smolck")
if (labels.includes("lsp")) {
reviewers.add("folke");
reviewers.add("glepnir");
reviewers.add("mfussenegger");
}
if (labels.includes('lsp')) {
reviewers.add("mfussenegger")
reviewers.add("mjlbach")
if (labels.includes("platform:nix")) {
reviewers.add("teto");
}
if (labels.includes('treesitter')) {
reviewers.add("bfredl")
reviewers.add("vigoux")
if (labels.includes("project-management")) {
reviewers.add("bfredl");
reviewers.add("justinmk");
}
if (labels.includes('typo')) {
reviewers.add("dundargoc")
if (labels.includes("statusline")) {
reviewers.add("famiu");
}
if (labels.includes('ui')) {
reviewers.add("bfredl")
if (labels.includes("test")) {
reviewers.add("justinmk");
}
if (labels.includes('vim-patch')) {
reviewers.add("seandewar")
reviewers.add("zeertzjq")
if (labels.includes("treesitter")) {
reviewers.add("bfredl");
reviewers.add("clason");
reviewers.add("lewis6991");
}
if (labels.includes("typo")) {
reviewers.add("dundargoc");
}
if (labels.includes("ui")) {
reviewers.add("bfredl");
reviewers.add("famiu");
}
if (labels.includes("vim-patch")) {
reviewers.add("seandewar");
reviewers.add("zeertzjq");
}
// Remove person that opened the PR since they can't review themselves
const pr_opener = pr_data.data.user.login
reviewers.delete(pr_opener)
const pr_opener = pr_data.data.user.login;
reviewers.delete(pr_opener);
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers)
reviewers: Array.from(reviewers),
});
}
};

View File

@ -1,7 +1,7 @@
name: "Request reviews"
on:
pull_request_target:
types: [labeled, ready_for_review]
types: [labeled, ready_for_review, reopened]
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
@ -9,7 +9,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:

View File

@ -1,20 +0,0 @@
name: Missing API docs
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore:
- 'marvim/api-doc-update**'
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
jobs:
call-regen-api-docs:
if: github.event.pull_request.draft == false
permissions:
contents: write
pull-requests: write
uses: ./.github/workflows/api-docs.yml
with:
check_only: true

View File

@ -1,70 +1,38 @@
# Autogenerate the API docs on new commit to important branches
# Also work as a check for PR's to not forget committing their doc changes
# called from api-docs-check.yml
# Check if any PR needs to run the autogenerate script
name: Autogenerate API docs
on:
push:
pull_request:
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
workflow_dispatch:
workflow_call:
inputs:
check_only:
type: boolean
default: false
required: false
jobs:
regen-api-docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: rhysd/action-setup-vim@v1
with:
fetch-depth: 0
neovim: true
version: nightly
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y python3 luajit
conda install -c conda-forge doxygen=1.9.2 msgpack-python
echo "$CONDA/bin" >> $GITHUB_PATH
- name: Setup git config
run: |
git config --global user.name 'marvim'
git config --global user.email 'marvim@users.noreply.github.com'
- run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack
- name: Generate docs
id: docs
run: |
git checkout -b ${DOC_BRANCH}
python3 scripts/gen_vimdoc.py
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
run: |
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
echo "The doc generation produces the following changes:"
git --no-pager diff
exit 1
- name: Automatic PR
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
run: |
git add -u
git commit -m 'docs: regenerate [skip ci]'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
git diff --color --exit-code

View File

@ -2,32 +2,15 @@ name: Backport
on:
pull_request_target:
types: [closed, labeled]
issue_comment:
types: [created]
jobs:
backport:
permissions:
contents: write
pull-requests: write
name: Backport Pull Request
if: >
github.repository_owner == 'neovim' && (
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
) || (
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/backport')
)
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# required to find all branches
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v3
- name: Create backport PRs
uses: zeebe-io/backport-action@v0.0.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}
uses: korthout/backport-action@v1

73
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: build
on:
pull_request:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
paths:
- '**.cmake'
- '**/CMakeLists.txt'
- '**/CMakePresets.json'
- 'cmake.*/**'
- '.github/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
BIN_DIR: ${{ github.workspace }}/bin
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
jobs:
macos-universal:
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- name: Build universal binary
run: ./.github/scripts/build_universal_macos.sh
old-cmake:
name: Test oldest supported cmake
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.10.0'
steps:
- uses: actions/checkout@v3
- name: Set up environment
run: echo "$BIN_DIR" >> $GITHUB_PATH
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- name: Install minimum required version of cmake
run: |
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$BIN_DIR" /opt/cmake-custom
chmod a+x /tmp/cmake-installer.sh
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$BIN_DIR/cmake"
cmake_version="$(cmake --version | head -1)"
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
- name: Build dependencies
run: make deps
- name: Build
run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
- name: Install
run: make install

View File

@ -1,249 +0,0 @@
name: CI
on:
push:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
paths-ignore:
- 'runtime/doc/*'
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
lint:
# This job tests two things: it lints the code but also builds neovim using
# system dependencies instead of bundled dependencies. This is to make sure
# we are able to build neovim without pigeonholing ourselves into specifics
# of the bundled dependencies.
if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v2
- name: Setup common environment variables
run: ./.github/workflows/env.sh lint
- name: Install apt packages
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
ccache \
cmake \
flake8 \
gettext \
gperf \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool-bin \
libtree-sitter-dev \
libunibilium-dev \
libuv1-dev \
libvterm-dev \
locales \
lua-busted \
lua-check \
lua-filesystem \
lua-inspect \
lua-lpeg \
lua-luv-dev \
lua-nvim \
luajit \
ninja-build \
pkg-config
- name: Cache artifacts
uses: actions/cache@v2
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
~/.ccache
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party
run: ./ci/before_script.sh
- name: Build nvim
run: ./ci/run_tests.sh build_nvim
- if: "!cancelled()"
name: clint-full
run: ./ci/run_lint.sh clint-full
- if: "!cancelled()"
name: lualint
run: ./ci/run_lint.sh lualint
- if: "!cancelled()"
name: pylint
run: ./ci/run_lint.sh pylint
- if: "!cancelled()"
name: shlint
run: ./ci/run_lint.sh shlint
- if: "!cancelled()"
name: check-single-includes
run: ./ci/run_lint.sh check-single-includes
- name: Cache dependencies
run: ./ci/before_cache.sh
posix:
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
strategy:
fail-fast: false
matrix:
include:
- flavor: asan
cc: clang-13
runner: ubuntu-20.04
os: linux
- flavor: tsan
cc: clang-13
runner: ubuntu-20.04
os: linux
- cc: clang
runner: macos-10.15
os: osx
- cc: clang
runner: macos-11.0
os: osx
# The functionaltest-lua test two things simultaneously:
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
# 2. Use as oldest/minimum versions of dependencies/build tools we
# still explicitly support so we don't accidentally rely on
# features that is only available on later versions.
- flavor: functionaltest-lua
cc: gcc
runner: ubuntu-20.04
os: linux
cmake: minimum_required
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
if: github.event.pull_request.draft == false
env:
CC: ${{ matrix.cc }}
CI_OS_NAME: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup common environment variables
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
- name: Install apt packages
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
- name: Install minimum required version of cmake
if: matrix.cmake == 'minimum_required'
env:
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.10.0'
shell: bash
run: |
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
chmod a+x /tmp/cmake-installer.sh
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
cmake_version="$(cmake --version | head -1)"
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
- name: Install new clang
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
run: |
wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh
sudo ./llvm.sh 13
rm llvm.sh
- name: Install brew packages
if: matrix.os == 'osx'
run: |
brew update --quiet
brew install automake ccache cpanminus ninja
- name: Setup interpreter packages
run: ./ci/install.sh
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
~/.ccache
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party
run: ./ci/before_script.sh
- name: Build
run: ./ci/run_tests.sh build_nvim
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
name: Unittests
run: ./ci/run_tests.sh unittests
- if: matrix.flavor != 'tsan' && !cancelled()
name: Functionaltests
run: ./ci/run_tests.sh functionaltests
- if: "!cancelled()"
name: Oldtests
run: ./ci/run_tests.sh oldtests
- if: "!cancelled()"
name: Install nvim
run: ./ci/run_tests.sh install_nvim
- name: Cache dependencies
run: ./ci/before_cache.sh
windows:
runs-on: windows-2019
timeout-minutes: 45
if: github.event.pull_request.draft == false
env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
strategy:
fail-fast: false
matrix:
config: [ MINGW_64-gcov, MSVC_64 ]
name: windows (${{ matrix.config }})
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ${{ env.DEPS_BUILD_DIR }}
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
- name: Run CI
run: powershell ci\build.ps1
env:
CONFIGURATION: ${{ matrix.config }}

31
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: "CodeQL"
on:
schedule:
- cron: '42 0 * * 0'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@ -1,21 +0,0 @@
name: "Commit Linter"
on:
# Only pull_request and push honor [skip ci]. Since this workflow must pass
# to merge a PR, it can't be skipped, so use pull_request_target
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
lint-commits:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
path: pr_nvim
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
- run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua
- run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})"

View File

@ -1,19 +1,17 @@
name: Coverity
on:
schedule:
- cron: '0 10 * * 1' # Run every Monday at 00:10
- cron: '10 0 * * *' # Run every day at 00:10
workflow_dispatch:
jobs:
scan:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
run: ./.github/scripts/install_deps.sh
- name: Download Coverity
run: |
@ -37,7 +35,7 @@ jobs:
--form email=$EMAIL \
--form file=@cov-scan.tgz \
--form version="$(git rev-parse HEAD)" \
--form description="Weekly GHA scan" \
--form description="Daily GHA scan" \
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}

View File

@ -1,70 +0,0 @@
#!/bin/bash
set -e -u
FLAVOR=${1:-}
cat <<EOF >> "$GITHUB_PATH"
$HOME/.local/bin
EOF
cat <<EOF >> "$GITHUB_ENV"
CACHE_ENABLE=true
CI_TARGET=tests
CI_BUILD_DIR=$GITHUB_WORKSPACE
BUILD_DIR=$GITHUB_WORKSPACE/build
DEPS_BUILD_DIR=$HOME/nvim-deps
INSTALL_PREFIX=$HOME/nvim-install
LOG_DIR=$GITHUB_WORKSPACE/build/log
NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
CCACHE_BASEDIR=$GITHUB_WORKSPACE
CCACHE_COMPRESS=1
CCACHE_SLOPPINESS=time_macros,file_macro
CCACHE_DIR=$HOME/.ccache
EOF
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
FUNCTIONALTEST=functionaltest
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
case "$FLAVOR" in
asan)
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
cat <<EOF >> "$GITHUB_ENV"
CLANG_SANITIZER=ASAN_UBSAN
SYMBOLIZER=asan_symbolize-13
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
EOF
;;
tsan)
cat <<EOF >> "$GITHUB_ENV"
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
CLANG_SANITIZER=TSAN
EOF
;;
lint)
# Re-enable once system deps are available
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
cat <<EOF >> "$GITHUB_ENV"
USE_BUNDLED=OFF
CI_TARGET=lint
EOF
;;
functionaltest-lua)
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
FUNCTIONALTEST=functionaltest-lua
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
;;
*)
;;
esac
cat <<EOF >> "$GITHUB_ENV"
$BUILD_FLAGS
DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
FUNCTIONALTEST=$FUNCTIONALTEST
EOF

34
.github/workflows/issue-open-check.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Issue Open Check
on:
issues:
types: [opened]
jobs:
issue-open-check:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: check issue title
id: check-issue
uses: actions/github-script@v6
with:
script: |
const title = context.payload.issue.title;
const titleSplit = title.split(/\s+/).map(e => e.toLowerCase());
const keywords = ['api', 'treesitter', 'ui', 'lsp', 'doc'];
var match = new Set();
for(const keyword of keywords) {
if(titleSplit.includes(keyword)) {
match.add(keyword)
}
}
if(match.size !== 0){
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: Array.from(match)
})
}

View File

@ -10,9 +10,8 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@main
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: ""
type-scope:
@ -40,7 +39,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:

19
.github/workflows/lintcommit.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: "Commit Linter"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'master'
jobs:
lint-commits:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=false})"

34
.github/workflows/news.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: "news.txt check"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'master'
jobs:
check:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: news.txt needs to be updated
run: |
for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do
message=$(git log -n1 --pretty=format:%s $commit)
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
{
echo "
Pull request includes a new feature or a breaking change, but
news.txt hasn't been updated yet. This is just a reminder
that news.txt may need to be updated. You can ignore this CI
failure if you think the change won't be of interest to
users."
exit 1
}
fi
done

View File

@ -9,35 +9,24 @@ ${NVIM_VERSION}
#### Zip
1. Download **nvim-win64.zip**
2. Extract the zip.
2. Extract the zip
3. Run `nvim-qt.exe`
#### MSI
1. Download **nvim-win64.msi**
2. Run the MSI
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice
### macOS
1. Download **nvim-macos.tar.gz**
2. Extract: `tar xzvf nvim-macos.tar.gz`
3. Run `./nvim-osx64/bin/nvim`
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos.tar.gz`
4. Run `./nvim-macos/bin/nvim`
### Linux (x64)
#### Tarball
1. Download **nvim-linux64.tar.gz**
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim`
#### Debian Package
1. Download **nvim-linux64.deb**
2. Install the package using `sudo apt install ./nvim-linux64.deb`
3. Run `nvim`
#### AppImage
1. Download **nvim.appimage**
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
@ -47,6 +36,12 @@ ${NVIM_VERSION}
./squashfs-root/usr/bin/nvim
```
#### Tarball
1. Download **nvim-linux64.tar.gz**
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim`
### Other
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
@ -55,7 +50,6 @@ ${NVIM_VERSION}
```
${SHA_LINUX_64_TAR}
${SHA_LINUX_64_DEB}
${SHA_APP_IMAGE}
${SHA_APP_IMAGE_ZSYNC}
${SHA_MACOS}

View File

@ -13,158 +13,137 @@ on:
- v[0-9]+.[0-9]+.[0-9]+
# Build on the oldest supported images, so we have broader compatibility
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
jobs:
linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
CC: gcc-10
outputs:
version: ${{ steps.build.outputs.version }}
release: ${{ steps.build.outputs.release }}
container:
image: ubuntu:18.04
options: --privileged # Privileged mode is needed to load fuse module.
steps:
- uses: actions/checkout@v2
- name: Prepare container
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
apt-get update
apt-get install -y git gcc-10
apt-get install -y fuse libfuse2 # For linuxdeploy.
# Workaround for https://github.com/actions/checkout/issues/766.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
apt-get update
apt-get install -y build-essential cmake gettext ninja-build unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
run: |
echo 'NVIM_BUILD_TYPE=Release' >> $GITHUB_ENV
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
- name: Build release
run: |
echo 'NVIM_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
- name: appimage
run: ./scripts/genappimage.sh ${APPIMAGE_TAG}
- name: tar.gz
run: cpack --config build/CPackConfig.cmake -G TGZ
- uses: actions/upload-artifact@v3
with:
name: appimage
path: |
build/bin/nvim.appimage
build/bin/nvim.appimage.zsync
retention-days: 1
- uses: actions/upload-artifact@v3
with:
name: nvim-linux64
path: |
build/nvim-linux64.tar.gz
retention-days: 1
- name: Export version
id: build
run: |
CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
cd "$GITHUB_WORKSPACE/build/"
cpack -C $NVIM_BUILD_TYPE
- uses: actions/upload-artifact@v2
with:
name: nvim-linux64
path: build/nvim-linux64.tar.gz
retention-days: 1
- uses: actions/upload-artifact@v2
with:
name: nvim-linux64
path: build/nvim-linux64.deb
retention-days: 1
printf 'version<<END\n' >> $GITHUB_OUTPUT
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
printf 'END\n' >> $GITHUB_OUTPUT
appimage:
runs-on: ubuntu-18.04
macOS:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-11 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: CC=gcc-11 make appimage-nightly
- uses: actions/upload-artifact@v2
with:
name: appimage
path: build/bin/nvim.appimage
retention-days: 1
- uses: actions/upload-artifact@v2
with:
name: appimage
path: build/bin/nvim.appimage.zsync
retention-days: 1
macOS:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install brew packages
run: |
brew update --quiet
brew install automake ninja
run: ./.github/scripts/install_deps.sh
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
- name: Build release
run: |
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install
- name: Create package
run: |
cd "$GITHUB_WORKSPACE/build/release"
mkdir -p nvim-osx64/libs
libs=($(otool -L nvim-osx64/bin/nvim | sed 1d | sed -E -e 's|^[[:space:]]*||' -e 's| .*||'))
echo "libs:"
for lib in "${libs[@]}"; do
if echo "$lib" | grep -q -E 'libSystem|CoreFoundation' 2>/dev/null; then
echo " [skipped] $lib"
else
echo " $lib"
relname="libs/${lib##*/}"
cp -L "$lib" "nvim-osx64/$relname"
install_name_tool -change "$lib" "@executable_path/../$relname" nvim-osx64/bin/nvim
fi
done
tar cfz nvim-macos.tar.gz nvim-osx64
- uses: actions/upload-artifact@v2
- name: Build universal binary
run: ./.github/scripts/build_universal_macos.sh
- uses: actions/upload-artifact@v3
with:
name: nvim-macos
path: build/release/nvim-macos.tar.gz
path: build/nvim-macos.tar.gz
retention-days: 1
windows:
runs-on: windows-2019
env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
strategy:
matrix:
include:
- config: MSVC_64
archive: nvim-win64
name: windows (${{ matrix.config }})
name: windows (MSVC_64)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: powershell ci\build.ps1 -NoTests
env:
CONFIGURATION: ${{ matrix.config }}
- uses: actions/upload-artifact@v2
- name: Set env
run: |
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
"$name=$value" >> $env:GITHUB_ENV
}
}
- name: Build deps
run: |
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build .deps
- name: build package
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build build --target package
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.archive }}
path: build/${{ matrix.archive }}.zip
retention-days: 1
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.archive }}
path: build/${{ matrix.archive }}.msi
name: nvim-win64
path: |
build/nvim-win64.msi
build/nvim-win64.zip
retention-days: 1
publish:
needs: [linux, appimage, macOS, windows]
runs-on: ubuntu-20.04
needs: [linux, macOS, windows]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
# Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gettext-base
run: sudo apt-get update && sudo apt-get install -y gettext-base
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
@ -175,16 +154,12 @@ jobs:
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- if: env.TAG_NAME == 'nightly'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(echo 'SUBJECT=Nvim development (prerelease) build';
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true
- if: env.TAG_NAME != 'nightly'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(echo 'SUBJECT=Nvim release build';
echo 'PRERELEASE=') >> $GITHUB_ENV
@ -197,8 +172,6 @@ jobs:
cd ./nvim-linux64
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
- name: Generate App Image SHA256 checksums
run: |
cd ./appimage
@ -223,7 +196,6 @@ jobs:
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NVIM_VERSION: ${{ needs.linux.outputs.version }}
DEBUG: api
run: |
@ -232,3 +204,31 @@ jobs:
if [ "$TAG_NAME" != "nightly" ]; then
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
fi
publish-winget:
needs: publish
runs-on: windows-latest
steps:
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
name: Publish stable
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Neovim.Neovim
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
token: ${{ secrets.WINGET_TOKEN }}
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Get nightly version
id: get-version
run: |
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
Install-Module -Name 'Carbon.Windows.Installer' -Force
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
"version=$VERSION" >> $env:GITHUB_OUTPUT
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Publish nightly
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Neovim.Neovim.Nightly
version: ${{ steps.get-version.outputs.version }}
release-tag: nightly
token: ${{ secrets.WINGET_TOKEN }}

View File

@ -8,7 +8,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: 'Remove reviewers'
uses: actions/github-script@v6
with:

35
.github/workflows/response.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: no_response
on:
schedule:
- cron: '30 1 * * *' # Run every day at 01:30
workflow_dispatch:
issue_comment:
jobs:
close:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/close_unresponsive.js')
await script({github, context})
remove_label:
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/remove_response_label.js')
await script({github, context})

400
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,400 @@
name: test
on:
push:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
pull_request:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
paths-ignore:
- 'contrib/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:handle_abort=1:handle_sigill=1:log_path=${{ github.workspace }}/build/log/asan:intercept_tls_get_addr=0
BIN_DIR: ${{ github.workspace }}/bin
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
LOG_DIR: ${{ github.workspace }}/build/log
NVIM_LOG_FILE: ${{ github.workspace }}/build/.nvimlog
TSAN_OPTIONS: log_path=${{ github.workspace }}/build/log/tsan
UBSAN_OPTIONS: "print_stacktrace=1 log_path=${{ github.workspace }}/build/log/ubsan"
VALGRIND_LOG: ${{ github.workspace }}/build/log/valgrind-%p.log
# TEST_FILE: test/functional/core/startup_spec.lua
# TEST_FILTER: foo
jobs:
lint:
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
CACHE_UNCRUSTIFY: ${{ github.workspace }}/.cache/uncrustify
UNCRUSTIFY_VERSION: uncrustify-0.75.0
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh lua-check
- name: Set up Homebrew
id: homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: |
brew install stylua
- name: Cache uncrustify
id: cache-uncrustify
uses: actions/cache@v3
with:
path: ${{ env.CACHE_UNCRUSTIFY }}
key: ${{ env.UNCRUSTIFY_VERSION }}
- name: Clone uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: uncrustify/uncrustify
ref: ${{ env.UNCRUSTIFY_VERSION }}
path: uncrustify
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
source_dir=uncrustify
build_dir=uncrustify/build
cmake -S $source_dir -B $build_dir -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake --build $build_dir
mkdir -p .cache
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
- uses: ./.github/actions/cache
- name: Build third-party deps
run: |
cmake -S cmake.deps -B .deps -G Ninja
cmake --build .deps
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: configure
run: cmake -B build -G Ninja
- if: "!cancelled()"
name: Determine if run should be aborted
id: abort_job
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: stylua
run: cmake --build build --target lintlua-stylua
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: luacheck
run: cmake --build build --target lintlua-luacheck
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: lintsh
run: cmake --build build --target lintsh
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: clint.py
run: cmake --build build --target lintc-clint
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
run: cmake --build build --target clang-tidy
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: uncrustify
run: |
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
posix:
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
strategy:
fail-fast: false
matrix:
include:
- flavor: asan
cc: clang
runner: ubuntu-22.04
flags: -D ENABLE_ASAN_UBSAN=ON
- flavor: tsan
cc: clang
runner: ubuntu-22.04
flags: -D ENABLE_TSAN=ON
- flavor: uchar
cc: gcc
runner: ubuntu-22.04
flags: -D UNSIGNED_CHAR=ON
- cc: clang
runner: macos-12
# functionaltest-lua is our dumping ground for non-mainline configurations.
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
# 2. No treesitter parsers installed.
- flavor: functionaltest-lua
cc: gcc
runner: ubuntu-22.04
deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON
flags: -D PREFER_LUA=ON
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v3
- name: Set up environment
run: |
ulimit -c unlimited
echo "$BIN_DIR" >> $GITHUB_PATH
- name: Create log dir
run: mkdir -p "$LOG_DIR"
- name: Install dependencies
run: ./.github/scripts/install_deps.sh cpanminus
- name: Setup interpreter packages
run: |
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python."
CC=cc python3 -m pip -q install --user --upgrade pynvim
echo "Install neovim RubyGem."
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
echo "Install neovim npm package"
npm install -g neovim
npm link neovim
if [[ $RUNNER_OS != macOS ]]; then
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
fi
- uses: ./.github/actions/cache
- name: Build third-party deps
run: |
cmake -S cmake.deps -B .deps -G Ninja ${{ matrix.deps_flags }}
cmake --build .deps
- name: Build
run: |
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }} -D CI_BUILD=ON
cmake --build build
- if: "!cancelled()"
name: Determine if run should be aborted
id: abort_job
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Unittest
timeout-minutes: 5
run: cmake --build build --target unittest
- if: matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Functionaltest
timeout-minutes: 20
run: cmake --build build --target functionaltest
- if: matrix.flavor == 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Functionaltest with PUC Lua
timeout-minutes: 20
run: cmake --build build --target functionaltest-lua
- if: matrix.flavor != 'tsan' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Oldtest
run: make oldtest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Install
run: cmake --install build
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Installtests
run: |
"$INSTALL_PREFIX/bin/nvim" --version
if ! "$INSTALL_PREFIX/bin/nvim" -u NONE -e -c ':help' -c ':qall'; then
echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly."
echo 'Failed running :help'
exit 1
fi
# Check that all runtime files were installed
for file in $(git -C runtime ls-files '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' '*.awk' '*.sh' '*.bat'); do
if ! test -e "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
printf "It appears that %s is not installed." "$file"
exit 1
fi
done
# Check that generated syntax file has function names, #5060.
genvimsynf=syntax/vim/generated.vim
gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "$INSTALL_PREFIX/share/nvim/runtime/$genvimsynf"; then
echo "It appears that $genvimsynf does not contain $gpat."
exit 1
fi
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Show logs
run: cat $(find "$LOG_DIR" -type f)
build-types:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- uses: ./.github/actions/cache
- name: Build third-party deps
run: |
cmake -S cmake.deps -B .deps -G "Ninja Multi-Config"
cmake --build .deps
- name: Configure
run: cmake -B build -G "Ninja Multi-Config" -D CMAKE_C_COMPILER=gcc -D CI_BUILD=ON
- name: Release
run: cmake --build build --config Release
- name: RelWithDebInfo
run: cmake --build build --config RelWithDebInfo
- name: MinSizeRel
run: cmake --build build --config MinSizeRel
windows:
runs-on: windows-2022
timeout-minutes: 45
name: windows
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache
- name: Set env
run: |
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
"$name=$value" >> $env:GITHUB_ENV
}
}
- name: Build deps
run: |
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build .deps
- name: Build
run: |
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=ON
cmake --build build
- name: Install test deps
run: |
$PSNativeCommandArgumentPassing = 'Legacy'
& build\bin\nvim.exe "--version"
# Ensure that the "win32" feature is set.
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
python -m pip install pynvim
# Sanity check
python -c "import pynvim; print(str(pynvim))"
node --version
npm.cmd --version
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
- if: "!cancelled()"
name: Determine if run should be aborted
id: abort_job
run: |
"status=${{ job.status }}" >> $env:GITHUB_OUTPUT
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run functionaltest
timeout-minutes: 20
run: cmake --build build --target functionaltest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
uses: msys2/setup-msys2@v2
with:
update: true
pacboy: >-
make:p gcc:p
release: false
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run oldtest
shell: msys2 {0}
run: |
cd test/old/testdir
mingw32-make VERBOSE=1
with-external-deps:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
./.github/scripts/install_deps.sh
sudo apt-get install -y \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libunibilium-dev \
libuv1-dev \
lua-filesystem \
lua-lpeg \
lua-mpack \
luajit
# libtree-sitter-dev \
# libvterm-dev \
# lua-luv-dev
# Remove comments from packages once we start using these external
# dependencies.
- uses: ./.github/actions/cache
- name: Build third-party deps
run: |
# Ideally all dependencies should external for this job, but some
# dependencies don't have the required version available. We use the
# bundled versions for these with the hopes of being able to remove them
# later on.
cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED=OFF \
-D USE_BUNDLED_LUV=ON \
-D USE_BUNDLED_LIBVTERM=ON \
-D USE_BUNDLED_TS=ON
cmake --build .deps
- name: Build
run: |
cmake -B build -G Ninja -D CI_BUILD=ON
cmake --build build

View File

@ -2,28 +2,31 @@ name: vim-patches
on:
schedule:
- cron: '3 3 * * *'
workflow_dispatch:
jobs:
update-vim-patches:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
VIM_SOURCE_DIR: ${{ github.workspace }}/vim-src
VERSION_BRANCH: marvim/ci-version-update
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: vim/vim
path: ${{ env.VIM_SOURCE_DIR }}
fetch-depth: 0
- run: sudo apt-get install libfuse2
- run: |
gh release download -R neovim/neovim -p nvim.appimage
chmod a+x nvim.appimage
@ -31,7 +34,7 @@ jobs:
mv nvim.appimage $HOME/.local/bin/nvim
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
- name: Setup git config
- name: Set up git config
run: |
git config --global user.name 'marvim'
git config --global user.email 'marvim@users.noreply.github.com'
@ -40,8 +43,8 @@ jobs:
id: update-version
run: |
git checkout -b ${VERSION_BRANCH}
nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: Automatic PR
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}

34
.gitignore vendored
View File

@ -36,21 +36,21 @@ compile_commands.json
*.rej
# Generated by old (Vim) tests.
/src/nvim/testdir/del
/src/nvim/testdir/test*.out
/src/nvim/testdir/test*.res
/src/nvim/testdir/test*.log
/src/nvim/testdir/messages
/src/nvim/testdir/viminfo
/src/nvim/testdir/test.ok
/src/nvim/testdir/*.failed
/src/nvim/testdir/X*
/src/nvim/testdir/valgrind.*
/src/nvim/testdir/.gdbinit
/test/old/testdir/del
/test/old/testdir/test*.out
/test/old/testdir/test*.res
/test/old/testdir/test*.log
/test/old/testdir/messages
/test/old/testdir/viminfo
/test/old/testdir/test.ok
/test/old/testdir/*.failed
/test/old/testdir/X*
/test/old/testdir/valgrind.*
/test/old/testdir/.gdbinit
/runtime/indent/testdir/*.out
+runtime/indent/testdir/*.fail
# Generated by src/nvim/testdir/runnvim.sh.
/src/nvim/testdir/*.tlog
# Generated by test/old/testdir/runnvim.sh.
/test/old/testdir/*.tlog
# Generated by unit tests.
/test/includes/post/
@ -73,3 +73,11 @@ tags
# vim patches
/vim-*.patch
# nix build results
/result
/result-*
/contrib/result
/contrib/result-*
CMakeUserPresets.json

View File

@ -19,6 +19,10 @@ cache = true
ignore = {
"631", -- max_line_length
"212/_.*", -- unused argument, for vars with "_" prefix
"214", -- used variable with unused hint ("_" prefix)
"121", -- setting read-only global variable 'vim'
"122", -- setting read-only field of global variable 'vim'
"581", -- negation of a relational operator- operator can be flipped (not for tables)
}
-- Global objects defined by the C code
@ -28,8 +32,16 @@ read_globals = {
globals = {
"vim.g",
"vim.b",
"vim.w",
"vim.o",
"vim.bo",
"vim.wo",
"vim.go",
"vim.env"
}
exclude_files = {
'test/functional/fixtures/lua/syntax_error.lua',
'runtime/lua/vim/treesitter/_meta.lua'
}

View File

@ -8,13 +8,15 @@ Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
Billy Su <g4691821@gmail.com> Billy SU
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
Björn Linse <bjorn.linse@gmail.com> bfredl
bfredl <bjorn.linse@gmail.com>
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
Chris Kipp <ckipp@pm.me> ckipp01
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
Daniel Hahler <git@thequod.de> <github@thequod.de>
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
dundargoc <gocdundar@gmail.com> Dundar Goc
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
@ -52,6 +54,7 @@ Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
@ -92,7 +95,7 @@ Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
Thomas Vigouroux <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot

6
.stylua.toml Normal file
View File

@ -0,0 +1,6 @@
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Always"

3
.styluaignore Normal file
View File

@ -0,0 +1,3 @@
/scripts
/src
/test

View File

@ -1,220 +0,0 @@
dist: bionic
language: c
env:
global:
# Encrypted environment variables, see
# http://docs.travis-ci.com/user/encryption-keys/
#
# SNAP_SECRET_KEY: generated by:
# travis encrypt SNAP_SECRET_KEY=xx --add
# https://github.com/neovim/neovim/pull/11428
# snapcraft key expires after 1 year. Steps to refresh it:
# 1. snapcraft enable-ci travis --refresh
# 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
# 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
# 4. Undo changes to .travis.yml
- secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
- PATH="$HOME/.local/bin:$PATH"
# Set "false" to force rebuild of third-party dependencies.
- CACHE_ENABLE=true
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
- DEPS_BUILD_DIR="$HOME/nvim-deps"
# Install directory for Neovim.
- INSTALL_PREFIX="$HOME/nvim-install"
# Log directory for Clang sanitizers and Valgrind.
- LOG_DIR="$BUILD_DIR/log"
# Nvim log file.
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
# Default CMake flags.
- CMAKE_FLAGS="-DCI_BUILD=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DBUSTED_OUTPUT_TYPE=nvim
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=3"
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
# Environment variables for Clang sanitizers.
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
# If this file exists, the cache is valid (compile was successful).
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
# default target name for functional tests
- FUNCTIONALTEST=functionaltest
- CI_TARGET=tests
# Environment variables for ccache
- CCACHE_COMPRESS=1
- CCACHE_SLOPPINESS=time_macros,file_macro
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
- CI_OS_NAME="$TRAVIS_OS_NAME"
anchors:
envs: &common-job-env
# Do not fall back to cache for "master" for PR on "release" branch:
# adds the target branch to the cache key.
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
addons:
apt:
packages: &common-apt-packages
- apport
- autoconf
- automake
- build-essential
- clang
- cmake
- cpanminus
- cscope
- gcc-multilib
- gdb
- gperf
- language-pack-tr
- libtool-bin
- locales
- ninja-build
- pkg-config
- unzip
- valgrind
- xclip
homebrew:
update: true
casks:
- powershell
packages:
- ccache
- cpanminus
- ninja
- perl
jobs:
include:
- name: gcc-coverage (gcc 9)
os: linux
compiler: gcc-9
env:
- GCOV=gcov-9
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
- USE_LUACOV=1
- BUSTED_ARGS="--coverage"
- *common-job-env
addons:
snaps:
- name: powershell
confinement: classic
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- *common-apt-packages
- gcc-9
- name: gcc-functionaltest-lua
os: linux
compiler: gcc
env:
- FUNCTIONALTEST=functionaltest-lua
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- *common-job-env
- name: gcc-32bit
os: linux
# Travis creates a cache per compiler. Set a different value here to
# store 32-bit dependencies in a separate cache.
compiler: gcc
env:
- BUILD_32BIT=ON
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
- *common-job-env
- name: big-endian
os: linux
arch: s390x
compiler: gcc
env:
- FUNCTIONALTEST=functionaltest-lua
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- *common-job-env
addons:
apt:
packages:
- *common-apt-packages
- gettext
- python-pip
- python3-pip
- python-setuptools
- python3-setuptools
- python-dev
- python3-dev
- if: type != pull_request
name: snap
os: linux
env:
- LC_ALL: C.UTF-8
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
addons:
snaps:
- name: snapcraft
channel: stable
classic: true
- name: http
- name: transfer
- name: lxd
channel: stable
# Override default before_install, before_cache.
before_install: /bin/true
before_cache: /bin/true
install: ci/snap/install.sh
before_script: echo "Building snap..."
script: ci/snap/script.sh
after_success: ci/snap/after_success.sh
deploy:
skip_cleanup: true
provider: script
script: ci/snap/deploy.sh
on:
branch: master
allow_failures:
- env:
- LC_ALL: C.UTF-8
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
fast_finish: true
before_install: ci/before_install.sh
install: ci/install.sh
before_script: ci/before_script.sh
script: ci/script.sh
before_cache: ci/before_cache.sh
branches:
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true
ccache: true
directories:
- "$CACHE_NVIM_DEPS_DIR"
git:
quiet: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031

View File

@ -1,17 +1,18 @@
# CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
cmake_minimum_required(VERSION 3.10)
# Can be removed once minimum version is at least 3.15
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()
project(nvim C)
if(POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
if(POLICY CMP0060)
cmake_policy(SET CMP0060 NEW)
endif()
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
@ -19,30 +20,30 @@ endif()
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# We don't support building in-tree.
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(FindPackageHandleStandardArgs)
include(InstallHelpers)
include(LuaHelpers)
include(PreventInTreeBuilds)
include(Util)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
find_program(CCACHE_PRG ccache)
if(CCACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
endif()
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()
# Prefer our bundled versions of dependencies.
if(DEFINED ENV{DEPS_BUILD_DIR})
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
# *contain* system include paths. To avoid this, we prefix what would be
# "/usr/include" as "/_usr/include".
# This check is also performed in the third-party/CMakeLists.txt and in the
# else clause following here.
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
else()
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
endif()
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
else()
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_usr" CACHE PATH "Path prefix for finding dependencies")
else()
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
endif()
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
# When running from within CLion or Visual Studio,
# build bundled dependencies automatically.
if(NOT EXISTS ${DEPS_PREFIX}
@ -53,16 +54,16 @@ else()
file(MAKE_DIRECTORY ${DEPS_BUILD_DIR})
execute_process(
COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${PROJECT_SOURCE_DIR}/third-party
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-D CMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-D CMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
-D CMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
-D CMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-D CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-D CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${PROJECT_SOURCE_DIR}/cmake.deps
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
execute_process(
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
@ -71,43 +72,27 @@ else()
endif()
endif()
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
# used for check_c_compiler_flag
include(CheckCCompilerFlag)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# CMake tries to treat /sw and /opt/local as extension of the system path, but
# that doesn't really work out very well. Once you have a dependency that
# resides there and have to add it as an include directory, then any other
# dependency that could be satisfied from there must be--otherwise you can end
# up with conflicting versions. So, let's make them more of a priority having
# them be included as one of the first places to look for dependencies.
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
# Work around some old, broken detection by CMake for knowing when to use the
# isystem flag. Apple's compilers have supported this for quite some time
# now.
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
if(APPLE)
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done both here and in cmake.deps.
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(WIN32 OR APPLE)
# Ignore case when comparing filenames on Windows and Mac.
set(CASE_INSENSITIVE_FILENAME TRUE)
# Enable fixing case-insensitive filenames for Windows and Mac.
set(USE_FNAME_CASE TRUE)
endif()
option(ENABLE_LIBINTL "enable libintl" ON)
option(ENABLE_LIBICONV "enable libiconv" ON)
if (MINGW)
# Disable LTO by default as it may not compile
# See https://github.com/Alexpux/MINGW-packages/issues/3516
@ -119,431 +104,58 @@ endif()
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
# Build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG 1)
else()
set(DEBUG 0)
endif()
# Set available build types for CMake GUIs.
# Other build types can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
set_default_buildtype()
# If not in a git repo (e.g., a tarball) these tokens define the complete
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 7)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_MINOR 9)
set(NVIM_VERSION_PATCH 2)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
set(NVIM_API_LEVEL 9) # Bump this after any API change.
set(NVIM_API_LEVEL 11) # Bump this after any API change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
# NVIM_VERSION_CFLAGS set further below.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Log level (MIN_LOG_LEVEL in log.h)
if("${MIN_LOG_LEVEL}" MATCHES "^$")
# Minimize logging for release-type builds.
if(CMAKE_BUILD_TYPE STREQUAL "Release"
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"
OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds")
set(MIN_LOG_LEVEL 3)
else()
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
set(MIN_LOG_LEVEL 1)
endif()
else()
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
endif()
message(STATUS "MIN_LOG_LEVEL=${MIN_LOG_LEVEL}")
endif()
# Default to -O2 on release builds.
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
if(CMAKE_COMPILER_IS_GNUCC)
check_c_compiler_flag(-Og HAS_OG_FLAG)
else()
set(HAS_OG_FLAG 0)
endif()
#
# Build-type: RelWithDebInfo
#
if(HAS_OG_FLAG)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
# /Og means something different in MSVC
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
endif()
# We _want_ assertions in RelWithDebInfo build-type.
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
endif()
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
# does not work with Neovim due to some uses of dynamically-sized structures.
# https://github.com/neovim/neovim/issues/223
include(CheckCSourceCompiles)
# Include the build type's default flags in the check for _FORTIFY_SOURCE,
# otherwise we may incorrectly identify the level as acceptable and find out
# later that it was not when optimizations were enabled. CFLAGS is applied
# even though you don't see it in CMAKE_REQUIRED_FLAGS.
set(INIT_FLAGS_NAME CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE})
string(TOUPPER ${INIT_FLAGS_NAME} INIT_FLAGS_NAME)
if(${INIT_FLAGS_NAME})
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
endif()
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
# internal header files, which should in turn be #included by <string.h>.
check_c_source_compiles("
#include <string.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error \"_FORTIFY_SOURCE > 1\"
#endif
int
main(void)
{
return 0;
}
" HAS_ACCEPTABLE_FORTIFY)
if(NOT HAS_ACCEPTABLE_FORTIFY)
message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1")
# Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE).
STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}")
STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" )
if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "")
message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}")
endif()
# -U in add_definitions doesn't end up in the correct spot, so we add it to
# the flags variable instead.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
endif()
# Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374).
# TODO: Figure out the root cause.
if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
CMAKE_SHARED_LINKER_FLAGS MATCHES "--sort-common" OR
CMAKE_MODULE_LINKER_FLAGS MATCHES "--sort-common")
message(STATUS "Removing --sort-common from linker flags")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
# If no linker flags remain for a -Wl argument, remove it.
# '-Wl$' will match LDFLAGS="-Wl,--sort-common",
# '-Wl ' will match LDFLAGS="-Wl,--sort-common -Wl,..."
string(REGEX REPLACE "-Wl($| )" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REGEX REPLACE "-Wl($| )" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
endif()
check_c_source_compiles("
#include <execinfo.h>
int main(void)
{
void *trace[1];
backtrace(trace, 1);
return 0;
}
" HAVE_EXECINFO_BACKTRACE)
check_c_source_compiles("
int main(void)
{
int a = 42;
__builtin_add_overflow(a, a, &a);
__builtin_sub_overflow(a, a, &a);
return 0;
}
" HAVE_BUILTIN_ADD_OVERFLOW)
if(MSVC)
# XXX: /W4 gives too many warnings. #3241
add_compile_options(/W3)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DWIN32)
else()
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
-Wdouble-promotion
-Wmissing-noreturn
-Wmissing-format-attribute
-Wmissing-prototypes)
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
add_compile_options(-Wimplicit-fallthrough)
endif()
# Clang doesn't have -Wsuggest-attribute so check for each one.
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
add_compile_options(-Wsuggest-attribute=pure)
endif()
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
add_compile_options(-Wsuggest-attribute=const)
endif()
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
add_compile_options(-Wsuggest-attribute=malloc)
endif()
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
add_compile_options(-Wsuggest-attribute=cold)
endif()
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-c11-extensions)
endif()
endif()
if(MINGW)
# Use POSIX compatible stdio in Mingw
add_definitions(-D__USE_MINGW_ANSI_STDIO)
endif()
if(WIN32)
# Windows Vista is the minimum supported version
add_definitions(-D_WIN32_WINNT=0x0600)
endif()
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
if(HAS_WVLA_FLAG)
add_compile_options(-Wvla)
endif()
if(UNIX)
# -fstack-protector breaks non Unix builds even in Mingw-w64
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
add_compile_options(-fstack-protector-strong)
link_libraries(-fstack-protector-strong)
elseif(HAS_FSTACK_PROTECTOR_FLAG)
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
link_libraries(-fstack-protector --param ssp-buffer-size=4)
endif()
endif()
check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
if (HAVE_FNO_COMMON)
add_compile_options(-fno-common)
endif()
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
if(HAS_DIAG_COLOR_FLAG)
if(CMAKE_GENERATOR MATCHES "Ninja")
add_compile_options(-fdiagnostics-color=always)
else()
add_compile_options(-fdiagnostics-color=auto)
endif()
endif()
option(CI_BUILD "CI, extra flags will be set" OFF)
if(CI_BUILD)
message(STATUS "CI build enabled")
add_compile_options(-Werror)
if(DEFINED ENV{BUILD_32BIT})
# Get some test coverage for unsigned char
add_compile_options(-funsigned-char)
endif()
string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
endif()
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(LOG_DEBUG "Enable debug log messages even in a release build" OFF)
option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(NO_UNDEFINED "-Wl,--no-undefined -lsocket")
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(NO_UNDEFINED "-Wl,--no-undefined")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${NO_UNDEFINED}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${NO_UNDEFINED}")
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
# For ptsname(). #6743
add_definitions(-D_GNU_SOURCE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3")
# Required for luajit < 2.1.0-beta3.
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -image_base 100000000")
set(CMAKE_MODULE_LINKER_FLAGS
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
find_package(LibUV 1.28.0 REQUIRED)
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LibLUV 1.43.0 REQUIRED)
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
find_package(TreeSitter REQUIRED)
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}")
check_c_source_compiles("
#include <tree_sitter/api.h>
int
main(void)
{
TSQueryCursor *cursor = ts_query_cursor_new();
ts_query_cursor_set_match_limit(cursor, 32);
return 0;
}
" TS_HAS_SET_MATCH_LIMIT)
if(TS_HAS_SET_MATCH_LIMIT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
endif()
check_c_source_compiles("
#include <stdlib.h>
#include <tree_sitter/api.h>
int
main(void)
{
ts_set_allocator(malloc, calloc, realloc, free);
return 0;
}
" TS_HAS_SET_ALLOCATOR)
if(TS_HAS_SET_ALLOCATOR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
endif()
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
if(PREFER_LUA)
find_package(Lua 5.1 REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
find_package(LuaJit)
else()
find_package(LuaJit REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
endif()
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
check_c_source_compiles("
#include <msgpack.h>
int
main(void)
{
return MSGPACK_OBJECT_FLOAT32;
}
" MSGPACK_HAS_FLOAT32)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
if(MSGPACK_HAS_FLOAT32)
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
endif()
option(FEAT_TUI "Enable the Terminal UI" ON)
if(FEAT_TUI)
find_package(UNIBILIUM 2.0 REQUIRED)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
check_c_source_compiles("
#include <unibilium.h>
int
main(void)
{
return unibi_num_from_var(unibi_var_from_num(0));
}
" UNIBI_HAS_VAR_FROM)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
if(UNIBI_HAS_VAR_FROM)
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
endif()
find_package(LibTermkey 0.18 REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif()
find_package(LIBVTERM 0.1 REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
if(WIN32)
find_package(Winpty 0.4.3 REQUIRED)
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
endif()
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
if((CLANG_ASAN_UBSAN AND CLANG_MSAN)
OR (CLANG_ASAN_UBSAN AND CLANG_TSAN)
OR (CLANG_MSAN AND CLANG_TSAN))
if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
OR (ENABLE_ASAN_UBSAN AND ENABLE_TSAN)
OR (ENABLE_MSAN AND ENABLE_TSAN))
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
endif()
if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR "Sanitizers are only supported for Clang")
if(ENABLE_ASAN_UBSAN OR ENABLE_MSAN OR ENABLE_TSAN)
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_C_COMPILER_ID MATCHES "GNU")
message(FATAL_ERROR "Sanitizers are only supported for Clang and GCC")
endif()
endif()
if(ENABLE_LIBICONV)
find_package(Iconv REQUIRED)
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
endif()
if(ENABLE_LIBINTL)
# LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464
find_package(LibIntl REQUIRED)
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
endif()
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
# explicitly to indicate a strong preference for pthread.
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads REQUIRED)
# Place targets in bin/ or lib/ for all build configurations
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@ -555,8 +167,6 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
endforeach()
# Find Lua interpreter
include(LuaHelpers)
set(LUA_DEPENDENCIES lpeg mpack bit)
if(NOT LUA_PRG)
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
@ -583,12 +193,19 @@ endif()
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
if(DEBUG)
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" OFF)
else()
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
# Some of the code generation still relies on stable table ordering in order to
# produce reproducible output - specifically the msgpack'ed data in
# funcs_metadata.generated.h and ui_events_metadata.generated.h. This should
# ideally be fixed in the generators, but until then as a workaround you may provide
# a specific lua implementation that provides the needed stability by setting LUA_GEN_PRG:
if(NOT LUA_GEN_PRG)
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
endif()
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
if(COMPILE_LUA AND NOT WIN32)
if(PREFER_LUA)
foreach(CURRENT_LUAC_PRG luac5.1 luac)
@ -610,172 +227,91 @@ if(LUAC_PRG)
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
endif()
# Setup busted.
find_program(BUSTED_PRG NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua)
if(NOT BUSTED_OUTPUT_TYPE)
set(BUSTED_OUTPUT_TYPE "nvim")
endif()
#
# Lint
#
find_program(LUACHECK_PRG luacheck)
find_program(FLAKE8_PRG flake8)
find_program(GPERF_PRG gperf)
find_program(SHELLCHECK_PRG shellcheck)
find_program(STYLUA_PRG stylua)
find_program(UNCRUSTIFY_PRG uncrustify)
include(InstallHelpers)
add_glob_target(
REQUIRED
TARGET lintlua-luacheck
COMMAND ${LUACHECK_PRG}
FLAGS -q
GLOB_DIRS runtime/ scripts/ src/ test/
GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE)
add_glob_target(
TARGET lintlua-stylua
COMMAND ${STYLUA_PRG}
FLAGS --color=always --check
GLOB_DIRS runtime/
GLOB_PAT *.lua
EXCLUDE
/runtime/lua/vim/re.lua
TOUCH_STRATEGY SINGLE)
add_custom_target(lintlua)
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
add_glob_target(
TARGET lintsh
COMMAND ${SHELLCHECK_PRG}
FLAGS -x -a
GLOB_DIRS scripts
GLOB_PAT *.sh
EXCLUDE
scripts/pvscheck.sh
TOUCH_STRATEGY SINGLE)
add_custom_target(lintcommit
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM)
add_dependencies(lintcommit nvim)
add_custom_target(lint)
add_dependencies(lint clang-tidy lintc lintlua lintsh lintcommit)
#
# Format
#
add_custom_target(formatlua
COMMAND ${CMAKE_COMMAND}
-D FORMAT_PRG=${STYLUA_PRG}
-D LANG=lua
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_custom_target(format)
add_dependencies(format formatc formatlua)
file(GLOB MANPAGES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
man/nvim.1)
install_helper(
FILES ${MANPAGES}
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
#
# Go down the tree.
#
if(EXISTS "${DEPS_PREFIX}/share/nvim-qt")
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON)
else()
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" OFF)
endif()
add_subdirectory(src/nvim)
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes)
add_subdirectory(config)
add_subdirectory(test/functional/fixtures) # compile test programs
add_subdirectory(cmake.config)
add_subdirectory(runtime)
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
if(WIN32)
add_subdirectory(test)
if(WIN32 AND USE_BUNDLED_NVIMQT)
install_helper(
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim-qt/runtime/plugin)
endif()
# Setup some test-related bits. We do this after going down the tree because we
# need some of the targets.
if(BUSTED_PRG)
get_property(TEST_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY INCLUDE_DIRECTORIES)
# When running tests from 'ninja' we need to use the
# console pool: to do so we need to use the USES_TERMINAL
# option, but this is only available in CMake 3.2
set(TEST_TARGET_ARGS)
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test streams-test tty-test ${GENERATED_HELP_TAGS})
set(BENCHMARK_PREREQS nvim tty-test)
# Useful for automated build systems, if they want to manually run the tests.
add_custom_target(unittest-prereqs
DEPENDS ${UNITTEST_PREREQS})
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
add_custom_target(functionaltest-prereqs
DEPENDS ${FUNCTIONALTEST_PREREQS})
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_PREREQS})
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
if(LUA_HAS_FFI)
add_custom_target(unittest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=unit
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(unittest PROPERTIES FOLDER test)
else()
message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}")
endif()
if(LUA_HAS_FFI)
set(TEST_LIBNVIM_PATH $<TARGET_FILE:nvim-test>)
else()
set(TEST_LIBNVIM_PATH "")
endif()
configure_file(
${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
file(GENERATE
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(functionaltest functionaltest-prereqs
PROPERTIES FOLDER test)
add_custom_target(benchmark
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=benchmark
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
endif()
if(BUSTED_LUA_PRG)
add_custom_target(functionaltest-lua
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_LUA_PRG}
-DLUA_PRG=${LUA_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
endif()
if(LUACHECK_PRG)
add_custom_target(lualint
COMMAND ${LUACHECK_PRG} -q runtime/ scripts/ src/ test/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_custom_target(lualint false
COMMENT "lualint: LUACHECK_PRG not defined")
endif()
#add uninstall target
if(NOT TARGET uninstall)
configure_file(
"cmake/UninstallHelper.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
endif()
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(packaging)
add_subdirectory(cmake.packaging)
endif()

98
CMakePresets.json Normal file
View File

@ -0,0 +1,98 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "default",
"displayName": "RelWithDebInfo",
"description": "Enables optimizations (-Og or -O2) with debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"inherits": ["base"]
},
{
"name": "debug",
"displayName": "Debug",
"description": "Disables optimizations (-O0), enables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"inherits": ["base"]
},
{
"name": "release",
"displayName": "Release",
"description": "Same as RelWithDebInfo, but disables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
},
"inherits": ["base"]
},
{
"name": "windows-default",
"displayName": "Windows x64 RelWithDebInfo",
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": ["Windows"]
}
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"inherits": ["base"]
},
{
"name": "iwyu",
"displayName": "IWYU",
"description": "Run include-what-you-use with the compiler",
"cacheVariables": {
"ENABLE_IWYU": "ON"
},
"inherits": ["base"]
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "windows-default",
"configurePreset": "windows-default",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "iwyu",
"configurePreset": "iwyu"
}
]
}

View File

@ -10,8 +10,11 @@ low-risk/isolated tasks:
- Try a [complexity:low] issue.
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity).
- [Improve documentation][wiki-contribute-help]
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
- [Improve documentation](#documenting)
- [Merge a Vim patch] (requires strong familiarity with Vim)
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
- Lua files are maintained by Nvim.
Reporting problems
------------------
@ -30,15 +33,20 @@ Reporting problems
Developer guidelines
--------------------
- Read `:help dev` if you are working on Nvim core.
- Read `:help dev-ui` if you are developing a UI.
- Read `:help dev-api-client` if you are developing an API client.
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
- Install `ninja` for faster builds of Nvim.
```
sudo apt-get install ninja-build
make distclean
make # Nvim build system uses ninja automatically, if available.
```
- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically
if it's found. To disable caching use:
```
CCACHE_DISABLE=true make
```
Pull requests (PRs)
---------------------
@ -47,21 +55,19 @@ Pull requests (PRs)
- Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a **rebase workflow** for small PRs.
- After addressing review comments, it's fine to rebase and force-push.
- Use a **merge workflow** for big, high-risk PRs.
- Use a _rebase workflow_ for small PRs.
- After addressing review comments, it's fine to force-push.
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
- Merge `master` into your PR when there are conflicts or when master
introduces breaking changes.
- Use the `ri` git alias:
```
[alias]
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
```
This avoids unnecessary rebases yet still allows you to combine related
commits, separate monolithic commits, etc.
- Do not edit commits that come before the merge commit.
- During a squash/fixup, use `exec make -C build unittest` between each
pick/edit/reword.
### Merging to master
For maintainers: when a PR is ready to merge to master,
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
### Stages: Draft and Ready for review
@ -92,7 +98,7 @@ the VCS/git logs more valuable. The general structure of a commit message is:
```
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
- _Description_ shouldn't start with a capital letter or end in a period.
@ -111,34 +117,20 @@ the VCS/git logs more valuable. The general structure of a commit message is:
### Automated builds (CI)
Each pull request must pass the automated builds on [sourcehut] and [GitHub Actions].
Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Actions].
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
will fail the build.
- If any tests fail, the build will fail.
See [test/README.md#running-tests][run-tests] to run tests locally.
Passing locally doesn't guarantee passing the CI build, because of the
different compilers and platforms tested against.
- If any tests fail, the build will fail. See [test/README.md#running-tests][run-tests] to run tests locally.
- CI runs [ASan] and other analyzers.
- To run valgrind locally: `VALGRIND=1 make test`
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON"`
- The [lint](#lint) build checks modified lines _and their immediate
neighbors_, to encourage incrementally updating the legacy style to meet our
[style](#style). (See [#3174][3174] for background.)
- CI for freebsd and openbsd runs on [sourcehut].
- To get a backtrace on freebsd (after connecting via ssh):
```sh
sudo pkg install tmux # If you want tmux.
lldb build/bin/nvim -c nvim.core
# To get a full backtrace:
# 1. Rebuild with debug info.
rm -rf nvim.core build
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim
# 2. Run the failing test to generate a new core file.
TEST_FILE=test/functional/foo.lua gmake functionaltest
lldb build/bin/nvim -c nvim.core
```
- CI for FreeBSD runs on [Cirrus CI].
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
[test.yml](https://github.com/neovim/neovim/blob/e35b9020b16985eee26e942f9a3f6b045bc3809b/.github/workflows/test.yml#L29).
### Clang scan-build
@ -191,11 +183,11 @@ master build. To view the defects, just request access; you will be approved.
- To build Neovim with sanitizers enabled, use
```
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DENABLE_ASAN_UBSAN=1" make
```
- When running Neovim, use
```
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan,handle_abort=1,handle_sigill=1 nvim args...
```
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
@ -218,6 +210,11 @@ You can lint a single file (but this will _not_ exclude legacy errors):
### Style
- You can format files by using:
```
make format
```
This will format changed Lua and C files with all appropriate flags set.
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
```
@ -240,15 +237,67 @@ You can lint a single file (but this will _not_ exclude legacy errors):
```
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
unmaintained and won't recognize many function signatures in Neovim source.)
- Recommendation is to use **[clangd]**.
Can use the maintained config in [nvim-lspconfig/clangd].
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- If using [lua-language-server][], symlink `contrib/luarc.json` into the
- If using [lua-language-server], symlink `contrib/luarc.json` into the
project root:
$ ln -s contrib/luarc.json .luarc.json
### Includes
For managing includes in C files, use [include-what-you-use].
- [Install include-what-you-use][include-what-you-use-install]
- To see which includes needs fixing use the cmake preset `iwyu`:
```
cmake --preset iwyu
cmake --build --preset iwyu
```
- There's also a make target that automatically fixes the suggestions from
IWYU:
```
make iwyu
```
See [#549][549] for more details.
Documenting
-----------
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
## Lua docstrings
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
```lua
--- {Brief}
---
--- {Long explanation}
---
---@param arg1 type {description}
---@param arg2 type {description}
{...}
---
---@return type {description}
```
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
```
---@private
```
Mark functions that are deprecated as
```
---@deprecated
```
Reviewing
---------
@ -266,30 +315,36 @@ commits in the feature branch which aren't in the `master` branch; `-p`
shows each commit's diff. To show the whole surrounding function of a change
as context, use the `-W` argument as well.
[549]: https://github.com/neovim/neovim/issues/549
[1820]: https://github.com/neovim/neovim/pull/1820
[3174]: https://github.com/neovim/neovim/issues/3174
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
[Clang report]: https://neovim.io/doc/reports/clang/
[GitHub Actions]: https://github.com/neovim/neovim/actions
[clangd]: https://clangd.llvm.org
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[conventional_commits]: https://www.conventionalcommits.org
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[gh]: https://cli.github.com/
[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
[github-issues]: https://github.com/neovim/neovim/issues
[1820]: https://github.com/neovim/neovim/pull/1820
[gh]: https://cli.github.com/
[conventional_commits]: https://www.conventionalcommits.org
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[3174]: https://github.com/neovim/neovim/issues/3174
[sourcehut]: https://builds.sr.ht/~jmk
[GitHub Actions]: https://github.com/neovim/neovim/actions
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[Clang report]: https://neovim.io/doc/reports/clang/
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
[lua-language-server]: https://github.com/sumneko/lua-language-server/
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
[uncrustify]: http://uncrustify.sourceforge.net/
[lua-language-server]: https://github.com/sumneko/lua-language-server/
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ

View File

@ -8,7 +8,7 @@ Neovim's license follows:
====
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@ -196,10 +196,11 @@ The externally maintained libraries used by Neovim are:
- libtermkey: MIT license
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
- libvterm: MIT license
- lua-cjson: MIT license
- lua-compat: MIT license
- tree-sitter: MIT license
- xdiff: LGPL license
- lua-cjson: MIT license
- unibilium: LGPL v3
- xdiff: LGPL v2
====

View File

@ -12,23 +12,23 @@ General guidelines
* Use automation to solve problems
* Never break the API... but sometimes break the UI
Ticket triage
-------------
Issue triage
------------
In practice we haven't found a way to forecast more precisely than "next" and
"after next". So there are usually one or two (at most) planned milestones:
- Next bugfix-release (1.0.x)
- Next feature-release (1.x.0)
* Next bugfix-release (1.0.x)
* Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
- PRs nearing completion.
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
* PRs nearing completion.
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
for having a plan written down: it is _closer to completion_ than tickets
without a plan.
- Comment activity or new information.
* Comment activity or new information.
Anything that isn't in the next milestone, and doesn't have a finished PR—is
just not something you care very much about, by construction. Post-release you
@ -50,49 +50,89 @@ has a major bug:
1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`.
- Run `./scripts/release.sh`
- Update (force-push) the remote `stable` tag.
- The [nightly job](https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml#L4)
will update the release assets based on the `stable` tag.
* Run `./scripts/release.sh`
* Update (force-push) the remote `stable` tag.
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
will update the release assets and force-push to the `stable` tag.
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
In order to trigger the action, a PR must be labeled with a label matching the
form `backport release-0.X`. If the label is applied before the PR is merged,
the backport will be filed automatically against the target branch. Otherwise,
comment `\backport` on the merged PR *after* the label has been applied to trigger
a backport. Note, the PR must have a description in the issue body, or the backport
will fail.
### Release automation
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
Third-party dependencies
------------------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
Some can be auto-bumped by `scripts/bump_deps.lua`.
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
* [Lua](https://www.lua.org/download.html)
* [Luv](https://github.com/luvit/luv)
* When bumping, also sync [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs.md).
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
* [libtermkey](https://github.com/neovim/libtermkey)
* [libuv](https://github.com/libuv/libuv)
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
* [unibilium](https://github.com/neovim/unibilium)
### Vendored dependencies
These dependencies are "vendored" (inlined), we must update the sources manually:
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
* send improvements upstream!
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
* Run `scripts/update_terminfo.sh` to update these definitions.
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
### Forks
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
CI
--------------
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
- [Lua](https://www.lua.org/download.html)
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
- [Luv](https://github.com/luvit/luv)
- [libtermkey](https://github.com/neovim/libtermkey)
- [libuv](https://github.com/libuv/libuv)
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
### General
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
See `./scripts/bump-deps.sh -h` for more detailed usage
- Run `./scripts/bump-deps.sh --pr` to create a pr
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
As our CI is primarily dependent on GitHub Actions at the moment, then so will
our CI strategy be. The following guidelines have worked well for us so far:
These dependencies are "vendored" (inlined), we need to update the sources manually:
- [libmpack](https://github.com/libmpack/libmpack)
- [xdiff](https://github.com/git/git/tree/master/xdiff)
- [lua-cjson](https://github.com/openresty/lua-cjson)
- [Klib](https://github.com/attractivechaos/klib)
* Never use a macOS runner if an Ubuntu or a Windows runner can be used
instead. This is because macOS runners have a [tighter restrictions on the
number of concurrent jobs](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits).
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
https://github.com/neovim/neovim/wiki/Deps
### Runner versions
* For special-purpose jobs where the runner version doesn't really matter,
prefer `-latest` tags so we don't need to manually bump the versions. An
example of a special-purpose workflow is `labeler.yml`.
* For our testing jobs, which are in `test.yml` and `build.yml`, prefer to use
the latest stable (i.e. non-beta) version explicitly. Avoid using the
`-latest` tags here as it makes it difficult to determine from an unrelated
PR if a failure is due to the PR itself or due to GitHub bumping the
`-latest` tag without our knowledge. There's also a high risk that automatic
bumping the CI versions will fail due to manual work being required from
experience.
* For our release job, which is `release.yml`, prefer to use the oldest stable
(i.e. non-deprecated) versions available. The reason is that we're trying to
produce images that work in the broadest number of environments, and
therefore want to use older releases.
See also
--------
- https://github.com/neovim/neovim/issues/862
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
* https://github.com/neovim/neovim/issues/862
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt

103
Makefile
View File

@ -47,19 +47,12 @@ endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(CMAKE_GENERATOR))
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
BUILD_TOOL = ninja
else
# User's version of CMake doesn't support Ninja
BUILD_TOOL = $(MAKE)
CMAKE_GENERATOR := Unix Makefiles
endif
BUILD_TOOL = ninja
else
BUILD_TOOL = $(MAKE)
endif
endif
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
ifeq ($(CMAKE_GENERATOR),Ninja)
ifneq ($(VERBOSE),)
@ -72,8 +65,7 @@ ifeq ($(CMAKE_GENERATOR),Ninja)
endif
DEPS_CMAKE_FLAGS ?=
# Back-compat: USE_BUNDLED_DEPS was the old name.
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
USE_BUNDLED ?=
ifneq (,$(USE_BUNDLED))
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED)
@ -102,7 +94,7 @@ build/.ran-cmake: | deps
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
touch $@
deps: | build/.ran-third-party-cmake
deps: | build/.ran-deps-cmake
ifeq ($(call filter-true,$(USE_BUNDLED)),)
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
endif
@ -110,80 +102,49 @@ endif
ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR):
mkdir -p "$@"
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
cd $(DEPS_BUILD_DIR) && \
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/third-party
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
endif
build/.ran-third-party-cmake::
build/.ran-deps-cmake::
mkdir -p build
touch $@
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
oldtest: | nvim build/runtime/doc/tags
+$(SINGLE_MAKE) -C src/nvim/testdir clean
+$(SINGLE_MAKE) -C test/old/testdir clean
ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
else
@# Handle TEST_FILE=test_foo{,.res,.vim}.
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
endif
# Build oldtest by specifying the relative .vim filename.
.PHONY: phony_force
src/nvim/testdir/%.vim: phony_force
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
build/runtime/doc/tags helptags: | nvim
+$(BUILD_TOOL) -C build runtime/doc/tags
# Builds help HTML _and_ checks for invalid help tags.
helphtml: | nvim build/runtime/doc/tags
+$(BUILD_TOOL) -C build doc_html
functionaltest: | nvim
+$(BUILD_TOOL) -C build functionaltest
test/old/testdir/%.vim: phony_force
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
functionaltest-lua: | nvim
+$(BUILD_TOOL) -C build functionaltest-lua
$(BUILD_TOOL) -C build $@
lualint: | build/.ran-cmake deps
$(BUILD_TOOL) -C build lualint
FORMAT=formatc formatlua format
LINT=lintlua lintsh lintc clang-tidy lintcommit lint
TEST=functionaltest unittest
generated-sources benchmark uninstall $(FORMAT) $(LINT) $(TEST): | build/.ran-cmake
$(CMAKE_PRG) --build build --target $@
shlint:
@shellcheck --version | head -n 2
shellcheck scripts/vim-patch.sh
test: $(TEST)
_opt_shlint:
@command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
|| echo "SKIP: shlint (shellcheck not found)"
pylint:
flake8 contrib/ scripts/ src/ test/
# Run pylint only if flake8 is installed.
_opt_pylint:
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|| echo "SKIP: pylint (flake8 not found)"
commitlint:
$(NVIM_PRG) -u NONE -es +"lua require('scripts.lintcommit').main({trace=false})"
_opt_commitlint:
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|| echo "SKIP: commitlint (build/bin/nvim not found)"
unittest: | nvim
+$(BUILD_TOOL) -C build unittest
benchmark: | nvim
+$(BUILD_TOOL) -C build benchmark
test: functionaltest unittest
iwyu: build/.ran-cmake
cmake --preset iwyu
cmake --build --preset iwyu > build/iwyu.log
iwyu-fix-includes --only_re="src/nvim" --ignore_re="src/nvim/(auto|map.h|eval/encode.c)" --safe_headers < build/iwyu.log
cmake -B build -U ENABLE_IWYU
clean:
+test -d build && $(BUILD_TOOL) -C build clean || true
$(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean
$(MAKE) -C test/old/testdir clean
$(MAKE) -C runtime/indent clean
distclean:
@ -193,18 +154,6 @@ distclean:
install: checkprefix nvim
+$(BUILD_TOOL) -C build install
clint: build/.ran-cmake
+$(BUILD_TOOL) -C build clint
clint-full: build/.ran-cmake
+$(BUILD_TOOL) -C build clint-full
check-single-includes: build/.ran-cmake
+$(BUILD_TOOL) -C build check-single-includes
generated-sources: build/.ran-cmake
+$(BUILD_TOOL) -C build generated-sources
appimage:
bash scripts/genappimage.sh
@ -214,8 +163,6 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
ifeq ($(CMAKE_GENERATOR),Ninja)
@ -226,4 +173,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark uninstall $(FORMAT) $(LINT) $(TEST)

View File

@ -1,23 +1,18 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
<a href="https://neovim.io/doc/">Documentation</a> |
<a href="https://app.element.io/#/room/#neovim:matrix.org">Chat</a>
</h1>
[Documentation](https://neovim.io/doc/general/) |
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
[Twitter](https://twitter.com/Neovim)
[![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
[![Codecov coverage](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim)
[![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
[![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
[![Packages](https://repology.org/badge/tiny-repos/neovim.svg)](https://repology.org/metapackage/neovim)
[![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim)
[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/)
[![nvim](https://snapcraft.io//nvim/badge.svg)](https://snapcraft.io/nvim)
Neovim is a project that seeks to aggressively refactor Vim in order to:
Neovim is a project that seeks to aggressively refactor [Vim](https://www.vim.org/) in order to:
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
- Split the work between multiple developers
@ -32,7 +27,7 @@ Features
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java,
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin,
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
@ -40,7 +35,7 @@ Features
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
- Compatible with most Vim plugins, including Ruby and Python plugins
See [`:help nvim-features`][nvim-features] for the full list!
See [`:help nvim-features`][nvim-features] for the full list, and [`:help news`][nvim-news] for noteworthy changes in the latest version!
Install from package
--------------------
@ -53,7 +48,7 @@ Pre-built packages for Windows, macOS, and Linux are found on the
Install from source
-------------------
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page and [supported platforms](https://neovim.io/doc/user/support.html#supported-platforms) for details.
The build is CMake-based, but a Makefile is provided as a convenience.
After installing the dependencies, run the following command.
@ -63,7 +58,7 @@ After installing the dependencies, run the following command.
To install to a non-default location:
make CMAKE_INSTALL_PREFIX=/full/path/
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/
make install
CMake hints for inspecting the build:
@ -80,9 +75,10 @@ See [`:help nvim-from-vim`](https://neovim.io/doc/user/nvim.html#nvim-from-vim)
Project layout
--------------
├─ ci/ build automation
├─ cmake/ build scripts
├─ runtime/ user plugins/docs
├─ cmake/ CMake utils
├─ cmake.config/ CMake defines
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
├─ runtime/ plugins and docs
├─ src/nvim/ application source code (see src/nvim/README.md)
│ ├─ api/ API subsystem
│ ├─ eval/ VimL subsystem
@ -93,7 +89,6 @@ Project layout
│ ├─ msgpack_rpc/ RPC subsystem
│ ├─ os/ low-level platform code
│ └─ tui/ built-in UI
├─ third-party/ CMake subproject to build dependencies
└─ test/ tests (see test/README.md)
License
@ -107,20 +102,21 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
encouraged to make a donation for needy children in Uganda. Please see the
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
http://iccf-holland.org/
http://www.vim.org/iccf/
http://www.iccf.nl/
https://iccf-holland.org/
https://www.vim.org/iccf/
https://www.iccf.nl/
You can also sponsor the development of Vim. Vim sponsors can vote for
features. The money goes to Uganda anyway.
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
[nvim-news]: https://neovim.io/doc/user/news.html
[Roadmap]: https://neovim.io/roadmap/
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
[Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
[Ubuntu]: https://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
mkdir -p "${HOME}/.cache"
echo "before_cache.sh: cache size"
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
echo "before_cache.sh: ccache stats"
ccache -s 2>/dev/null || true
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
find "${HOME}/.ccache" -name stats -delete
# Update the third-party dependency cache only if the build was successful.
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
# Do not cache downloads. They should not be needed with up-to-date deps.
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
rm -rf "${CACHE_NVIM_DEPS_DIR}"
mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
fi

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
# Test some of the configuration variables.
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
echo "\$GCOV: '${GCOV}' is not executable."
exit 1
fi
if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; then
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
exit 1
fi
echo "before_script.sh: ccache stats (will be cleared)"
ccache -s
# Reset ccache stats for real results in before_cache.
ccache --zero-stats
# Compile dependencies.
build_deps
# Install cluacov for Lua coverage.
if [[ "$USE_LUACOV" == 1 ]]; then
"${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov
fi
rm -rf "${LOG_DIR}"
mkdir -p "${LOG_DIR}"

View File

@ -1,186 +0,0 @@
param([switch]$NoTests)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
$bits = $Matches.bits
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
$depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
}
$nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim';
DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
}
if ($env:DEPS_BUILD_DIR -eq $null) {
$env:DEPS_BUILD_DIR = ".deps";
}
$uploadToCodeCov = $false
function exitIfFailed() {
if ($LastExitCode -ne 0) {
exit $LastExitCode
}
}
if (-not $NoTests) {
node --version
npm.cmd --version
}
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
mkdir $env:DEPS_BUILD_DIR
} else {
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
}
if ($compiler -eq 'MINGW') {
if ($bits -eq 32) {
$arch = 'i686'
}
elseif ($bits -eq 64) {
$arch = 'x86_64'
}
if ($compileOption -eq 'gcov') {
$nvimCmakeVars['USE_GCOV'] = 'ON'
$uploadToCodecov = $true
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
# Setup/build Lua coverage.
$env:USE_LUACOV = 1
$env:BUSTED_ARGS = "--coverage"
}
# These are native MinGW builds, but they use the toolchain inside
# MSYS2, this allows using all the dependencies and tools available
# in MSYS2, but we cannot build inside the MSYS2 shell.
$cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
"mingw-w64-$arch-$_"
})
# Add MinGW to the PATH
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
# Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
}
elseif ($compiler -eq 'MSVC') {
$cmakeGeneratorArgs = '/verbosity:normal'
$cmakeGenerator = 'Visual Studio 16 2019'
}
if ($compiler -eq 'MSVC') {
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
}
}
}
if (-not $NoTests) {
python -m ensurepip
python -m pip install pynvim ; exitIfFailed
# Sanity check
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
gem.cmd install --pre neovim
Get-Command -CommandType Application neovim-ruby-host.bat
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
}
function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
}
cd $env:DEPS_BUILD_DIR
if ($compiler -eq 'MSVC') {
if ($bits -eq 32) {
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
} else {
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
}
} else {
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
}
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd $buildDir
# Build Neovim
mkdir build
cd build
if ($compiler -eq 'MSVC') {
if ($bits -eq 32) {
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
} else {
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
}
} else {
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
}
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
.\bin\nvim --version ; exitIfFailed
# Ensure that the "win32" feature is set.
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
}
if (-not $NoTests) {
# Functional tests
# The $LastExitCode from MSBuild can't be trusted
$failed = $false
# Run only this test file:
# $env:TEST_FILE = "test\functional\foo.lua"
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
foreach { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ }
if ($uploadToCodecov) {
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\bin\luacov.bat
}
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
if ($failed) {
exit $LastExitCode
}
# Old tests
# Add MSYS to path, required for e.g. `find` used in test scripts.
# But would break functionaltests, where its `more` would be used then.
$OldPath = $env:PATH
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
$env:PATH = $OldPath
if ($uploadToCodecov) {
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
}
}
# Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's
if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force
}
# Build artifacts
cpack -C $cmakeBuildType

View File

@ -1,87 +0,0 @@
_stat() {
if test "${CI_OS_NAME}" = osx ; then
stat -f %Sm "${@}"
else
stat -c %y "${@}"
fi
}
top_make() {
printf '%78s\n' | tr ' ' '='
ninja "$@"
}
build_make() {
top_make -C "${BUILD_DIR}" "$@"
}
build_deps() {
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
mkdir -p "${DEPS_BUILD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists.
if test "${CACHE_ENABLE}" = "false" ; then
export CCACHE_RECACHE=1
elif test -f "${CACHE_MARKER}" ; then
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to
# update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/third-party/"
if ! top_make; then
exit 1
fi
cd "${CI_BUILD_DIR}"
}
build_nvim() {
check_core_dumps --delete quiet
if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
echo "Building nvim."
if ! top_make nvim ; then
exit 1
fi
if test "$CLANG_SANITIZER" != "TSAN" ; then
echo "Building libnvim."
if ! top_make libnvim ; then
exit 1
fi
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
echo "Building nvim-test."
if ! top_make nvim-test ; then
exit 1
fi
fi
fi
# Invoke nvim to trigger *San early.
if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then
check_sanitizer "${LOG_DIR}"
exit 1
fi
check_sanitizer "${LOG_DIR}"
cd "${CI_BUILD_DIR}"
}

View File

@ -1,56 +0,0 @@
#!/bin/sh
# Collect and submit coverage reports.
#
# Args:
# $1: Flag(s) for codecov, separated by comma.
set -e
# Change to grandparent dir (POSIXly).
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
echo "=== running submit_coverage in $PWD: $* ==="
"$GCOV" --version
# Download/install codecov-bash and gcovr once.
codecov_sh="${TEMP:-/tmp}/codecov.bash"
if ! [ -f "$codecov_sh" ]; then
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
chmod +x "$codecov_sh"
python -m pip install --quiet --user gcovr
fi
(
cd build
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
)
# Upload to codecov.
# -X gcov: disable gcov, done manually above.
# -X fix: disable fixing of reports (not necessary, rather slow)
# -Z: exit non-zero on failure
# -F: flag(s)
# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then,
# which they know about for about a year already...
# Flags must match pattern ^[\w\,]+$ ("," as separator).
codecov_flags="$(uname -s),${1}"
codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g')
if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then
echo "codecov upload failed."
fi
# Cleanup always, especially collected data.
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
rm -f coverage.xml
# Upload Lua coverage (generated manually on AppVeyor/Windows).
if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then
if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then
"${DEPS_BUILD_DIR}/usr/bin/luacov"
fi
if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then
echo "codecov upload failed."
fi
rm luacov.stats.out
fi

View File

@ -1,41 +0,0 @@
# Test success marker. If END_MARKER file exists, we know that all tests
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
# file will contain information about failed tests. Build is considered
# successful if tests ended without any of them failing.
END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
fail() {
local test_name="$1"
local message="$2"
: ${message:=Test $test_name failed}
local full_msg="$test_name :: $message"
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
echo "Failed: $full_msg"
FAILED=1
}
ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:'
cat "${FAIL_SUMMARY_FILE}"
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
rm -f "$FAIL_SUMMARY_FILE"
fi
return 1
fi
if ! test -f "${END_MARKER}" ; then
echo 'ended_successfully called before end marker was touched'
return 1
fi
return 0
}
end_tests() {
touch "${END_MARKER}"
ended_successfully
}

View File

@ -1,173 +0,0 @@
. "${CI_DIR}/common/build.sh"
. "${CI_DIR}/common/suite.sh"
submit_coverage() {
if [ -n "${GCOV}" ]; then
"${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.'
fi
}
print_core() {
local app="$1"
local core="$2"
if test "$app" = quiet ; then
echo "Found core $core"
return 0
fi
echo "======= Core file $core ======="
if test "${CI_OS_NAME}" = osx ; then
lldb -Q -o "bt all" -f "${app}" -c "${core}"
else
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
fi
}
check_core_dumps() {
local del=
if test "$1" = "--delete" ; then
del=1
shift
fi
local app="${1:-${BUILD_DIR}/bin/nvim}"
local cores
if test "${CI_OS_NAME}" = osx ; then
cores="$(find /cores/ -type f -print)"
local _sudo='sudo'
else
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
local _sudo=
fi
if test -z "${cores}" ; then
return
fi
local core
for core in $cores; do
if test "$del" = "1" ; then
print_core "$app" "$core" >&2
"$_sudo" rm "$core"
else
print_core "$app" "$core"
fi
done
if test "$app" != quiet ; then
fail 'cores' 'Core dumps found'
fi
}
check_logs() {
# Iterate through each log to remove an useless warning.
for log in $(find "${1}" -type f -name "${2}"); do
sed -i "${log}" \
-e '/Warning: noted but unhandled ioctl/d' \
-e '/could cause spurious value errors to appear/d' \
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
done
# Now do it again, but only consider files with size > 0.
local err=""
for log in $(find "${1}" -type f -name "${2}" -size +0); do
cat "${log}"
err=1
rm "${log}"
done
if test -n "${err}" ; then
fail 'logs' 'Runtime errors detected.'
fi
}
valgrind_check() {
check_logs "${1}" "valgrind-*"
}
check_sanitizer() {
if test -n "${CLANG_SANITIZER}"; then
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat}
fi
}
unittests() {(
ulimit -c unlimited || true
if ! build_make unittest ; then
fail 'unittests' 'Unit tests failed'
fi
submit_coverage unittest
check_core_dumps "$(command -v luajit)"
)}
functionaltests() {(
ulimit -c unlimited || true
if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' 'Functional tests failed'
fi
submit_coverage functionaltest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
)}
oldtests() {(
ulimit -c unlimited || true
if ! make oldtest; then
reset
fail 'oldtests' 'Legacy tests failed'
fi
submit_coverage oldtest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
)}
check_runtime_files() {(
local test_name="$1" ; shift
local message="$1" ; shift
local tst="$1" ; shift
cd runtime
for file in $(git ls-files "$@") ; do
# Check that test is not trying to work with files with spaces/etc
# Prefer failing the build over using more robust construct because files
# with IFS are not welcome.
if ! test -e "$file" ; then
fail "$test_name" "It appears that $file is only a part of the file name"
fi
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
fail "$test_name" "$(printf "$message" "$file")"
fi
done
)}
install_nvim() {(
if ! build_make install ; then
fail 'install' 'make install failed'
exit 1
fi
"${INSTALL_PREFIX}/bin/nvim" --version
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly."
fail 'help' 'Failed running :help'
fi
# Check that all runtime files were installed
check_runtime_files \
'runtime-install' \
'It appears that %s is not installed.' \
-e \
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
# Check that some runtime files are installed and are executables
check_runtime_files \
'not-exe' \
'It appears that %s is not installed or is not executable.' \
-x \
'*.awk' '*.sh' '*.bat'
# Check that generated syntax file has function names, #5060.
local genvimsynf=syntax/vim/generated.vim
local gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
fi
)}

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python."
CC=cc python -m pip -q install --user --upgrade pynvim
echo "Install neovim RubyGem."
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
echo "Install neovim npm package"
npm install -g neovim
npm link neovim
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'

View File

@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
rm -f "$END_MARKER"
# Run all tests if no input argument is given
if (($# == 0)); then
tests=('clint-full' 'lualint' 'pylint' 'shlint' 'check-single-includes')
else
tests=("$@")
fi
for i in "${tests[@]}"; do
make "$i" || fail "$i"
done
end_tests

View File

@ -1,35 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh"
source "${CI_DIR}/common/suite.sh"
rm -f "$END_MARKER"
# Run all tests (with some caveats) if no input argument is given
if (($# == 0)); then
tests=('build_nvim')
if test "$CLANG_SANITIZER" != "TSAN"; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
tests+=('unittests')
fi
tests+=('functionaltests')
fi
tests+=('oldtests' 'install_nvim')
else
tests=("$@")
fi
for i in "${tests[@]}"; do
eval "$i" || fail "$i"
done
end_tests

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
ci/run_${CI_TARGET}.sh
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

View File

@ -1,194 +0,0 @@
{
"ref": "refs/heads/master",
"before": "66b136c43c12df3dcf8f19ff48f206ad2e4f43fc",
"after": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
"repository": {
"id": 292861950,
"node_id": "MDEwOlJlcG9zaXRvcnkyOTI4NjE5NTA=",
"name": "neovim-snap",
"full_name": "hurricanehrndz/neovim-snap",
"private": false,
"owner": {
"name": "hurricanehrndz",
"email": "hurricanehrndz@users.noreply.github.com",
"login": "hurricanehrndz",
"id": 5804237,
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hurricanehrndz",
"html_url": "https://github.com/hurricanehrndz",
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/hurricanehrndz/neovim-snap",
"description": "snap build for neovim",
"fork": false,
"url": "https://github.com/hurricanehrndz/neovim-snap",
"forks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/forks",
"keys_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/teams",
"hooks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/hooks",
"issue_events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/events{/number}",
"events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/events",
"assignees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/assignees{/user}",
"branches_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/branches{/branch}",
"tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/tags",
"blobs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/statuses/{sha}",
"languages_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/languages",
"stargazers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/stargazers",
"contributors_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contributors",
"subscribers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscribers",
"subscription_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscription",
"commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contents/{+path}",
"compare_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/merges",
"archive_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/downloads",
"issues_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues{/number}",
"pulls_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/pulls{/number}",
"milestones_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/milestones{/number}",
"notifications_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/labels{/name}",
"releases_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/releases{/id}",
"deployments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/deployments",
"created_at": 1599227980,
"updated_at": "2020-09-04T14:02:38Z",
"pushed_at": 1599228352,
"git_url": "git://github.com/hurricanehrndz/neovim-snap.git",
"ssh_url": "git@github.com:hurricanehrndz/neovim-snap.git",
"clone_url": "https://github.com/hurricanehrndz/neovim-snap.git",
"svn_url": "https://github.com/hurricanehrndz/neovim-snap",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"stargazers": 0,
"master_branch": "master"
},
"pusher": {
"name": "hurricanehrndz",
"email": "hurricanehrndz@users.noreply.github.com"
},
"sender": {
"login": "hurricanehrndz",
"id": 5804237,
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hurricanehrndz",
"html_url": "https://github.com/hurricanehrndz",
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
"type": "User",
"site_admin": false
},
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
"compare": "https://github.com/hurricanehrndz/neovim-snap/compare/66b136c43c12...1bf69c32217c",
"commits": [
{
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
"distinct": true,
"message": "Build of latest tag",
"timestamp": "2020-09-04T14:05:40Z",
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
"author": {
"name": "Carlos Hernandez",
"email": "carlos@techbyte.ca",
"username": "hurricanehrndz"
},
"committer": {
"name": "Carlos Hernandez",
"email": "carlos@techbyte.ca",
"username": "hurricanehrndz"
},
"added": [
],
"removed": [
],
"modified": [
"snap/snapcraft.yaml"
]
}
],
"head_commit": {
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
"distinct": true,
"message": "Build of latest tag",
"timestamp": "2020-09-04T14:05:40Z",
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
"author": {
"name": "Carlos Hernandez",
"email": "carlos@techbyte.ca",
"username": "hurricanehrndz"
},
"committer": {
"name": "Carlos Hernandez",
"email": "carlos@techbyte.ca",
"username": "hurricanehrndz"
},
"added": [
],
"removed": [
],
"modified": [
"snap/snapcraft.yaml"
]
}
}

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
RESULT_SNAP=$(find ./ -name "*.snap")
sudo snap install "$RESULT_SNAP" --dangerous --classic
/snap/bin/nvim --version
SHA256=$(sha256sum "$RESULT_SNAP")
echo "SHA256: ${SHA256} ."

View File

@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
SNAP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
snap_release_needed() {
last_committed_tag="$(git tag -l --sort=refname|head -1)"
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
git fetch -f --tags
git checkout "${last_committed_tag}" 2> /dev/null
last_git_release="$(git describe --first-parent 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
if [[ -z "$(echo $last_snap_release | perl -ne "print if /${last_git_release}.*/")" ]]; then
return 0
fi
return 1
}
trigger_snapcraft_webhook() {
[[ -n "${PAYLOAD_SIG}" ]] || exit
echo "Triggering new snap release via webhook..."
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
--data "${WEBHOOK_PAYLOAD}" \
https://snapcraft.io/nvim/webhook/notify
}
if $(snap_release_needed); then
echo "New snap release required"
trigger_snapcraft_webhook
fi

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
sudo apt update
sudo usermod -aG lxd $USER
sudo /snap/bin/lxd.migrate -yes
sudo /snap/bin/lxd waitready
sudo /snap/bin/lxd init --auto

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
mkdir -p "$CI_BUILD_DIR/snaps-cache"
sg lxd -c snapcraft

Binary file not shown.

View File

@ -5,25 +5,37 @@ include(CheckIncludeFiles)
include(CheckCSourceRuns)
include(CheckCSourceCompiles)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("intmax_t" SIZEOF_INTMAX_T)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("void *" SIZEOF_VOID_PTR)
check_c_source_compiles("
#include <execinfo.h>
int main(void)
{
void *trace[1];
backtrace(trace, 1);
return 0;
}
" HAVE_EXECINFO_BACKTRACE)
check_c_source_compiles("
int main(void)
{
int a = 42;
__builtin_add_overflow(a, a, &a);
__builtin_sub_overflow(a, a, &a);
return 0;
}
" HAVE_BUILTIN_ADD_OVERFLOW)
check_type_size("int" SIZEOF_INT LANGUAGE C)
check_type_size("long" SIZEOF_LONG LANGUAGE C)
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# Headers
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
if(NOT HAVE_SYS_WAIT_H AND UNIX)
# See if_cscope.c
message(SEND_ERROR "header sys/wait.h is required for Unix")
endif()
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
@ -31,25 +43,39 @@ check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
# Functions
check_function_exists(fseeko HAVE_FSEEKO)
check_function_exists(getpwent HAVE_GETPWENT)
check_function_exists(getpwnam HAVE_GETPWNAM)
check_function_exists(getpwuid HAVE_GETPWUID)
check_function_exists(readv HAVE_READV)
if(Iconv_FOUND)
set(HAVE_ICONV 1)
endif()
check_function_exists(opendir HAVE_OPENDIR)
check_function_exists(readlink HAVE_READLINK)
check_function_exists(setpgid HAVE_SETPGID)
check_function_exists(setsid HAVE_SETSID)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(strnlen HAVE_STRNLEN)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(strptime HAVE_STRPTIME)
check_c_source_compiles("
#include <sys/types.h>
#include <dirent.h>
#include <sys/file.h>
int main(void)
{
DIR *dir = opendir(\"dirname\");
dirfd(dir);
flock(10, LOCK_SH);
return 0;
}
" HAVE_DIRFD_AND_FLOCK)
check_c_source_compiles("
#include <pwd.h>
int main(void)
{
getpwent();
getpwuid(0);
getpwnam(\"root\");
return 0;
}
" HAVE_PWD_FUNCS)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
check_c_source_compiles("
#include <termios.h>
@ -70,11 +96,13 @@ if(HAVE_LANGINFO_H)
endif()
check_include_files("endian.h" HAVE_ENDIAN_H)
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "endian.h")
if(HAVE_SYS_ENDIAN_H AND NOT HAVE_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
if(NOT HAVE_ENDIAN_H)
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
if (HAVE_SYS_ENDIAN_H)
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
endif()
endif()
set(SI "#include <stdint.h>\n")
@ -125,38 +153,17 @@ if (NOT "${HAVE_BE64TOH}")
endif()
endif()
# generate configuration header and update include directories
configure_file (
"${PROJECT_SOURCE_DIR}/config/config.h.in"
"${PROJECT_BINARY_DIR}/config/auto/config.h"
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
)
# generate version definitions
configure_file (
"${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
"${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
)
# generate pathdef.c
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
if (DEFINED ENV{USERNAME})
set(USERNAME $ENV{USERNAME})
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
execute_process(COMMAND ${WHOAMI_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE USERNAME)
endif()
if (DEFINED ENV{HOSTNAME})
set(HOSTNAME $ENV{HOSTNAME})
elseif (EXISTS ${HOSTNAME_PROG})
execute_process(COMMAND ${HOSTNAME_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)
endif()
configure_file(versiondef.h.in auto/versiondef.h.gen)
file(GENERATE
OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h"
INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen")
configure_file (
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
ESCAPE_QUOTES)

View File

@ -1,10 +1,10 @@
#ifndef AUTO_CONFIG_H
#define AUTO_CONFIG_H
#cmakedefine DEBUG
#define SIZEOF_INT @SIZEOF_INT@
#define SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#if @SIZEOF_VOID_PTR@ == 8
#define ARCH_64
@ -12,24 +12,16 @@
#define ARCH_32
#endif
#define PROJECT_NAME "@PROJECT_NAME@"
#cmakedefine PROJECT_NAME "@PROJECT_NAME@"
#cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_FD_CLOEXEC
#cmakedefine HAVE_FSEEKO
#cmakedefine HAVE_GETPWENT
#cmakedefine HAVE_GETPWNAM
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_ICONV
#cmakedefine HAVE_LANGINFO_H
#cmakedefine HAVE_LOCALE_H
#cmakedefine HAVE_NL_LANGINFO_CODESET
#cmakedefine HAVE_NL_MSG_CAT_CNTR
#cmakedefine HAVE_PWD_H
#cmakedefine HAVE_PWD_FUNCS
#cmakedefine HAVE_READLINK
#cmakedefine HAVE_SETPGID
#cmakedefine HAVE_SETSID
#cmakedefine HAVE_SIGACTION
#cmakedefine HAVE_STRNLEN
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRINGS_H
@ -50,10 +42,9 @@
# undef HAVE_SYS_UIO_H
# endif
#endif
#cmakedefine HAVE_DIRFD_AND_FLOCK
#cmakedefine HAVE_FORKPTY
#cmakedefine FEAT_TUI
#ifndef UNIT_TESTING
#cmakedefine LOG_LIST_ACTIONS
#endif

View File

@ -0,0 +1,226 @@
# This was initially taken from the IWYU repository:
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.libc.imp
# It has useful mappings that are normally enabled by default, but there are
# other default mappings that conflict with our builds. The best solution seems
# to be to disable all defaults, import the defaults from the IWYU
# repo and modify the rules that conflict with our build.
#
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
# to avoid this file entirely.
# Mappings for GNU libc
# ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { include: [ "<$2>", private, "<$1>", public ] },@' | grep bits/ | sort )
# When I saw more than one mapping for these, I typically picked
# what I thought was the "best" one.
[
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
{ include: [ "<bits/auxv.h>", private, "<sys/auxv.h>", public ] },
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
{ include: [ "<bits/environments.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
{ include: [ "<bits/errno.h>", private, "<errno.h>", public ] },
{ include: [ "<bits/error.h>", private, "<error.h>", public ] },
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fcntl2.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/fenvinline.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
{ include: [ "<bits/hwcap.h>", private, "<sys/auxv.h>", public ] },
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/libio-ldbl.h>", private, "<libio.h>", public ] },
{ include: [ "<bits/link.h>", private, "<link.h>", public ] },
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathcalls.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mman-shared.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/monetary-ldbl.h>", private, "<monetary.h>", public ] },
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/mqueue2.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
{ include: [ "<bits/netdb.h>", private, "<netdb.h>", private ] },
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/poll2.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/posix1_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/posix2_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/posix_opt.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/printf-ldbl.h>", private, "<printf.h>", public ] },
{ include: [ "<bits/pthreadtypes.h>", private, "<pthread.h>", private ] },
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
{ include: [ "<bits/sched.h>", private, "<sched.h>", public ] },
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/select2.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/sem.h>", private, "<sys/sem.h>", public ] },
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
{ include: [ "<bits/setjmp.h>", private, "<setjmp.h>", public ] },
{ include: [ "<bits/setjmp2.h>", private, "<setjmp.h>", public ] },
{ include: [ "<bits/shm.h>", private, "<sys/shm.h>", public ] },
{ include: [ "<bits/sigaction.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/siginfo.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/signum.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigset.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigstack.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigthread.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sockaddr.h>", private, "<sys/un.h>", public ] },
{ include: [ "<bits/socket.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/socket2.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/socket_type.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/stab.def>", private, "<stab.h>", public ] },
{ include: [ "<bits/stat.h>", private, "<sys/stat.h>", public ] },
{ include: [ "<bits/statfs.h>", private, "<sys/statfs.h>", public ] },
{ include: [ "<bits/statvfs.h>", private, "<sys/statvfs.h>", public ] },
{ include: [ "<bits/stdio-ldbl.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio-lock.h>", private, "<libio.h>", public ] },
{ include: [ "<bits/stdio.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio2.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio_lim.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdlib-bsearch.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib-ldbl.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
{ include: [ "<bits/stropts.h>", private, "<stropts.h>", public ] },
{ include: [ "<bits/struct_stat.h>", private, "<sys/stat.h>", public ] },
{ include: [ "<bits/struct_stat.h>", private, "<ftw.h>", public ] },
{ include: [ "<bits/sys_errlist.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/syscall.h>", private, "<sys/syscall.h>", public ] },
{ include: [ "<bits/sysctl.h>", private, "<sys/sysctl.h>", public ] },
{ include: [ "<bits/syslog-ldbl.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/termios.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/time.h>", private, "<time.h>", public ] },
{ include: [ "<bits/time.h>", private, "<sys/time.h>", public ] },
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
{ include: [ "<bits/timex.h>", private, "<sys/timex.h>", public ] },
{ include: [ "<bits/types.h>", private, "<sys/types.h>", public ] },
{ include: [ "<bits/types/siginfo_t.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/types/siginfo_t.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/uio.h>", private, "<sys/uio.h>", public ] },
{ include: [ "<bits/unistd.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/ustat.h>", private, "<sys/ustat.h>", private ] },
{ include: [ "<bits/utmp.h>", private, "<utmp.h>", public ] },
{ include: [ "<bits/utmpx.h>", private, "<utmpx.h>", public ] },
{ include: [ "<bits/utsname.h>", private, "<sys/utsname.h>", public ] },
{ include: [ "<bits/waitflags.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/waitstatus.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/wchar-ldbl.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wchar.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wchar2.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wordsize.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/xopen_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/xtitypes.h>", private, "<stropts.h>", public ] },
# Sometimes libc tells you what mapping to do via an '#error':
# # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
# or
# # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
# ( cd /usr/include && grep -R '^ *# *error "Never use\|include' * | perl -nle 'm/<([^>]+).*directly.*<([^>]+)/ && print qq@ { include: [ "<$1>", private, "<$2>", public ] },@' | sort )
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
{ include: [ "<bits/byteswap-16.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
{ include: [ "<bits/fcntl-linux.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
{ include: [ "<bits/in.h>", private, "<netinet/in.h>", private ] },
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mman-linux.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/predefs.h>", private, "<features.h>", public ] },
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/signalfd.h>", private, "<sys/signalfd.h>", public ] },
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
{ include: [ "<bits/typesizes.h>", private, "<sys/types.h>", public ] },
# Top-level #includes that just forward to another file:
# $ for i in /usr/include/*; do [ -f $i ] } && [ `wc -l < $i` = 1 ] } && echo $i; done
# (poll.h, syscall.h, syslog.h, ustat.h, wait.h).
# For each file, I looked at the list of canonical header files --
# http://www.opengroup.org/onlinepubs/9699919799/idx/head.html --
# to decide which of the two files is canonical. If neither is
# on the POSIX.1 1998 list, I just choose the top-level one.
{ include: [ "<sys/poll.h>", private, "<poll.h>", public ] },
{ include: [ "<sys/syslog.h>", private, "<syslog.h>", public ] },
{ include: [ "<sys/ustat.h>", private, "<ustat.h>", public ] },
{ include: [ "<wait.h>", private, "<sys/wait.h>", public ] },
# These are all files in bits/ that delegate to asm/ and linux/ to
# do all (or lots) of the work. Note these are private->private.
# $ for i in /usr/include/bits/*; do for dir in asm linux; do grep -H -e $dir/`basename $i` $i; done; done
{ include: [ "<linux/errno.h>", private, "<bits/errno.h>", private ] },
{ include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
{ include: [ "<asm/socket.h>", private, "<bits/socket.h>", private ] },
{ include: [ "<linux/socket.h>", private, "<bits/socket.h>", private ] },
# Some asm files have 32- and 64-bit variants:
# $ ls /usr/include/asm/*_{32,64}.h
{ include: [ "<asm/posix_types_32.h>", private, "<asm/posix_types.h>", public ] },
{ include: [ "<asm/posix_types_64.h>", private, "<asm/posix_types.h>", public ] },
{ include: [ "<asm/unistd_32.h>", private, "<asm/unistd.h>", private ] },
{ include: [ "<asm/unistd_64.h>", private, "<asm/unistd.h>", private ] },
# I don't know what grep would have found these. I found them
# via user report.
{ include: [ "<asm/errno.h>", private, "<errno.h>", public ] },
{ include: [ "<asm/errno-base.h>", private, "<errno.h>", public ] },
{ include: [ "<asm/ptrace-abi.h>", private, "<asm/ptrace.h>", public ] },
{ include: [ "<asm/unistd.h>", private, "<sys/syscall.h>", public ] },
{ include: [ "<linux/limits.h>", private, "<limits.h>", public ] }, # PATH_MAX
{ include: [ "<linux/prctl.h>", private, "<sys/prctl.h>", public ] },
{ include: [ "<sys/ucontext.h>", private, "<ucontext.h>", public ] },
# Exports guaranteed by the C standard
{ include: [ "<stdint.h>", public, "<inttypes.h>", public ] },
]
# vim: set ft=toml:

View File

@ -0,0 +1,305 @@
# This was initially taken from the IWYU repository:
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.symbols.imp
# It has useful mappings that are normally enabled by default, but there are
# other default mappings that conflict with our builds. The best solution seems
# to be to disable all defaults, import the defaults from the IWYU repo and
# modify the rules that conflict with our build.
#
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
# to avoid this file entirely.
# For library symbols that can be defined in more than one header
# file, maps from symbol-name to legitimate header files.
# This list was generated via
# grep -R '__.*_defined' /usr/include | perl -nle 'm,/usr/include/([^:]*):#\s*\S+ __(.*)_defined, and print qq@ { symbol: [ "$2", public, "<$1>", public ] },@' | sort -u
# I ignored all entries that only appeared once on the list (eg uint32_t).
# I then added in NULL, which according to [diff.null] C.2.2.3, can
# be defined in <clocale>, <cstddef>, <cstdio>, <cstdlib>,
# <cstring>, <ctime>, or <cwchar>. We also allow their C
# equivalents.
# In each case, I ordered them so <sys/types.h> was first, if it was
# an option for this type. That's the preferred #include all else
# equal. The same goes for <stdint.h>. The visibility on the
# symbol-name is ignored; by convention we always set it to private.
[
{ symbol: [ "aiocb", private, "<aio.h>", public ] },
{ symbol: [ "blkcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "blkcnt_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "blksize_t", private, "<sys/types.h>", public ] },
{ symbol: [ "blksize_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "cc_t", private, "<termios.h>", private ] },
{ symbol: [ "clock_t", private, "<sys/types.h>", public ] },
{ symbol: [ "clock_t", private, "<sys/time.h>", public ] },
{ symbol: [ "clock_t", private, "<time.h>", public ] },
{ symbol: [ "clockid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "clockid_t", private, "<time.h>", public ] },
{ symbol: [ "daddr_t", private, "<sys/types.h>", public ] },
{ symbol: [ "daddr_t", private, "<rpc/types.h>", public ] },
{ symbol: [ "dev_t", private, "<sys/types.h>", public ] },
{ symbol: [ "dev_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "div_t", private, "<stdlib.h>", public ] },
{ symbol: [ "double_t", private, "<math.h>", public ] },
{ symbol: [ "error_t", private, "<errno.h>", public ] },
{ symbol: [ "error_t", private, "<argp.h>", public ] },
{ symbol: [ "error_t", private, "<argz.h>", public ] },
{ symbol: [ "fd_set", private, "<sys/select.h>", public ] },
{ symbol: [ "fd_set", private, "<sys/time.h>", public ] },
{ symbol: [ "fenv_t", private, "<fenv.h>", public ] },
{ symbol: [ "fexcept_t", private, "<fenv.h>", public ] },
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
{ symbol: [ "FILE", private, "<wchar.h>", public ] },
{ symbol: [ "float_t", private, "<math.h>", public ] },
{ symbol: [ "fsblkcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "fsblkcnt_t", private, "<sys/statvfs.h>", public ] },
{ symbol: [ "fsfilcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "fsfilcnt_t", private, "<sys/statvfs.h>", public ] },
{ symbol: [ "getopt", private, "<unistd.h>", private ] },
{ symbol: [ "gid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "gid_t", private, "<grp.h>", public ] },
{ symbol: [ "gid_t", private, "<pwd.h>", public ] },
{ symbol: [ "gid_t", private, "<signal.h>", public ] },
{ symbol: [ "gid_t", private, "<stropts.h>", public ] },
{ symbol: [ "gid_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "gid_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "gid_t", private, "<unistd.h>", private ] },
{ symbol: [ "htonl", private, "<arpa/inet.h>", private ] },
{ symbol: [ "htons", private, "<arpa/inet.h>", private ] },
{ symbol: [ "id_t", private, "<sys/types.h>", public ] },
{ symbol: [ "id_t", private, "<sys/resource.h>", public ] },
{ symbol: [ "imaxdiv_t", private, "<inttypes.h>", public ] },
{ symbol: [ "intmax_t", private, "<stdint.h>", public ] },
{ symbol: [ "uintmax_t", private, "<stdint.h>", public ] },
{ symbol: [ "ino64_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ino64_t", private, "<dirent.h>", public ] },
{ symbol: [ "ino_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ino_t", private, "<dirent.h>", public ] },
{ symbol: [ "ino_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "int8_t", private, "<stdint.h>", public ] },
{ symbol: [ "int16_t", private, "<stdint.h>", public ] },
{ symbol: [ "int32_t", private, "<stdint.h>", public ] },
{ symbol: [ "int64_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint8_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint16_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint32_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint64_t", private, "<stdint.h>", public ] },
{ symbol: [ "intptr_t", private, "<stdint.h>", public ] },
{ symbol: [ "uintptr_t", private, "<stdint.h>", public ] },
{ symbol: [ "iovec", private, "<sys/uio.h>", public ] },
{ symbol: [ "iovec", private, "<sys/socket.h>", private ] },
{ symbol: [ "itimerspec", private, "<time.h>", public ] },
{ symbol: [ "itimerspec", private, "<sys/timerfd.h>", public ] },
{ symbol: [ "key_t", private, "<sys/types.h>", public ] },
{ symbol: [ "key_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "lconv", private, "<locale.h>", public ] },
{ symbol: [ "ldiv_t", private, "<stdlib.h>", public ] },
{ symbol: [ "lldiv_t", private, "<stdlib.h>", public ] },
{ symbol: [ "max_align_t", private, "<stddef.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/types.h>", public ] },
{ symbol: [ "mode_t", private, "<fcntl.h>", public ] },
{ symbol: [ "mode_t", private, "<ndbm.h>", public ] },
{ symbol: [ "mode_t", private, "<spawn.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "nlink_t", private, "<sys/types.h>", public ] },
{ symbol: [ "nlink_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "ntohl", private, "<arpa/inet.h>", private ] },
{ symbol: [ "ntohs", private, "<arpa/inet.h>", private ] },
{ symbol: [ "off64_t", private, "<sys/types.h>", public ] },
{ symbol: [ "off64_t", private, "<unistd.h>", private ] },
{ symbol: [ "off_t", private, "<sys/types.h>", public ] },
{ symbol: [ "off_t", private, "<aio.h>", public ] },
{ symbol: [ "off_t", private, "<fcntl.h>", public ] },
{ symbol: [ "off_t", private, "<stdio.h>", public ] },
{ symbol: [ "off_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "off_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "off_t", private, "<unistd.h>", private ] },
{ symbol: [ "optarg", private, "<unistd.h>", private ] },
{ symbol: [ "opterr", private, "<unistd.h>", private ] },
{ symbol: [ "optind", private, "<unistd.h>", private ] },
{ symbol: [ "optopt", private, "<unistd.h>", private ] },
{ symbol: [ "pid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "pid_t", private, "<fcntl.h>", public ] },
{ symbol: [ "pid_t", private, "<sched.h>", public ] },
{ symbol: [ "pid_t", private, "<signal.h>", public ] },
{ symbol: [ "pid_t", private, "<spawn.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/wait.h>", public ] },
{ symbol: [ "pid_t", private, "<termios.h>", private ] },
{ symbol: [ "pid_t", private, "<time.h>", public ] },
{ symbol: [ "pid_t", private, "<unistd.h>", private ] },
{ symbol: [ "pid_t", private, "<utmpx.h>", public ] },
{ symbol: [ "ptrdiff_t", private, "<stddef.h>", public ] },
{ symbol: [ "regex_t", private, "<regex.h>", public ] },
{ symbol: [ "regmatch_t", private, "<regex.h>", public ] },
{ symbol: [ "regoff_t", private, "<regex.h>", public ] },
{ symbol: [ "sigevent", private, "<signal.h>", public ] },
{ symbol: [ "sigevent", private, "<aio.h>", public ] },
{ symbol: [ "sigevent", private, "<mqueue.h>", public ] },
{ symbol: [ "sigevent", private, "<time.h>", public ] },
{ symbol: [ "siginfo_t", private, "<signal.h>", public ] },
{ symbol: [ "siginfo_t", private, "<sys/wait.h>", public ] },
{ symbol: [ "sigset_t", private, "<signal.h>", public ] },
{ symbol: [ "sigset_t", private, "<spawn.h>", public ] },
{ symbol: [ "sigset_t", private, "<sys/select.h>", public ] },
{ symbol: [ "sigval", private, "<signal.h>", public ] },
{ symbol: [ "sockaddr", private, "<sys/socket.h>", private ] },
{ symbol: [ "socklen_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "socklen_t", private, "<netdb.h>", private ] },
{ symbol: [ "ssize_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ssize_t", private, "<aio.h>", public ] },
{ symbol: [ "ssize_t", private, "<monetary.h>", public ] },
{ symbol: [ "ssize_t", private, "<mqueue.h>", public ] },
{ symbol: [ "ssize_t", private, "<stdio.h>", public ] },
{ symbol: [ "ssize_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "ssize_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "ssize_t", private, "<sys/uio.h>", public ] },
{ symbol: [ "ssize_t", private, "<unistd.h>", private ] },
{ symbol: [ "stat", private, "<sys/stat.h>", public ] },
{ symbol: [ "stat", private, "<ftw.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/types.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/select.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/time.h>", public ] },
{ symbol: [ "time_t", private, "<time.h>", public ] },
{ symbol: [ "time_t", private, "<sched.h>", public ] },
{ symbol: [ "time_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "time_t", private, "<sys/select.h>", public ] },
{ symbol: [ "time_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "time_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "time_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "time_t", private, "<sys/time.h>", public ] },
{ symbol: [ "time_t", private, "<sys/types.h>", public ] },
{ symbol: [ "time_t", private, "<utime.h>", public ] },
{ symbol: [ "timer_t", private, "<sys/types.h>", public ] },
{ symbol: [ "timer_t", private, "<time.h>", public ] },
{ symbol: [ "timespec", private, "<time.h>", public ] },
{ symbol: [ "timespec", private, "<aio.h>", public ] },
{ symbol: [ "timespec", private, "<mqueue.h>", public ] },
{ symbol: [ "timespec", private, "<sched.h>", public ] },
{ symbol: [ "timespec", private, "<signal.h>", public ] },
{ symbol: [ "timespec", private, "<sys/select.h>", public ] },
{ symbol: [ "timespec", private, "<sys/stat.h>", public ] },
{ symbol: [ "timeval", private, "<sys/time.h>", public ] },
{ symbol: [ "timeval", private, "<sys/resource.h>", public ] },
{ symbol: [ "timeval", private, "<sys/select.h>", public ] },
{ symbol: [ "timeval", private, "<utmpx.h>", public ] },
{ symbol: [ "tm", private, "<time.h>", public ] },
{ symbol: [ "u_char", private, "<sys/types.h>", public ] },
{ symbol: [ "u_char", private, "<rpc/types.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "uid_t", private, "<pwd.h>", public ] },
{ symbol: [ "uid_t", private, "<signal.h>", public ] },
{ symbol: [ "uid_t", private, "<stropts.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "uid_t", private, "<unistd.h>", private ] },
{ symbol: [ "useconds_t", private, "<sys/types.h>", public ] },
{ symbol: [ "useconds_t", private, "<unistd.h>", private ] },
{ symbol: [ "wchar_t", private, "<stddef.h>", public ] },
{ symbol: [ "wchar_t", private, "<stdlib.h>", public ] },
{ symbol: [ "size_t", private, "<stddef.h>", public ] },
{ symbol: [ "size_t", private, "<aio.h>", public ] },
{ symbol: [ "size_t", private, "<glob.h>", public ] },
{ symbol: [ "size_t", private, "<grp.h>", public ] },
{ symbol: [ "size_t", private, "<iconv.h>", public ] },
{ symbol: [ "size_t", private, "<monetary.h>", public ] },
{ symbol: [ "size_t", private, "<mqueue.h>", public ] },
{ symbol: [ "size_t", private, "<ndbm.h>", public ] },
{ symbol: [ "size_t", private, "<pwd.h>", public ] },
{ symbol: [ "size_t", private, "<regex.h>", public ] },
{ symbol: [ "size_t", private, "<search.h>", public ] },
{ symbol: [ "size_t", private, "<signal.h>", public ] },
{ symbol: [ "size_t", private, "<stdio.h>", public ] },
{ symbol: [ "size_t", private, "<stdlib.h>", public ] },
{ symbol: [ "size_t", private, "<string.h>", public ] },
{ symbol: [ "size_t", private, "<strings.h>", public ] },
{ symbol: [ "size_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "size_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "size_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "size_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "size_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "size_t", private, "<sys/types.h>", public ] },
{ symbol: [ "size_t", private, "<sys/uio.h>", public ] },
{ symbol: [ "size_t", private, "<time.h>", public ] },
{ symbol: [ "size_t", private, "<uchar.h>", public ] },
{ symbol: [ "size_t", private, "<unistd.h>", private ] },
{ symbol: [ "size_t", private, "<wchar.h>", public ] },
{ symbol: [ "size_t", private, "<wordexp.h>", public ] },
# Macros that can be defined in more than one file, don't have the
# same __foo_defined guard that other types do, so the grep above
# doesn't discover them. Until I figure out a better way, I just
# add them in by hand as I discover them.
{ symbol: [ "EOF", private, "<stdio.h>", public ] },
{ symbol: [ "EOF", private, "<libio.h>", public ] },
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
{ symbol: [ "MAP_POPULATE", private, "<sys/mman.h>", public ] },
{ symbol: [ "MAP_POPULATE", private, "<linux/mman.h>", public ] },
{ symbol: [ "MAP_STACK", private, "<sys/mman.h>", public ] },
{ symbol: [ "MAP_STACK", private, "<linux/mman.h>", public ] },
{ symbol: [ "MAXHOSTNAMELEN", private, "<sys/param.h>", public ] },
{ symbol: [ "MAXHOSTNAMELEN", private, "<protocols/timed.h>", public ] },
{ symbol: [ "SIGABRT", private, "<signal.h>", public ] },
{ symbol: [ "SIGCHLD", private, "<signal.h>", public ] },
{ symbol: [ "SIGCHLD", private, "<linux/signal.h>", public ] },
{ symbol: [ "va_list", private, "<stdarg.h>", public ] },
{ symbol: [ "va_list", private, "<stdio.h>", public ] },
{ symbol: [ "va_list", private, "<wchar.h>", public ] },
# These are symbols that could be defined in either stdlib.h or
# malloc.h, but we always want the stdlib location.
{ symbol: [ "malloc", private, "<stdlib.h>", public ] },
{ symbol: [ "calloc", private, "<stdlib.h>", public ] },
{ symbol: [ "realloc", private, "<stdlib.h>", public ] },
{ symbol: [ "free", private, "<stdlib.h>", public ] },
# Entries for NULL
{ symbol: [ "NULL", private, "<stddef.h>", public ] }, # 'canonical' location for NULL
{ symbol: [ "NULL", private, "<clocale>", public ] },
{ symbol: [ "NULL", private, "<cstddef>", public ] },
{ symbol: [ "NULL", private, "<cstdio>", public ] },
{ symbol: [ "NULL", private, "<cstdlib>", public ] },
{ symbol: [ "NULL", private, "<cstring>", public ] },
{ symbol: [ "NULL", private, "<ctime>", public ] },
{ symbol: [ "NULL", private, "<cwchar>", public ] },
{ symbol: [ "NULL", private, "<locale.h>", public ] },
{ symbol: [ "NULL", private, "<stdio.h>", public ] },
{ symbol: [ "NULL", private, "<stdlib.h>", public ] },
{ symbol: [ "NULL", private, "<string.h>", public ] },
{ symbol: [ "NULL", private, "<time.h>", public ] },
{ symbol: [ "NULL", private, "<unistd.h>", private ] },
{ symbol: [ "NULL", private, "<wchar.h>", public ] },
# Kludge time: almost all STL types take an allocator, but they
# almost always use the default value. Usually we detect that
# and don't try to do IWYU, but sometimes it passes through.
# For instance, when adding two strings, we end up calling
# template<_CharT,_Traits,_Alloc> ... operator+(
# basic_string<_CharT,_Traits,_Alloc>, ...)
# These look like normal template args to us, so we see they're
# used and declare an iwyu dependency, even though we don't need
# to #include the traits or alloc type ourselves. The surest way
# to deal with this is to just say that everyone provides
# std::allocator. We can add more here at need.
{ symbol: [ "std::allocator", private, "<memory>", public ] },
{ symbol: [ "std::allocator", private, "<string>", public ] },
{ symbol: [ "std::allocator", private, "<vector>", public ] },
{ symbol: [ "std::allocator", private, "<map>", public ] },
{ symbol: [ "std::allocator", private, "<set>", public ] },
# A similar kludge for std::char_traits. basic_string,
# basic_ostream and basic_istream have this as a default template
# argument, and sometimes it bleeds through when clang desugars the
# string/ostream/istream type.
{ symbol: [ "std::char_traits", private, "<string>", public ] },
{ symbol: [ "std::char_traits", private, "<ostream>", public ] },
{ symbol: [ "std::char_traits", private, "<istream>", public ] },
{ symbol: [ "std::size_t", private, "<cstddef>", public ] },
{ symbol: [ "std::size_t", private, "<cstdio>", public ] },
{ symbol: [ "std::size_t", private, "<cstdlib>", public ] },
{ symbol: [ "std::size_t", private, "<cstring>", public ] },
{ symbol: [ "std::size_t", private, "<ctime>", public ] },
{ symbol: [ "std::size_t", private, "<cuchar>", public ] },
{ symbol: [ "std::size_t", private, "<cwchar>", public ] }
]
# vim: set ft=toml:

View File

@ -0,0 +1,238 @@
[
# Generated to normal headers: header.h.generated.h -> nvim/header.h
{ include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] },
{ include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] },
{ include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] },
{ include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] },
{ include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] },
{ include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] },
{ include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] },
{ include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
{ include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] },
{ include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] },
{ include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] },
{ include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] },
{ include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] },
{ include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] },
{ include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] },
{ include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] },
{ include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] },
{ include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] },
{ include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] },
{ include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] },
{ include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] },
{ include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] },
{ include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] },
{ include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] },
{ include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] },
{ include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] },
{ include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] },
{ include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] },
{ include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] },
{ include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] },
{ include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] },
{ include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] },
{ include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] },
{ include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] },
{ include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] },
{ include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] },
{ include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] },
{ include: [ '"eval/buffer.h.generated.h"', private, '"nvim/eval/buffer.h"', public ] },
{ include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] },
{ include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] },
{ include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] },
{ include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] },
{ include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] },
{ include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] },
{ include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] },
{ include: [ '"eval/window.h.generated.h"', private, '"nvim/eval/window.h"', public ] },
{ include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] },
{ include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] },
{ include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] },
{ include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] },
{ include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] },
{ include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] },
{ include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] },
{ include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] },
{ include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] },
{ include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] },
{ include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] },
{ include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] },
{ include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] },
{ include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] },
{ include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] },
{ include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] },
{ include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] },
{ include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] },
{ include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] },
{ include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] },
{ include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] },
{ include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] },
{ include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] },
{ include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] },
{ include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] },
{ include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] },
{ include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] },
{ include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] },
{ include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] },
{ include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] },
{ include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] },
{ include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] },
{ include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] },
{ include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] },
{ include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] },
{ include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] },
{ include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] },
{ include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] },
{ include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] },
{ include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] },
{ include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] },
{ include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] },
{ include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] },
{ include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] },
{ include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] },
{ include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] },
{ include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] },
{ include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] },
{ include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] },
{ include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] },
{ include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] },
{ include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] },
{ include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] },
{ include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] },
{ include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] },
{ include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] },
{ include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] },
{ include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] },
{ include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] },
{ include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] },
{ include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] },
{ include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] },
{ include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] },
{ include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] },
{ include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] },
{ include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] },
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] },
{ include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] },
{ include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] },
{ include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] },
{ include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] },
{ include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] },
{ include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] },
{ include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] },
{ include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] },
{ include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] },
{ include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] },
{ include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] },
{ include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] },
{ include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] },
{ include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] },
{ include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] },
{ include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] },
{ include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] },
{ include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] },
{ include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] },
{ include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] },
{ include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] },
{ include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] },
{ include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] },
{ include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] },
{ include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] },
{ include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] },
{ include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] },
{ include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] },
{ include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] },
{ include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] },
{ include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] },
{ include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] },
{ include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] },
{ include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] },
{ include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] },
{ include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] },
{ include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] },
{ include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] },
{ include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] },
{ include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] },
{ include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] },
{ include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] },
{ include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] },
{ include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] },
{ include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] },
{ include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] },
# Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h
{ include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
{ include: [ '"auevents_enum.generated.h"', private, '"nvim/autocmd.h"', public ] },
{ include: [ '"ex_cmds_enum.generated.h"', private, '"nvim/ex_cmds_defs.h"', public ] },
{ include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] },
{ include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] },
{ include: [ '"nvim/os/pty_process_unix.h"', private, '"nvim/os/pty_process.h"', public ] },
{ include: [ '"nvim/os/pty_process_win.h"', private, '"nvim/os/pty_process.h"', public ] },
{ include: [ '"nvim/os/unix_defs.h"', private, '"nvim/os/os_defs.h"', public ] },
{ include: [ '"nvim/os/win_defs.h"', private, '"nvim/os/os_defs.h"', public ] },
{ include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] },
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] },
{ include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] },
{ include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] },
{ include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] },
{ include: [ '"regexp_bt.h.generated.h"', private, '"nvim/regexp.h"', public ] },
{ include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] },
{ include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] },
{ include: [ '"ui_events_remote.generated.h"', private, '"nvim/api/ui.h"', public ] },
{ include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] },
# Def to normal headers: nvim/header_defs.h -> nvim/header.h
#
# This is a public to public mapping, meaning that while IWYU can use the
# headers on the left, it will use the headers on the right if possible. This
# isn't explicitly mentioned in the IWYU docs, this is just my interpretation
# of its behavior.
{ include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] },
{ include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] },
{ include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] },
{ include: [ '"nvim/extmark_defs.h"', public, '"nvim/extmark.h"', public ] },
{ include: [ '"nvim/grid_defs.h"', public, '"nvim/grid.h"', public ] },
{ include: [ '"nvim/highlight_defs.h"', public, '"nvim/highlight.h"', public ] },
{ include: [ '"nvim/map_defs.h"', public, '"nvim/map.h"', public ] },
{ include: [ '"nvim/mark_defs.h"', public, '"nvim/mark.h"', public ] },
{ include: [ '"nvim/mbyte_defs.h"', public, '"nvim/mbyte.h"', public ] },
{ include: [ '"nvim/memfile_defs.h"', public, '"nvim/memfile.h"', public ] },
{ include: [ '"nvim/memline_defs.h"', public, '"nvim/memline.h"', public ] },
{ include: [ '"nvim/menu_defs.h"', public, '"nvim/menu.h"', public ] },
{ include: [ '"nvim/msgpack/channel_defs.h"', public, '"nvim/msgpack/channel.h"', public ] },
{ include: [ '"nvim/option_defs.h"', public, '"nvim/option.h"', public ] },
{ include: [ '"nvim/os/fs_defs.h"', public, '"nvim/os/fs.h"', public ] },
{ include: [ '"nvim/os/os_defs.h"', public, '"nvim/os/os.h"', public ] },
{ include: [ '"nvim/regexp_defs.h"', public, '"nvim/regexp.h"', public ] },
{ include: [ '"nvim/sign_defs.h"', public, '"nvim/sign.h"', public ] },
{ include: [ '"nvim/spell_defs.h"', public, '"nvim/spell.h"', public ] },
{ include: [ '"nvim/statusline_defs.h"', public, '"nvim/statusline.h"', public ] },
{ include: [ '"nvim/syntax_defs.h"', public, '"nvim/syntax.h"', public ] },
{ include: [ '"nvim/tui/input_defs.h"', public, '"nvim/tui/input.h"', public ] },
{ include: [ '"nvim/undo_defs.h"', public, '"nvim/undo.h"', public ] },
# Third party headers
{ include: [ "<bits/types/wint_t.h>", private, "<wchar.h>", public ] },
{ include: [ '<arpa/inet.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', private ] },
{ include: [ '<libintl.h>', private, '"nvim/gettext.h"', public ] },
{ include: [ '<netdb.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<netinet/in.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<pthread.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<sys/socket.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<termios.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<unistd.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
# Symbols
{ symbol: [ "MAX", private, '"nvim/macros.h"', public ] },
{ symbol: [ "MIN", private, '"nvim/macros.h"', public ] },
{ symbol: [ "SEEK_END", private, '<stdio.h>', public ] },
{ symbol: [ "SEEK_SET", private, '<stdio.h>', public ] },
{ symbol: [ "time_fd", private, '"nvim/globals.h"', public ] },
]
# vim: set ft=toml:

View File

@ -4,5 +4,3 @@
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
char *default_vimruntime_dir = "";
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";
char_u *compiled_user = (char_u *)"${USERNAME}";
char_u *compiled_sys = (char_u *)"${HOSTNAME}";

View File

@ -15,7 +15,7 @@
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>, -I>"
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
#endif // AUTO_VERSIONDEF_H

281
cmake.deps/CMakeLists.txt Normal file
View File

@ -0,0 +1,281 @@
# This is not meant to be included by the top-level.
cmake_minimum_required (VERSION 3.10)
project(NVIM_DEPS C)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
include(CheckCCompilerFlag)
include(Util)
set(DEPS_CMAKE_ARGS
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-D CMAKE_C_STANDARD=99
-D CMAKE_GENERATOR=${CMAKE_GENERATOR}
-D CMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-D CMAKE_POSITION_INDEPENDENT_CODE=ON)
set(DEPS_CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES})
set_default_buildtype()
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
check_c_compiler_flag(-Og HAS_OG_FLAG)
if(HAS_OG_FLAG)
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
endif()
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr")
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin")
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib")
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build")
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads")
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUAROCKS "Use the bundled version of luarocks." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
#XXX(tarruda): Lua is only used for debugging the functional test client, don't
# build it unless explicitly requested
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
if(USE_BUNDLED AND MSVC)
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
else()
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
endif()
if(WIN32)
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON)
endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "Git is required to apply patches.")
endif()
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
else()
message(STATUS "Found GNU Make at ${MAKE_PRG}")
endif()
endif()
# When using make, use the $(MAKE) variable to avoid warning about the job
# server.
if(CMAKE_GENERATOR MATCHES "Makefiles")
set(MAKE_PRG "$(MAKE)")
endif()
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
find_program(MAKE_PRG NAMES mingw32-make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependencies.")
else()
message(STATUS "Found GNU Make for mingw32: ${MAKE_PRG}")
endif()
endif()
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
if(CMAKE_OSX_ARCHITECTURES)
# The LuaJIT build does not like being passed multiple `-arch` flags
# so we handle a universal build the old-fashioned way.
set(LUAJIT_C_COMPILER "${DEPS_C_COMPILER}")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -arch ${ARCH}")
endforeach()
endif()
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
if(APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
include(ExternalProject)
set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}")
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.46.0.tar.gz)
set(LIBUV_SHA256 7aa66be3413ae10605e1f5c9ae934504ffe317ef68ea16fdaa83e23905c681bd)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz)
set(MSGPACK_SHA256 3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba)
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/03c31124cc3b521ef54fe398e10fa55660a5057d.tar.gz)
set(LUAJIT_SHA256 61dcc7ae3f543ae3cc30e66db060e31e2a77e4be34ee65e370c953d112b4d60c)
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz)
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333)
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.9.2.tar.gz)
set(LUAROCKS_SHA256 a0b36cd68586cd79966d0106bb2e5a4f5523327867995fd66bee4237062b3e3b)
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz)
set(UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487)
set(LIBTERMKEY_URL https://github.com/neovim/deps/raw/aa004f1b2b6470a92363cba8e1cc1874141dacc4/opt/libtermkey-0.22.tar.gz)
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
set(LIBVTERM_URL https://github.com/neovim/deps/raw/12c9dcf1d823ac4acbccf494c93c4774a87db11d/opt/libvterm-0.3.3.tar.gz)
set(LIBVTERM_SHA256 09156f43dd2128bd347cbeebe50d9a571d32c64e0cf18d211197946aff7226e0)
set(LUV_URL https://github.com/luvit/luv/archive/1.45.0-0.tar.gz)
set(LUV_SHA256 97e89940f9eeaa8dfb34f1c19f80dd373299c42719d15228ec790f415d4e4965)
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
# Windows only: cat.exe diff.exe tee.exe xxd.exe
set(CAT_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/cat.exe)
set(CAT_SHA256 93b8d307bb15af3968920bdea3beb869a49d166f9164853c58a4e6ffdcae61c6)
set(DIFF_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/diff.exe)
set(DIFF_SHA256 4ceceebc8150422c6d8d9a06c2e9686d5a5d90f1033f60ad92ab81fe810e2a28)
set(TEE_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/tee.exe)
set(TEE_SHA256 950eea4e17fa3a7e89fa2c55374037b5797b3f1a54fea1304634884ab42ec14d)
set(XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe)
set(XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.1.1/win32yank-x64.zip)
set(WIN32YANK_X86_64_SHA256 247c9a05b94387a884b49d3db13f806b1677dfc38020f955f719be6902260cd6)
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
set(LIBICONV_URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178)
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.5.tar.gz)
set(TREESITTER_C_SHA256 694a5408246ee45d535df9df025febecdb50bee764df64a94346b9805a5f349b )
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.18.tar.gz)
set(TREESITTER_LUA_SHA256 659beef871a7fa1d9a02c23f5ebf55019aa3adce6d7f5441947781e128845256)
set(TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz)
set(TREESITTER_VIM_SHA256 403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2)
set(TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v2.0.0.tar.gz)
set(TREESITTER_VIMDOC_SHA256 1ff8f4afd3a9599dd4c3ce87c155660b078c1229704d1a254433e33794b8f274)
set(TREESITTER_QUERY_URL https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz)
set(TREESITTER_QUERY_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c)
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.8.tar.gz)
set(TREESITTER_SHA256 6181ede0b7470bfca37e293e7d5dc1d16469b9485d13f13a605baec4a8b1f791)
if(USE_EXISTING_SRC_DIR)
get_cmake_property(VARS VARIABLES)
foreach (VAR ${VARS})
if(VAR MATCHES "^.*URL$")
unset(${VAR})
endif()
endforeach()
endif()
if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium)
endif()
if(USE_BUNDLED_LIBTERMKEY)
include(BuildLibtermkey)
if(USE_BUNDLED_UNIBILIUM)
add_dependencies(libtermkey unibilium)
endif()
endif()
if(USE_BUNDLED_LIBVTERM)
include(BuildLibvterm)
endif()
if(USE_BUNDLED_LIBUV)
include(BuildLibuv)
endif()
if(USE_BUNDLED_MSGPACK)
include(BuildMsgpack)
endif()
if(USE_BUNDLED_LUAJIT)
include(BuildLuajit)
endif()
if(USE_BUNDLED_LUA)
include(BuildLua)
endif()
if(USE_BUNDLED_LUAROCKS)
include(BuildLuarocks)
endif()
if(USE_BUNDLED_LUV)
include(BuildLuv)
endif()
if(USE_BUNDLED_GETTEXT)
include(BuildGettext)
endif()
if(USE_BUNDLED_LIBICONV)
include(BuildLibiconv)
endif()
if(USE_BUNDLED_TS_PARSERS)
include(BuildTreesitterParsers)
endif()
if(USE_BUNDLED_TS)
include(BuildTreesitter)
endif()
if(WIN32)
include(GetBinaryDeps)
GetExecutable(TARGET cat)
GetExecutable(TARGET diff)
GetExecutable(TARGET tee)
GetExecutable(TARGET xxd)
if(USE_BUNDLED_NVIMQT)
GetBinaryDep(TARGET wingui
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory bin ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory share ${DEPS_INSTALL_DIR}/share)
endif()
GetBinaryDep(TARGET win32yank_X86_64
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR})
endif()

View File

@ -0,0 +1,20 @@
if(MSVC)
ExternalProject_Add(gettext
URL ${GETTEXT_URL}
URL_HASH SHA256=${GETTEXT_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt
${DEPS_BUILD_DIR}/src/gettext/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D LIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-D LIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
else()
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()
if(USE_BUNDLED_LIBICONV)
add_dependencies(gettext libiconv)
endif()

View File

@ -0,0 +1,14 @@
if(MSVC)
ExternalProject_Add(libiconv
URL ${LIBICONV_URL}
URL_HASH SHA256=${LIBICONV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
else()
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()

View File

@ -0,0 +1,13 @@
ExternalProject_Add(libtermkey
URL ${LIBTERMKEY_URL}
URL_HASH SHA256=${LIBTERMKEY_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibtermkeyCMakeLists.txt
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D CMAKE_SHARED_LIBRARY_LINK_C_FLAGS="" # Hack to avoid -rdynamic in Mingw
-D UNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-D UNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,10 @@
ExternalProject_Add(libuv
URL ${LIBUV_URL}
URL_HASH SHA256=${LIBUV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D CMAKE_INSTALL_LIBDIR=lib
-D BUILD_TESTING=OFF
-D LIBUV_BUILD_SHARED=OFF
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,10 @@
ExternalProject_Add(libvterm
URL ${LIBVTERM_URL}
URL_HASH SHA256=${LIBVTERM_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,62 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LUA_TARGET linux)
elseif(APPLE)
set(LUA_TARGET macosx)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(LUA_TARGET freebsd)
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
set(CMAKE_LUA_TARGET bsd)
elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
set(CMAKE_LUA_TARGET mingw)
else()
if(UNIX)
set(LUA_TARGET posix)
else()
set(LUA_TARGET generic)
endif()
endif()
set(LUA_CFLAGS "-O0 -g3 -fPIC")
set(LUA_LDFLAGS "")
if(ENABLE_ASAN_UBSAN)
set(LUA_CFLAGS "${LUA_CFLAGS} -fsanitize=address")
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-omit-frame-pointer")
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-optimize-sibling-calls")
set(LUA_LDFLAGS "${LUA_LDFLAGS} -fsanitize=address")
endif()
set(LUA_CONFIGURE_COMMAND
sed -e "/^CC/s@gcc@${CMAKE_C_COMPILER}@"
-e "/^CFLAGS/s@-O2@${LUA_CFLAGS}@"
-e "/^MYLDFLAGS/s@$@${LUA_LDFLAGS}@"
-e "s@-lreadline@@g"
-e "s@-lhistory@@g"
-e "s@-lncurses@@g"
-i ${DEPS_BUILD_DIR}/src/lua/src/Makefile &&
sed -e "/#define LUA_USE_READLINE/d"
-e "s@\\(#define LUA_ROOT[ ]*\"\\)/usr/local@\\1${DEPS_INSTALL_DIR}@"
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
message(STATUS "Lua target is ${LUA_TARGET}")
ExternalProject_Add(lua
URL ${LUA_URL}
URL_HASH SHA256=${LUA_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install)
set(BUSTED ${DEPS_BIN_DIR}/busted)
set(BUSTED_LUA ${BUSTED}-lua)
add_custom_command(OUTPUT ${BUSTED_LUA}
COMMAND sed -e 's/^exec/exec $$LUA_DEBUGGER/' -e 's/jit//g' < ${BUSTED} > ${BUSTED_LUA} && chmod +x ${BUSTED_LUA}
DEPENDS lua busted ${BUSTED})
add_custom_target(busted-lua ALL
DEPENDS ${DEPS_BIN_DIR}/busted-lua)

View File

@ -0,0 +1,146 @@
# BuildLuajit(TARGET targetname CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build luajit, wraps ExternalProject_Add.
# Failing to pass a command argument will result in no command being run
function(BuildLuajit)
cmake_parse_arguments(_luajit
""
"TARGET"
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
${ARGN})
if(NOT _luajit_CONFIGURE_COMMAND AND NOT _luajit_BUILD_COMMAND
AND NOT _luajit_INSTALL_COMMAND)
message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND")
endif()
if(NOT _luajit_TARGET)
set(_luajit_TARGET "luajit")
endif()
ExternalProject_Add(${_luajit_TARGET}
URL ${LUAJIT_URL}
URL_HASH SHA256=${LUAJIT_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1
BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
DEPENDS "${_luajit_DEPENDS}")
endfunction()
check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK)
if(APPLE AND HAS_NO_STACK_CHECK)
set(NO_STACK_CHECK "CFLAGS+=-fno-stack-check")
else()
set(NO_STACK_CHECK "")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
set(AMD64_ABI "LDFLAGS=-lpthread -lc++abi")
else()
set(AMD64_ABI "")
endif()
set(BUILDCMD_UNIX ${MAKE_PRG} -j CFLAGS=-fPIC
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-funwind-tables
${NO_STACK_CHECK}
${AMD64_ABI}
CCDEBUG+=-g
Q=)
# Setting MACOSX_DEPLOYMENT_TARGET is mandatory for LuaJIT; use version set by
# cmake.deps/CMakeLists.txt (either environment variable or current system version).
if(APPLE)
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
if((UNIX AND NOT APPLE) OR (APPLE AND NOT CMAKE_OSX_ARCHITECTURES))
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET} install)
elseif(CMAKE_OSX_ARCHITECTURES AND APPLE)
# Passing multiple `-arch` flags to the LuaJIT build will cause it to fail.
# To get a working universal build, we build each requested architecture slice
# individually then `lipo` them all up.
set(LUAJIT_SRC_DIR "${DEPS_BUILD_DIR}/src/luajit")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(STATIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH}")
set(DYNAMIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH} -fPIC")
set(TARGET_LD "${LUAJIT_C_COMPILER} -arch ${ARCH}")
list(APPEND LUAJIT_THIN_EXECUTABLES "${LUAJIT_SRC_DIR}-${ARCH}/src/luajit")
list(APPEND LUAJIT_THIN_STATIC_LIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.a")
list(APPEND LUAJIT_THIN_DYLIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.so")
list(APPEND LUAJIT_THIN_TARGETS "luajit-${ARCH}")
# See https://luajit.org/install.html#cross.
BuildLuaJit(TARGET "luajit-${ARCH}"
BUILD_COMMAND ${BUILDCMD_UNIX}
CC=${LUAJIT_C_COMPILER} STATIC_CC=${STATIC_CC}
DYNAMIC_CC=${DYNAMIC_CC} TARGET_LD=${TARGET_LD}
PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET})
endforeach()
BuildLuaJit(
CONFIGURE_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET}
COMMAND ${CMAKE_COMMAND} -E rm -f ${LUAJIT_SRC_DIR}/src/luajit ${LUAJIT_SRC_DIR}/src/libluajit.so ${LUAJIT_SRC_DIR}/src/libluajit.a
BUILD_COMMAND lipo ${LUAJIT_THIN_EXECUTABLES} -create -output ${LUAJIT_SRC_DIR}/src/luajit
COMMAND lipo ${LUAJIT_THIN_STATIC_LIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.a
COMMAND lipo ${LUAJIT_THIN_DYLIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.so
INSTALL_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET} install
DEPENDS ${LUAJIT_THIN_TARGETS}
)
elseif(MINGW)
if(CMAKE_GENERATOR MATCHES "Ninja")
set(LUAJIT_MAKE_PRG ${MAKE_PRG})
else()
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
endif()
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-funwind-tables
CCDEBUG+=-g
BUILDMODE=static
# Build a DLL too
COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
# Luarocks searches for lua51.dll in lib
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
)
elseif(MSVC)
BuildLuaJit(
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
# Luarocks searches for lua51.lib
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/lua51.lib
# Luv searches for luajit.lib
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/luajit.lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
)
else()
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()
if (NOT MSVC)
add_custom_target(clean_shared_libraries_luajit ALL
COMMAND ${CMAKE_COMMAND}
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
add_dependencies(clean_shared_libraries_luajit luajit)
endif()

View File

@ -0,0 +1,160 @@
# Luarocks recipe. Luarocks is only required when building Neovim.
# NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because
# running luarocks in parallel will break, e.g. when some rocks have
# the same dependency..
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
# The luarocks binary location
set(LUAROCKS_BINARY ${DEPS_BIN_DIR}/luarocks)
# Arguments for calls to 'luarocks build'
if(NOT MSVC)
# In MSVC don't pass the compiler/linker to luarocks, the bundled
# version already knows, and passing them here breaks the build
set(LUAROCKS_BUILDARGS CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER})
endif()
# Lua version, used with rocks directories.
# Defaults to 5.1 for bundled LuaJIT/Lua.
set(LUA_VERSION "5.1")
if(UNIX)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUAROCKS_OPTS
--with-lua=${DEPS_INSTALL_DIR}
--with-lua-include=${DEPS_INSTALL_DIR}/include/luajit-2.1
--with-lua-interpreter=luajit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUAROCKS_OPTS
--with-lua=${DEPS_INSTALL_DIR})
else()
find_package(Luajit)
if(LUAJIT_FOUND)
list(APPEND LUAROCKS_OPTS
--with-lua-include=${LUAJIT_INCLUDE_DIRS}
--with-lua-interpreter=luajit)
endif()
# Get LUA_VERSION used with rocks output.
if(LUAJIT_FOUND)
set(LUA_EXE "luajit")
else()
set(LUA_EXE "lua")
endif()
execute_process(
COMMAND ${LUA_EXE} -e "print(string.sub(_VERSION, 5))"
OUTPUT_VARIABLE LUA_VERSION
ERROR_VARIABLE ERR
RESULT_VARIABLE RES)
if(NOT RES EQUAL 0)
message(FATAL_ERROR "Could not get LUA_VERSION with ${LUA_EXE}: ${ERR}")
endif()
endif()
set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${DEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS})
set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
elseif(MSVC OR MINGW)
if(MINGW)
set(COMPILER_FLAG /MW)
elseif(MSVC)
set(COMPILER_FLAG /MSVC)
endif()
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
/LUA ${DEPS_INSTALL_DIR}
/LIB ${DEPS_LIB_DIR}
/BIN ${DEPS_BIN_DIR}
/INC ${DEPS_INSTALL_DIR}/include/luajit-2.1
/P ${DEPS_INSTALL_DIR}/luarocks /TREE ${DEPS_INSTALL_DIR}
/SCRIPTS ${DEPS_BIN_DIR}
/CMOD ${DEPS_BIN_DIR}
${COMPILER_FLAG}
/LUAMOD ${DEPS_BIN_DIR}/lua)
set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/luarocks/luarocks.bat)
else()
message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()
ExternalProject_Add(luarocks
URL ${LUAROCKS_URL}
URL_HASH SHA256=${LUAROCKS_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
BUILD_COMMAND ""
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
if(USE_BUNDLED_LUAJIT)
add_dependencies(luarocks luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(luarocks lua)
endif()
set(ROCKS_DIR ${DEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
if(MSVC)
# Workaround for luarocks failing to find the md5sum.exe it is shipped with.
list(APPEND LUAROCKS_BUILDARGS MD5SUM=md5sum)
set(PATH PATH=${DEPS_INSTALL_DIR}/luarocks/tools;$ENV{PATH})
endif()
# mpack
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build mpack 1.0.10-0 ${LUAROCKS_BUILDARGS}
DEPENDS luarocks)
add_custom_target(mpack ALL DEPENDS ${ROCKS_DIR}/mpack)
# lpeg
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
DEPENDS mpack)
add_custom_target(lpeg ALL DEPENDS ${ROCKS_DIR}/lpeg)
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
# luabitop
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
DEPENDS lpeg)
add_custom_target(luabitop ALL DEPENDS ${ROCKS_DIR}/luabitop)
endif()
if(USE_BUNDLED_BUSTED)
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
set(BUSTED_DEPENDS luabitop)
else()
set(BUSTED_DEPENDS lpeg)
endif()
# busted
if(WIN32)
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted.bat")
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck.bat")
else()
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted")
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck")
endif()
add_custom_command(OUTPUT ${BUSTED_EXE}
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build busted 2.1.1 ${LUAROCKS_BUILDARGS}
DEPENDS ${BUSTED_DEPENDS})
add_custom_target(busted ALL DEPENDS ${BUSTED_EXE})
# luacheck
add_custom_command(OUTPUT ${LUACHECK_EXE}
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luacheck 1.1.0-1 ${LUAROCKS_BUILDARGS}
DEPENDS busted)
add_custom_target(luacheck ALL DEPENDS ${LUACHECK_EXE})
if (USE_BUNDLED_LUA OR NOT USE_BUNDLED_LUAJIT)
# coxpcall
add_custom_command(OUTPUT ${ROCKS_DIR}/coxpcall
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build coxpcall 1.17.0-1 ${LUAROCKS_BUILDARGS}
DEPENDS luarocks)
add_custom_target(coxpcall ALL DEPENDS ${ROCKS_DIR}/coxpcall)
endif()
endif()

View File

@ -0,0 +1,62 @@
set(LUV_INCLUDE_FLAGS
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(LUV_CMAKE_ARGS
-D LUA_BUILD_TYPE=System
-D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
-D WITH_SHARED_LIBUV=ON
-D BUILD_SHARED_LIBS=OFF
-D BUILD_STATIC_LIBS=ON
-D BUILD_MODULE=OFF)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
else()
find_package(Luajit)
if(LUAJIT_FOUND)
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
else()
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
endif()
endif()
if(USE_BUNDLED_LIBUV)
list(APPEND LUV_CMAKE_ARGS -D CMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR})
endif()
list(APPEND LUV_CMAKE_ARGS
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS}")
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
list(APPEND LUV_CMAKE_ARGS -D CMAKE_MAKE_PROGRAM=gmake)
endif()
ExternalProject_Add(lua-compat-5.3
URL ${LUA_COMPAT53_URL}
URL_HASH SHA256=${LUA_COMPAT53_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
ExternalProject_Add(luv-static
DEPENDS lua-compat-5.3
URL ${LUV_URL}
URL_HASH SHA256=${LUV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
SOURCE_DIR ${DEPS_BUILD_DIR}/src/luv
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LUV_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if(USE_BUNDLED_LUAJIT)
add_dependencies(luv-static luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(luv-static lua)
endif()
if(USE_BUNDLED_LIBUV)
add_dependencies(luv-static libuv)
endif()

View File

@ -0,0 +1,17 @@
ExternalProject_Add(msgpack
URL ${MSGPACK_URL}
URL_HASH SHA256=${MSGPACK_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D MSGPACK_BUILD_TESTS=OFF
-D MSGPACK_BUILD_EXAMPLES=OFF
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if (NOT MSVC)
add_custom_target(clean_shared_libraries_msgpack ALL
COMMAND ${CMAKE_COMMAND}
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
add_dependencies(clean_shared_libraries_msgpack msgpack)
endif()

View File

@ -0,0 +1,11 @@
ExternalProject_Add(treesitter
URL ${TREESITTER_URL}
URL_HASH SHA256=${TREESITTER_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
INSTALL_DIR ${DEPS_INSTALL_DIR}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,39 @@
# Helper function to download treesitter parsers
#
# Single value arguments:
# LANG - Parser language
# CMAKE_FILE - Cmake file to build the parser with. Defaults to
# TreesitterParserCMakeLists.txt.
function(BuildTSParser)
cmake_parse_arguments(TS
""
"LANG;CMAKE_FILE"
""
${ARGN})
if(NOT TS_CMAKE_FILE)
set(TS_CMAKE_FILE TreesitterParserCMakeLists.txt)
endif()
set(NAME treesitter-${TS_LANG})
string(TOUPPER "TREESITTER_${TS_LANG}_URL" URL_VARNAME)
set(URL ${${URL_VARNAME}})
string(TOUPPER "TREESITTER_${TS_LANG}_SHA256" HASH_VARNAME)
set(HASH ${${HASH_VARNAME}})
ExternalProject_Add(${NAME}
URL ${URL}
URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D PARSERLANG=${TS_LANG}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
endfunction()
foreach(lang c lua vim vimdoc query)
BuildTSParser(LANG ${lang})
endforeach()

View File

@ -0,0 +1,7 @@
ExternalProject_Add(unibilium
URL ${UNIBILIUM_URL}
URL_HASH SHA256=${UNIBILIUM_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,53 @@
# This is similar to the build recipes, but instead downloads a third party
# binary and installs it under the DEPS_PREFIX.
# The INSTALL_COMMAND is executed in the folder where downloaded files are
# extracted and the ${DEPS_INSTALL_DIR} holds the path to the third-party
# install root.
function(GetBinaryDep)
cmake_parse_arguments(_gettool
"BUILD_IN_SOURCE"
"TARGET"
"INSTALL_COMMAND"
${ARGN})
string(TOUPPER "${_gettool_TARGET}_URL" URL_VARNAME)
string(TOUPPER "${_gettool_TARGET}_SHA256" HASH_VARNAME)
set(URL ${${URL_VARNAME}})
set(HASH ${${HASH_VARNAME}})
ExternalProject_Add(${_gettool_TARGET}
URL ${URL}
URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND "${_gettool_INSTALL_COMMAND}")
endfunction()
# Download executable and move it to DEPS_BIN_DIR
function(GetExecutable)
cmake_parse_arguments(ARG
""
"TARGET"
""
${ARGN})
string(TOUPPER "${ARG_TARGET}_URL" URL_VARNAME)
string(TOUPPER "${ARG_TARGET}_SHA256" HASH_VARNAME)
set(URL ${${URL_VARNAME}})
set(HASH ${${HASH_VARNAME}})
ExternalProject_Add(${ARG_TARGET}
URL ${URL}
URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
DOWNLOAD_NO_EXTRACT TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOADED_FILE> ${DEPS_BIN_DIR})
endfunction()

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(gettext C)
# Adds PREFIX to each item in LIST
@ -327,3 +327,5 @@ install(TARGETS libintl msgmerge msgfmt xgettext
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# vim: set ft=cmake:

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libiconv C)
include_directories(
@ -95,3 +95,5 @@ install(TARGETS libcharset libiconv iconv
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# vim: set ft=cmake:

View File

@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 2.8.12)
project(libtermkey)
cmake_minimum_required(VERSION 3.10)
project(libtermkey C)
add_definitions(-D _CRT_SECURE_NO_WARNINGS)
add_definitions(-DHAVE_UNIBILIUM)
if(NOT MSVC)
add_compile_options(-std=c99)
endif()
include_directories(${PROJECT_BINARY_DIR}/t)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
@ -20,15 +17,4 @@ install(TARGETS termkey
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
enable_testing()
file(GLOB TESTSOURCES "t/[0-9]*.c")
foreach(f ${TESTSOURCES})
get_filename_component(t ${f} NAME_WE)
if(${t} STREQUAL 05read)
continue()
endif()
add_executable("test_${t}" ${f} t/taplib.c)
target_link_libraries("test_${t}" termkey)
add_test("${t}" "test_${t}")
endforeach()
# vim: set ft=cmake:

View File

@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.10)
project(libvterm C)
include(GNUInstallDirs)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR})
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
add_library(vterm ${VTERM_SOURCES})
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES include/vterm.h include/vterm_keycodes.h
DESTINATION include)
if(NOT WIN32)
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
foreach(EXE_C ${BIN_SOURCES})
get_filename_component(target_name ${EXE_C} NAME_WE)
add_executable(${target_name} ${EXE_C})
target_link_libraries(${target_name} vterm)
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
endif()
# vim: set ft=cmake:

Some files were not shown because too many files have changed in this diff Show More