Commit Graph

25099 Commits

Author SHA1 Message Date
zeertzjq
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
zeertzjq
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
zeertzjq
bf44556906 refactor(drawline.c): move number column helpers function together 2023-03-03 19:09:53 +08:00
Jaehwang Jung
f0a2ffab29
fix(treesitter): typos in _range.lua
fix(treesitter): typos _range.lua
2023-03-03 11:05:59 +00:00
Lewis Russell
6d4f481821
fix(treesitter): disallow empty filetypes
Fixes #22473
2023-03-03 09:44:02 +00:00
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
Amaan Qureshi
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
dundargoc
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
Gregory Anders
86ff239240 refactor(treesitter): use string.format to create lines 2023-03-02 14:15:18 -07:00
Gregory Anders
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
Christian Clason
f449121764
feat(treesitter): add :InspectTree command (#22477) 2023-03-02 18:03:11 +01:00
Justin M. Keyes
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
dundargoc
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
zeertzjq
fb1db80f5a
test(treesitter/parser_spec): correct time unit (#22471) 2023-03-02 14:42:15 +08:00
Mike
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
Gregory Anders
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
zeertzjq
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
Mathias Fußenegger
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
zeertzjq
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
Jens Claes
96d3616a53
fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427) 2023-03-01 11:35:16 +01:00
zeertzjq
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
zeertzjq
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
bfredl
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
bfredl
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
bfredl
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
bfredl
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
bfredl
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
zeertzjq
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
zeertzjq
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
zeertzjq
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
Justin M. Keyes
3b92776226
Merge #22382 has('gui_running') 2023-02-28 06:24:23 -05:00
Folke Lemaitre
7574d58304
fix(inspect): alwasy resolve full treesitter lang hl groups 2023-02-28 12:12:08 +01:00
zeertzjq
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
zeertzjq
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
zeertzjq
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