Commit Graph

25212 Commits

Author SHA1 Message Date
koeleck
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
Enan Ajmain
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
Justin M. Keyes
5726f33e8c
Merge #22691 build!: sanitizers for gcc 2023-03-19 13:42:25 -04:00
Enan Ajmain
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
bfredl
65046c830e
Merge pull request #22673 from Diablo-D3/fixfloatclamp
fix(float): remove -1 in height clamp
2023-03-19 13:48:05 +01:00
Patrick McFarland
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
luukvbaal
eeac80de0c
fix(column): invalidate statuscolumn width when UPD_NOT_VALID (#22723) 2023-03-19 09:21:49 +00:00
luukvbaal
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
zeertzjq
8916669d50
test(statuscolumn_spec): remove unnecessary feed('lh')
It is no longer needed after #22706.
2023-03-18 19:06:24 +08:00
Amaan Qureshi
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
Christian Clason
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
zeertzjq
07f59467da
refactor(completion): don't add and remove '^' for Lua (#22702) 2023-03-17 20:09:56 +08:00
Christian Clason
ba8b564986
build(deps): bump win32yank to v0.1.1 (#22700) 2023-03-17 13:04:37 +01:00
Yochem van Rosmalen
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
August Masquelier
6162269fa3
fix(lsp): avoid switching buffers on lsp attach (#22689) 2023-03-17 12:26:13 +01:00
Christian Clason
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
Christian Clason
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
Christian Clason
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
Christian Clason
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
ii14
17ce634b8f build!: rename sanitizer options from CLANG_* to ENABLE_* 2023-03-17 03:40:57 +01:00
Christian Clason
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
Christian Clason
a5cf62e81c build(deps): bump mpack to 1.0.10 2023-03-17 01:03:56 +01:00
ii14
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
bfredl
995196c614
Merge pull request #22687 from bfredl/intermarks
refactor(extmarks): some minor internal API changes
2023-03-16 14:23:09 +01:00
bfredl
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
ii14
320cb344c1
docs(api): link to nvim_set_hl_ns from nvim_set_hl (#22678) 2023-03-16 09:31:37 +01:00
Christian Clason
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
Christian Clason
17ff65f59a build(deps): bump coxpcall to 1.17.0-1 2023-03-15 18:37:08 +01:00
Christian Clason
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
Christian Clason
5a38e951ec
build(deps): bump tree-sitter to HEAD - a318b42c8 2023-03-15 14:25:04 +01:00
Justin M. Keyes
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
Justin M. Keyes
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
Enan Ajmain
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
bfredl
d1e0f7454b
Merge pull request #22666 from bfredl/unscreen
refactor(screen): screen.c delenda est
2023-03-14 14:00:56 +01:00
bfredl
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
Ivan
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
hrsh7th
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
Zoltán Reegn
06e3ff6671
docs(lsp): opt-out of default LSP "gq" #22615
close #22611
2023-03-14 03:42:27 -07:00
Christian Clason
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
bfredl
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
bfredl
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
Christian Clason
27b467bad2
build(deps): bump tree-sitter to v0.20.8 (#22663) 2023-03-14 09:29:56 +01:00
dundargoc
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
Christian Clason
9ab814eafa docs(help): consistent headers for local additions 2023-03-13 20:17:31 +01:00
Christian Clason
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
Dan Strokirk
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
Christian Clason
4e99cc1217
Merge pull request #22627 from nullchilly/highlight-cleanup
refactor!: remove deprecated functions
2023-03-13 13:59:38 +01:00