Commit Graph

22983 Commits

Author SHA1 Message Date
bfredl
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
bfredl
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
Eisuke Kawashima
c77bb5a528
build(treesitter): set CMAKE_C_STANDARD to C99 2022-09-07 06:33:58 +09:00
Christian Clason
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
Andreas Schneider
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
Andreas Schneider
9ecaa35f55 build(deps): use libvterm 0.3-rc1 2022-09-06 21:48:14 +02:00
Andreas Schneider
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
bfredl
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
Lewis Russell
707edfc9e6
fix(ts): do not clobber spelloptions (#20095) 2022-09-06 19:22:05 +01:00
bfredl
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
Christian Clason
d01cadd82f fix(treesitter): don't support legacy syntax in start() 2022-09-06 17:33:44 +02:00
dundargoc
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
Dundar Göc
73207cae61 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-06 16:44:37 +02:00
Shougo
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
dundargoc
12afc344de
refactor: migrate comment style 2 #20080 2022-09-06 07:23:00 -07:00
Andreas Schneider
74db632c97 refactor(term): use const for title and add len to buf_set_term_title() 2022-09-06 13:23:50 +02:00
Lewis Russell
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
Thomas Vigouroux
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
bfredl
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
Christian Clason
95fd1ad83e refactor(treesitter): get_{nodes,captures}_at_{position,cursor} 2022-09-06 10:15:23 +02:00
Quentin Rasmont
ffe98531b9 feat(treesitter): upstream get_node_at_cursor()
Util from the nvim-treesitter project.
2022-09-06 10:14:05 +02:00
bfredl
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
Christian Clason
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
Lewis Russell
5b7213ad7f
docs: update .mailmap (#20086)
Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2022-09-06 08:57:03 +02:00
Christian Clason
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
Christian Clason
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
Christian Clason
64cc78c9f3 feat(treesitter): add injections 2022-09-06 07:57:46 +02:00
Christian Clason
e85b8aa768 feat(treesitter): add viml parser and queries 2022-09-06 07:57:46 +02:00
Christian Clason
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
Thomas Vigouroux
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
UnkwUsr
a220650fd6
docs(contributing): fix broken link (#20044) 2022-09-05 08:44:52 +02:00
zeertzjq
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
zeertzjq
82d128405a feat(pum): pretend 'mousemoveevent' is set when showing right-click menu 2022-09-04 21:18:23 +08:00
zeertzjq
ceb09701f2 feat(api): add "move" to nvim_input_mouse 2022-09-04 21:18:23 +08:00
zeertzjq
04bd700ac3 feat(tui): support 'mousemoveevent' 2022-09-04 21:18:22 +08:00
zeertzjq
a5fe7940c8 feat(ui-ext): make 'mousemoveevent' a ui_option 2022-09-04 21:18:22 +08:00
zeertzjq
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
zeertzjq
900a774182
Merge pull request #20073 from zeertzjq/vim-088e8e344352
vim-patch:7.4.{1578,1624},088e8e344352
2022-09-04 20:41:01 +08:00
zeertzjq
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
zeertzjq
6f7d55d3d9 vim-patch:7.4.{1578,1624}
975b5271ee
03602ec28e
2022-09-04 18:39:55 +08:00
Christian Clason
24fbda04b9
build(deps): bump tree-sitter-c to v0.20.2 (#20079) 2022-09-04 12:09:04 +02:00
Gregory Anders
ea10e0c104
ci: remove gpanders from api reviewers (#20074) 2022-09-03 21:49:45 -06:00
Christian Clason
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
Stephan Seitz
c50460cf3b
feat(treesitter): include language in invalid query error (#14053) 2022-09-03 16:02:58 +02:00
dundargoc
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
Christian Clason
5296e9407d
build(deps): bump tree-sitter to v0.20.7 (#20067) 2022-09-03 11:30:24 +02:00
Lewis Russell
1e3073bc35
docs: update .git-blame-ignore-revs (#20066) 2022-09-03 10:18:05 +01:00