Commit Graph

24826 Commits

Author SHA1 Message Date
Luuk van Baal
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
Luuk van Baal
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
dundargoc
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
Christian Clason
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
dundargoc
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
dundargoc
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
bfredl
0ea4156464
Merge pull request #22098 from tmccombs/sockopen-docs
docs: clarify "pipe" mode for sockconnect
2023-02-02 19:09:02 +01:00
Christian Clason
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
zeertzjq
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
bfredl
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
bfredl
405f0a8c3f build: update release data 2023-02-02 14:37:44 +01:00
Lewis Russell
b02eeb6a72
fix(lua): mark some eval functions that can run in API-fast 2023-02-02 13:21:44 +00:00
dundargoc
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
luukvbaal
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
Thayne McCombs
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
zeertzjq
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
github-actions[bot]
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
zeertzjq
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
Lewis Russell
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
zeertzjq
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
Lewis Russell
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
Lewis Russell
b3d304df93 refactor(fileio.c): remove HAVE_ACL ifdefs 2023-02-01 11:14:20 +00:00
Christian Clason
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
Christian Clason
37da48cabd build(deps): bump tree-sitter-vimdoc to v1.3.0 2023-02-01 11:34:51 +01:00
zeertzjq
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
Christian Clason
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
zeertzjq
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
zeertzjq
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
bfredl
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
bfredl
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
bfredl
42999a8d64 fix(test): fix issues detected by running unittests in ASAN/UBSAN 2023-01-31 18:28:29 +01:00
Lewis Russell
c1a3865c47 refactor(fileio.c): factor out backup creation 2023-01-31 17:20:12 +00:00
Lewis Russell
33a183e898 refactor(fileio.c): make unreadable expression readable 2023-01-31 17:18:57 +00:00
Lewis Russell
eacdece354 refactor(fileio.c): factor out file info calc 2023-01-31 17:18:54 +00:00
Lewis Russell
cb3be2c766 refactor(fileio.c): factor out buf_write post autocmds 2023-01-31 17:16:41 +00:00
Lewis Russell
842cf780a6 refactor(fileio.c): do not use macros for error handling 2023-01-31 17:15:51 +00:00
Christian Clason
8b11cf5092
Merge pull request #22005 from clason/sanitize-lang
fix(treesitter): validate language name
2023-01-31 17:28:32 +01:00
Lewis Russell
9417a3d98a refactor(fileio.c): reduce scope of locals 2023-01-31 14:00:08 +00:00
bfredl
d6d6ab3f8e feat(lua): low-level interpreter mode (nvim -ll) 2023-01-31 13:53:22 +01:00
bfredl
facbb11e05
Merge pull request #22068 from bfredl/lsptest
fix(tests): use -l mode for lsp tests
2023-01-31 13:49:51 +01:00
bfredl
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
Lewis Russell
253a4d7074 refactor(fileio.c): more bools 2023-01-31 11:20:35 +00:00
Lewis Russell
b001f25204 refactor(fileio.c): factor out autocmd handling from buf_write() 2023-01-31 11:20:35 +00:00
Lewis Russell
f4b1f0d042 refactor(fileio.c): remove HAS_BW_FLAGS 2023-01-31 11:20:35 +00:00
Lewis Russell
740f6ae168 refactor(fileio.c): refactor buf_write_bytes (2) 2023-01-31 11:20:34 +00:00
Lewis Russell
f770e05c87 refactor(fileio.c): refactor buf_write_bytes 2023-01-31 11:20:34 +00:00
Lewis Russell
99149153c4 refactor(fileio.c): refactor vim_rename() 2023-01-31 11:20:34 +00:00
Lewis Russell
b7d09695c4 refactor(fileio.c): refactor match_file_path() 2023-01-31 11:20:34 +00:00
Christian Clason
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
zeertzjq
860fea1a3f
fix(highlight): properly deal with underline mask when listing (#22057) 2023-01-31 07:08:23 +08:00