Commit Graph

18333 Commits

Author SHA1 Message Date
Christian Clason
7e8a8482e8 fixup(ts): put ts_query_cursor_set_match_limit behind feature guard
This is a fixup for #14915, which used the above-mentioned call to
restore the behavior of the pre-release version of tree-sitter to
that of 0.19.5. However, this function was introduced after 0.19.5,
breaking distro builds that link against 0.19.5 instead of the tag
specified in neovim's build script.

Now the function should only be called when it is available _and_
needed. Once tree-sitter is bumped to 0.19.6 (when this is released),
this guard can be removed again.

Fixes #14923 (among others)
2021-06-29 17:15:12 +02:00
Daniel Steinberg
f83c25942d
fix(doc/api): Remove 'border' as unsupported (#14916)
PR #13998 added support for floating window borders.
2021-06-28 20:40:56 -04:00
Daniel Steinberg
99a4152a4b
fix: Remove [RFC] from PR subject in vim-patch.sh (#14917)
As of PR #10383, CONTRIBUTING.md says '[RFC] is assumed by default'. As
of PR #11656, CONTRIBUTING.md says '**do not** put "RFC" in the PR
title'.
2021-06-28 20:40:00 -04:00
Matthieu Coudron
3552916cb9
fix(doc): remove reference to vim.lsp.callbacks (#14576)
too old now, can be confusing
2021-06-28 23:02:17 +02:00
Björn Linse
c81cbad444
Merge pull request #14920 from otherJL0/master
Adding clangd language server config file
2021-06-28 18:20:33 +02:00
otherJL0
5777fc1b8e Adding clangd language serever config file to point to build/ directory for compile_commands.json 2021-06-28 11:03:09 -04:00
Björn Linse
785dcff909
Merge pull request #14915 from clason/ts-match-limit
fix(treesitter): set match limit for query cursors
2021-06-28 16:28:52 +02:00
John Gehrig
5aaa1a1c04
[RDY] Add buffer information to tabline_update (#12481)
* Add buffer information to tabline_update

Most terminal implementations of the tabline display buffer and tab
information. Many neovim-qt users disable GuiTabline because it lacks
functionality provided in the terminal implementation.

The tabline_update event should include buffer information too, so client GUIs
can display rich useful tabs.
2021-06-27 15:30:09 -04:00
jimman2003
bdf3df4027
Fixed +1 -1 in util.lua (#14913)
No point in adding and then subtracting I believe ;)
2021-06-26 13:43:18 -04:00
Jan Edmund Lazo
bb4fc69e93
Merge pull request #14914 from janlazo/vim-8.2.3050
vim-patch:8.2.{2954,3049,3050}
2021-06-26 13:42:38 -04:00
Christian Clason
18354ca4a7 fix(treesitter): set match limit for query cursors
Upstream tree-sitter raised the number of pending matches for a query cursor
from 32 to 64k in <https://github.com/tree-sitter/tree-sitter/commit/
78010722a49ed6224c773c22b0d25a8c9fbde584>, which severely impacted performance
for some highlighting queries. This uses the `ts_query_cursor_set_match_limit`
function introduced in <https://github.com/tree-sitter/tree-sitter/commit/
cd96552448a6e0d4eb27fc54b27cb5130c4b6f76> to manually set this back to the old
default of 32.

Fixes #14897
2021-06-26 18:11:38 +02:00
Jan Edmund Lazo
7a239a8a9a
vim-patch:8.2.2954: short file name extension for Scala not recognized
Problem:    Short file name extension for Scala not recognized.
Solution:   Recognize *.sc. (closes vim/vim#8337)
6db7b6375a
2021-06-26 11:43:35 -04:00
Jan Edmund Lazo
eb7e7ad882
vim-patch:8.2.3049: JSON patch file not recognized
Problem:    JSON patch file not recognized.
Solution:   Recognize json-patch as json. (Kevin Locke, closes vim/vim#8450)
6582e230a0
2021-06-26 11:37:57 -04:00
Jan Edmund Lazo
750ad18845
vim-patch:8.2.3050: cannot recognize elixir files
Problem:    Cannot recognize elixir files.
Solution:   Recognize Elixir-specific files.  Check if an .ex file is Euphoria
            or Elixir. (Austin Gatlin, closes vim/vim#8401, closes vim/vim#8446)
f3caeb63d6
2021-06-26 10:51:29 -04:00
Yorick Peterse
5c0b01fd88
vim-patch:8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers (#14865)
Problem:    Formatting using quickfixtextfunc is lost when updating location
            lists for different buffers.  (Yorick Peterse)
Solution:   Use the right window for the locaiton list. (Yegappan Lakshmanan,
            closes vim/vim#8400, closes vim/vim#8403)
ad52f96a2d
2021-06-26 10:44:05 -04:00
Jan Edmund Lazo
20dc3f1989
vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)
Problem:    Can modify a:000 when using a reference.
Solution:   Make check for locked variable stricter. (Ozaki Kiichi,
            closes vim/vim#3930)
05c00c038b
2021-06-26 10:19:09 -04:00
Ghjuvan Lacambre
ad9c2c069a
Fix <afile> getting prepended with a slash on WinClosed (#14515)
It is wrong to assume that you can't shorten a path if it's in `/`: you
can always shorten it by removing the forward slash.

Closes #14512
2021-06-26 10:18:36 -04:00
Sean Dewar
c1120ad0e1
fix(doc/usr_41): don't mention 0o prefix for octs (#14906)
v8.2.0886 isn't ported yet.
Also remove mentions of Vim9 and legacy script for now.

[skip ci]
2021-06-25 20:10:58 -04:00
Folke Lemaitre
e680d7d6af
fix(lsp): render the last line in stylize_markdown 2021-06-25 11:45:42 -07:00
Michael Lingelbach
3b44b21894
Merge pull request #14910 from folke/lsp_fences_docs
style(lsp): make get_markdown_fences private
2021-06-25 11:04:44 -07:00
Ghjuvan Lacambre
b86b410a92
Update busy_start/busy_stop ui events documentation (#14415)
Closes #14386
2021-06-25 13:01:57 -04:00
Folke Lemaitre
28dde1038f
style(lsp): make get_markdown_fences private 2021-06-25 18:32:00 +02:00
Michael Lingelbach
5d792701cf
Merge pull request #14904 from mfussenegger/nil-message-callbacks
fix(lsp): Handle nil message_callbacks
2021-06-25 09:13:01 -07:00
Michael Lingelbach
7b5a233d64
Merge pull request #14617 from folke/fancy_markdown_fences_support
feat(lsp): use `g:markdown_fenced_languages` in `vim.lsp.util.stylized_markdown`
2021-06-25 09:02:28 -07:00
Michael Lingelbach
22c27c0fb4
Merge pull request #14903 from mfussenegger/add-workspace-folder
fix(lsp): Set `dir` completion option for add_workspace_folder
2021-06-25 08:29:57 -07:00
Folke Lemaitre
aa1e20497a
feat(lsp): use markdown_fenced_languages in stylized_markdown 2021-06-25 17:27:38 +02:00
Michael Lingelbach
bbd13aadd7
Merge pull request #14907 from folke/lsp_markdown
fix(lsp): syntax improvements for lsp_markdown
2021-06-25 08:22:54 -07:00
Folke Lemaitre
08f81f0f29
fix(lsp): syntax improvements for lsp_markdown 2021-06-25 17:01:06 +02:00
Mathias Fussenegger
58473178ff fix(lsp): Handle nil message_callbacks
The `onexit` handler could set `message_callbacks` to `nil` within the
luv event loop while the mainloop runs a function that tries to access
`message_callbacks`.

This adds some checks to prevent errors in that case.

Fixes https://github.com/neovim/neovim/issues/14863
2021-06-25 14:45:17 +02:00
Mathias Fussenegger
7ea652e4bf fix(lsp): Set dir completion option for add_workspace_folder
Given that the input is pre-filled with a path, it should be possible to
use dir completion.
2021-06-25 14:28:17 +02:00
Jan Edmund Lazo
510ed996d2
Merge pull request #14886 from janlazo/vim-8.1.1437
vim-patch:8.1.{1437,2391},8.2.{1255,2185,2294,3033,3034,3037,3038,3043}
2021-06-24 19:36:21 -04:00
Michael Lingelbach
1e2fc1f9cd
Merge pull request #14584 from akinsho/bugfix/vim-nil-conversion-logic
[RDY] fix(lsp): do not convert vim.NIL to nil in lists
2021-06-24 13:23:28 -07:00
Akin Sowemimo
444f175335 fix(lsp): do not convert vim.NIL to nil in lists 2021-06-24 11:23:19 +01:00
Jan Edmund Lazo
9081cd30a5
vim-patch:8.2.3033: no error when using alpha delimiter with :global
Problem:    No error when using alpha delimiter with :global.
Solution:   Check the delimiter like with :substitute. (closes vim/vim#8415)
419a40ac96

N/A patches for version.c:

vim-patch:8.1.2391: cannot build when __QNXNTO__ is defined

Problem:    Cannot build when __QNXNTO__ is defined. (Ian Wayne Larson)
Solution:   Move the check for "qansi". (Ken Takata, closes vim/vim#5317)
c95e8d6490

vim-patch:8.2.2294: VMS: a few remaining problems

Problem:    VMS: a few remaining problems.
Solution:   Add VMS specific changes. Add Lua support. (Zoltan Arpadffy)
82c38fe508

vim-patch:8.2.3034: installing packages on github CI sometimes fails

Problem:    Installing packages on github CI sometimes fails.
Solution:   Update package information first. (Christian Brabandt,
            closes vim/vim#8432)
ef7be8348f

vim-patch:8.2.3037: configure reports libcanberra when checking for libsodium

Problem:    Configure reports libcanberra when checking for libsodium.
Solution:   Adjust the message. (Ozaki Kiichi, closes vim/vim#8435)
8ce3ca8961

vim-patch:8.2.3038: Amiga built-in version string doesn't include build date

Problem:    Amiga built-in version string doesn't include build date.
Solution:   Add the build date if available. (Ola Söder, closes vim/vim#8437)
cc65040986

vim-patch:8.2.3043: Amiga: cannot get the shell size on MorphOS and AROS

Problem:    Amiga: cannot get the shell size on MorphOS and AROS.
Solution:   Use control sequences. (Ola Söder, closes vim/vim#8438)
d415d26913
2021-06-23 23:27:01 -04:00
Jan Edmund Lazo
cd4b649136
vim-patch:8.2.2185: BufUnload is not triggered for the quickfix dummy buffer
Problem:    BufUnload is not triggered for the quickfix dummy buffer.
Solution:   Do trigger BufUnload. (Pontus Leitzler,closes vim/vim#7518, closes vim/vim#7517)
            Fix white space around "=".
1cfb9bb5c0
2021-06-23 23:16:20 -04:00
Jan Edmund Lazo
4cb0bf0942
vim-patch:8.2.1255: cannot use a lambda with quickfix functions
Problem:    Cannot use a lambda with quickfix functions.
Solution:   Add support for lambda. (Yegappan Lakshmanan, closes vim/vim#6499)
d43906d2e5
2021-06-23 23:16:20 -04:00
Jan Edmund Lazo
d5329c0331
vim-patch:8.1.1437: code to handle callbacks is duplicated
Problem:    Code to handle callbacks is duplicated.
Solution:   Add callback_T and functions to deal with it.
3a97bb3f0f

Port Vim's put_callback() as callback_put()
because Neovim's naming convention is {type}_{action},
not {action}_{type}.

Renaming put_callback type as PutCallback.
https://neovim.io/develop/style-guide.xml#Type_Names
2021-06-23 23:16:20 -04:00
Björn Linse
24e0c16fd6
Merge pull request #14868 from shadmansaleh/patch_verbose_for_lua
fix(runtime): Fix bugs regarding lua runtime files
2021-06-23 20:34:57 +02:00
smolck
0d7e33bc13
docs(starting): mention init.lua in paths and remove repetition (#14883) 2021-06-23 09:36:03 +02:00
Michael Lingelbach
5a24284b8d
Merge pull request #14878 from mjlbach/fix/lsp-quickfix-focus 2021-06-22 11:45:04 -07:00
Björn Linse
b601f2548c
Merge pull request #14719 from snezhniylis/marktree_delete_node_iter_fix
Fix deletable nodes in MarkTree sometimes getting skipped
2021-06-22 13:48:22 +02:00
Matthieu Coudron
9a39a11807 fixup! vim-patch:8.2.3020: unreachable code (#14866) 2021-06-22 10:35:36 +02:00
snezhniylis
43479f0ad6 extmark: fix deletable nodes in MarkTree sometimes getting skipped
As per #14236, performing extmark cleanup in a certain namespace does
not guarantee removing all the extmarks inside given namespace.
The issue resides within the tree node removal method and results in
a couple of rare edge cases.

To demonstrate what causes this bug, I'll give an example covering one
of the edge cases.

=== AN EXAMPLE ===

   (A)         (B)         (C)         (D)         (E)
---------   ---------   ---------   ---------   ---------
  <0, 1>      <0, 1>      <0, 1>      <0, 1>      <0, 1>
  <0, 2>      <0, 2>      <0, 2>      <0, 2>      <0, 2>
  <0, 3>      <0, 3>      <0, 3>      <0, 3>      <0, 3>
  <0, 4>      <0, 4>      <0, 4>      <0, 4>      <0, 4>
  <0, 5>      <0, 5>      <0, 5>      <0, 5>      <0, 5>
  <0, 6>      <0, 6>      <0, 6>      <0, 6>      <0, 6>
  <0, 7>      <0, 7>      <0, 7>      <0, 7>      <0, 7>
  <0, 8>      <0, 8>      <0, 8>      <0, 8>      <0, 8>
  <0, 9>      <0, 9> *           *    <0, 9>  *   <0, 9>
[0, 10] *   [0, 10]     <0, 9>        [0, 11]     [0, 11]
  [0, 11]     [0, 11]     [0, 11]     [0, 12]     [0, 12]  *
  [0, 12]     [0, 12]     [0, 12]     [0, 13]     [0, 13]
  [0, 13]     [0, 13]     [0, 13]     [0, 14]     [0, 14]
  [0, 14]     [0, 14]     [0, 14]     [0, 15]     [0, 15]
  [0, 15]     [0, 15]     [0, 15]     [0, 16]     [0, 16]
  [0, 16]     [0, 16]     [0, 16]     [0, 17]     [0, 17]
  [0, 17]     [0, 17]     [0, 17]     [0, 18]     [0, 18]
  [0, 18]     [0, 18]     [0, 18]     [0, 19]     [0, 19]
  [0, 19]     [0, 19]     [0, 19]   [0, 20]     [0, 20]
[0, 20]     [0, 20]     [0, 20]

DIAGRAM EXPLANATION

* Every column is a state of the marktree at a certain stage.

* To make it simple, I don't draw the whole tree. What you see are
   2 leftmost parent nodes ([0, 10], [0, 20]) and their children placed
   in order `MarkTreeIter` would iterate through. From top to bottom.

* Numbers on this diagram represent extmark coordinates. Relative
   positioning and actual mark IDs used by the marktree are avoided
   for simplicity.

* 2 types of brackets around coordinates represent 2 different
   extmark namespaces (`ns_id`s).

* '*' shows iterator position.

ACTUAL EXPLANATION

Let's assume, we have two sets of extmarks from 2 different plugins:
  * Plugin1: <0, 1-9>
  * Plugin2: [0, 10-20]

1. Plugin2 calls
    `vim.api.nvim_buf_clear_namespace(buf_handle, ns_id, 0, -1)`
    to clear all its extmarks which results in `extmark_clear` call.

2. The iteration process goes on ignoring extmarks with irrelevant
    `ns_id` from Plugin1, until it reaches [0, 10], entering state (A).

3. At the end of cleaning up process, `marktree_del_itr` gets called.
    This function is supposed to remove given node and, if necessary,
    restructure the tree. Also, move the iterator to the next node.
    The bug occurs in this function.

4. The iterator goes backwards to the node's last child, to put it
    in the place of its deleted parent later. (B)

5. The parent node is deleted and replaced with its child node. (C)

6. Since now this node has 8 children, which is less than
    `MT_BRANCH_FACTOR - 1`, it get's merged with the next node. (D)

7. Finally, since at (B) the iterator went backward, it goes forward
    twice, skipping [0, 11] node, causing this extmark to persist,
    causing the bug. (E)

ANALYSIS AND SOLUTION

The algorithm works perfectly when the parent node gets replaced by
its child, but no merging occurs. I.e. the exact same diagram,
but without the (D) stage. If not for (D), it would iterate to <0, 9>
and then to [0, 11]. So, iterating twice makes sense. The actual problem
is in (C) stage, because the iterator index isn't adjusted and still
pointing to no longer existent node. So my solution is to adjust
iterator index after removing the child node.

More info: https://github.com/neovim/neovim/pull/14719
2021-06-22 10:32:46 +02:00
Michael Lingelbach
060255253f fix(lsp): handlers should focus quickfix list 2021-06-21 20:44:37 -07:00
shadmansaleh
b4ac878026 fix(source): Source giving E484 & parsing error at line 1 for lua files
It's happening because do_source is only expected to return FAIL when it
was unable to open file . But `nlua_exec_file` returns fail for parsing
and execution error too . Those errors are emitted through `nlua_error`.

So now return value of nlua_exec_file is ignored like do_cmdline. It now
only returns fail when it was unable to open file that check is done
before calling nlua_exec_file or do_cmdline. Errors in nlua_exec_file
are still directly emitted through nlua_error like before.
2021-06-21 13:07:05 +06:00
shadmansaleh
b4a216f7ed BugFix: Fix inconsistent verbose message
When a keymap is set from lua currently verbose message says
it's set from line 1. That's incorrect because we don't really know when
it was set. So until proper :verbose support isn't added for sourceing
lua it shouldn't say where it was set at.
2021-06-21 07:14:37 +06:00
jimman2003
b585f723bc
vim-patch:8.2.3020: unreachable code (#14866)
Problem:    Unreachable code.
Solution:   Remove the code. (closes vim/vim#8406)
2fb7495686
2021-06-20 14:20:43 -04:00
Jan Edmund Lazo
997a9c8792
Merge pull request #14849 from seandewar/demethod-curwin
fix(doc): various fixes
2021-06-19 20:18:30 -04:00
Michael Lingelbach
c16afaa1f8
Merge pull request #14851 from ckipp01/hlCodeLens 2021-06-19 15:44:48 -07:00
ckipp01
90bdb6e74d Add hl group docs for codelenses 2021-06-20 00:16:37 +02:00