Commit Graph

22875 Commits

Author SHA1 Message Date
Lewis Russell
2afcdbd63a
feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
bfredl
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
Famiu Haque
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
Jonas Strittmatter
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
zeertzjq
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
zeertzjq
689f5d604e feat(api): add support for :horizontal modifier 2022-09-01 20:53:43 +08:00
zeertzjq
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
zeertzjq
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
zeertzjq
db2e5f46f5
fix(lua): make ui_attach()/ui_detach() take effect immediately (#20037) 2022-09-01 16:37:29 +08:00
bfredl
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
bfredl
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
bfredl
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
bfredl
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
bfredl
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
Dundar Göc
bd51ac2a34 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 21:17:10 +02:00
bfredl
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
bfredl
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
bfredl
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
zeertzjq
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
Dundar Göc
fb1edb2f57 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 13:47:18 +02:00
zeertzjq
fa747d004a
fix(api): nvim_set_hl bail out on invalid group name (#20021) 2022-08-31 19:47:10 +08:00
Christian Clason
0903702634
vim-patch:9b03d3e75b42 (#20013)
Update runtime files
9b03d3e75b
2022-08-31 08:08:51 +02:00
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
Sean Dewar
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
Christian Clason
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
dundargoc
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
Christian Clason
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
Mathias Fußenegger
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
Mathias Fußenegger
0368ca70c4
docs(lsp): replace formatting_sync example in lsp-faq (#19994)
`formatting_sync` is deprecated
2022-08-30 13:14:09 +02:00
bfredl
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
bfredl
6ab2bf6819 fix(highlight): set the window namespace when redrawing statusline 2022-08-30 10:28:11 +02:00
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
2c83d7b2dd refactor: move cmdline functions to ex_getln.c 2022-08-30 06:32:08 +08:00
zeertzjq
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
bfredl
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
bfredl
8fd66ff5c5 fix(redraw): handle switching to a tabpage with larger p_ch value 2022-08-29 21:58:07 +02:00
Raphael
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
bfredl
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
Mathias Fußenegger
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
Dundar Göc
58f30a326f refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-29 15:48:56 +02:00
zeertzjq
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
bfredl
e6af1cf250
Merge pull request #19971 from dundargoc/refactor/remove-casts
refactor: remove redundant casts
2022-08-29 13:23:43 +02:00