Commit Graph

19079 Commits

Author SHA1 Message Date
Björn Linse
9337fff8aa
Merge pull request #15852 from bfredl/afteragain
fix(runtime): fix ordering of "after" packages
2021-09-30 22:32:02 +02:00
Björn Linse
251ce9ddd1 fix(runtime): fix ordering of "after" packages
they must come after ordinary runtime dirs which are not "after"
2021-09-30 22:03:18 +02:00
dundargoc
7152353ade
ci: add type and scope from PR title as labels #15850
This only works if the label exists in the first place of course.
2021-09-30 08:08:36 -07:00
Jan Edmund Lazo
270cc1d70f
Merge pull request #14937 from dstein64/vim-8.1.2304
vim-patch:8.1.2304,8.1.2309,8.1.2319,8.1.2321
2021-09-29 20:59:53 -04:00
dundargoc
d90fb1c0bf
Refactor/uncrustify (#15790)
* refactor: format with uncrustify

* fixup(dundar): fix functions comments

* fixup(dundar): remove space between variable and ++/--

* fixup(dundar): better workaround for macro attributes

This is done to be able to better use uncrustify rules for macros

* fixup(justin): make preprocessors follow neovim style guide
2021-09-29 19:48:50 +02:00
Daniel Steinberg
88442c2fa6 docs: add 'plus one' to correct getmousepos docs
This change was applied to Vim as part of 90df4b9.
90df4b9d42
2021-09-29 11:13:49 -04:00
Daniel Steinberg
096309037b chore: remove empty line
This update was part of vim-patch:4c29502.
4c295027a4
The other parts of that patch were applied to Neovim in ad6bb38.
2021-09-29 11:13:49 -04:00
Daniel Steinberg
ae97f25e9d test: add a test for getmousepos() 2021-09-29 11:13:49 -04:00
Daniel Steinberg
c423ee584a vim-patch:8.1.2321: cannot select all text with the mouse
Problem: Cannot select all text with the mouse. (John Marriott)
Solution: Move limiting the mouse column to f_getmousepos().
          (closes https://github.com/vim/vim/issues/5242)
0a5aa7b28a
2021-09-29 11:13:49 -04:00
Daniel Steinberg
037ec8f208 vim-patch:8.1.2319: compiler warning for int size
Problem: Compiler warning for int size.
Solution: Add typecast. (Mike Williams)
07a63d8633
2021-09-29 11:13:49 -04:00
Daniel Steinberg
95bf86c2bf vim-patch:8.1.2309: compiler warning for argument type
Problem: Compiler warning for argument type.
Solution: Use linenr_T and cast to varnumber_T. (John Marriott)
abe12a1a4f
2021-09-29 11:13:49 -04:00
Daniel Steinberg
3b9e75b366 vim-patch:8.1.2304: cannot get the mouse position when getting a mouse click
Problem:    Cannot get the mouse position when getting a mouse click.
Solution:   Add getmousepos().
db3a205147
2021-09-29 11:13:49 -04:00
Mathias Fußenegger
ec4731d982
feat(lsp): add codeAction/resolve support (#15818)
Closes https://github.com/neovim/neovim/issues/15339 and https://github.com/neovim/neovim/issues/15828
2021-09-28 14:04:01 -07:00
Björn Linse
3507d58dfb
Merge pull request #15812 from bfredl/taba
fix(runtime): make a copy of runtime_search_path when iterating
2021-09-28 19:12:39 +02:00
Mathias Fußenegger
19a77cd5a7
feat(lsp): add client command support to codelens (#15820)
Also adds a check against the server capabilities to fix
https://github.com/neovim/neovim/issues/15183
2021-09-28 09:19:19 -07:00
Mathias Fußenegger
ff18a8bcc4
refactor(lsp): remove json encode/decode wrappers (#15826) 2021-09-28 09:13:44 -07:00
Mathias Fußenegger
9ca7b6b71a
fix(ui): s/format_entry/format_item to match docs (#15819)
Follow up to https://github.com/neovim/neovim/pull/15771
2021-09-27 16:12:03 -07:00
Mathias Fußenegger
63fde086d9
feat(ui): add vim.ui.select and use in code actions (#15771)
Continuation of https://github.com/neovim/neovim/pull/15202

A plugin like telescope could override it with a fancy implementation
and then users would get the telescope-ui within each plugin that
utilizes the vim.ui.select function.

There are some plugins which override the `textDocument/codeAction`
handler solely to provide a different UI. With custom client commands and
soon codeAction resolve support, it becomes more difficult to implement
the handler right - so having a dedicated way to override the picking
function will be useful.
2021-09-27 21:57:28 +02:00
Björn Linse
a0ec8597e3 fix(runtime): make a copy of runtime_search_path when iterating
This is to prevent concurrent modification, just like save_rtp
in the vim 8 implementation
2021-09-27 21:17:53 +02:00
dundargoc
6736ee8be5
chore: remove unused script finddeclarations.pl #15814 2021-09-27 09:02:42 -07:00
Michael Lingelbach
96614f84ab
fix(lsp): avoid serializing boolean as key (#15810)
In vim.lsp.buf.references, the key vim.type_idx (which evaluates to a
boolean) was set to equal vim.types.dictionary. This resulted in a
boolean key in json which is not allowed by the json spec, and which
lua-cjson fails to serialize.
2021-09-27 00:32:30 -07:00
Michael Lingelbach
bec7f47cee
docs: document dependencies in MAINTAIN.md #15801
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2021-09-26 17:24:20 -07:00
Gregory Anders
187e3a3b7e
refactor(diagnostic): use sign priority for severity_sort #15785
Rather than relying on the order in which signs are placed to dictate
the order in which they are displayed, explicitly set the priority of
the sign according to the severity of the diagnostic and the value of
severity_sort. If severity_sort is false or unset then all signs use the
same priority.
2021-09-26 16:02:18 -07:00
Michael Lingelbach
cb51a1b615
docs: add lua-cjson to third-party licenses #15800 2021-09-26 14:57:57 -07:00
Mathias Fußenegger
73280a7987
feat(lsp): allow subset of CodeActionContext as arg to code_action methods (#15793)
This makes it easier to filter the code actions. For example:

    vim.lsp.buf.code_action { only = 'refactor' }
2021-09-26 23:40:28 +02:00
Michael Lingelbach
c217766f7c
feat(lsp): use cjson for lsp rpc (#15759) 2021-09-26 22:53:04 +02:00
Michael Lingelbach
68c65b7732
Merge pull request #14871 from mjlbach/feature/lua-cjson-embedded
feat(lua): expose lua-cjson as vim.json
2021-09-26 12:23:46 -07:00
dundargoc
3246bf5f4e
ci(lintcommit.lua): replace third-party commitlint #15747 2021-09-26 12:13:59 -07:00
Michael Lingelbach
9c31f3b026 test: add tests for vim.json 2021-09-26 11:52:17 -07:00
Björn Linse
9686c21237
Merge pull request #15797 from smolck/ui-stuff
fix(ui_bridge): set bridge width and height on attach
2021-09-26 20:16:39 +02:00
smolck
08ee03cb16
fix(ui_bridge): set bridge width and height on attach 2021-09-26 11:00:40 -05:00
erw7
44145847dc
fix(tui): remove obsolete $NVIM detection #15791
Initially, we planned to set the NVIM environment variable to detect that
neovim is running in the neovim built-in terminal. At the time this code
was written, there was no way for a parent to set environment variables
for a program running in an embedded terminal. Later it was implemented in
 #12937, but the code to set the NVIM was not added. #11390 now uses ConPTY
instead of winpty when possible, so it is no longer necessary to force the
use of win32con even when running inside an embedded terminal. Therefore,
we now do not need this code.
2021-09-26 08:27:18 -07:00
Björn Linse
d4fa1649fb
Merge pull request #15351 from bfredl/virt_line
feat(screen): virtual lines
2021-09-26 16:56:19 +02:00
dundargoc
c273eb3100
refactor: replace sprintf with snprintf #15794 2021-09-26 07:53:51 -07:00
Björn Linse
68d6ff8802
Merge pull request #15721 from bfredl/electricboogalo
fix(runtime): some ordering issues (and start work on cache mechanism)
2021-09-26 16:20:23 +02:00
Björn Linse
ac3288d556 fix(runtime): ordering of loading packages with user config
site packages must be sourced before user config

NOTE: we only consider dirs exactly matching "after" to be an AFTER dir.
vim8 considers all dirs like "foo/bar_after", "Xafter" etc, as an
"after" dir in SOME codepaths not not in ALL codepaths.
2021-09-26 15:44:40 +02:00
Björn Linse
392c658d4d feat(decorations): support virtual lines (for now: only one block at a time) 2021-09-26 12:19:54 +02:00
Michael Lingelbach
30fed27241 feat(lua): expose lua-cjson as vim.json
* add vim.json.encode and vim.json.decode
* use vim.NIL instead of cjson.null
* resolve strict-prototypes warnings

* The following benchmark shows an approximately 2.5x (750 ms vs 300 ms) improvement in deserialization performance over
  vim.fn.json_decode on a medium package.json

  ```lua
  local uv = vim.loop
  local function readfile(path)
    return
  end

  local json_url = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/b24c8d5c89ee93d1172b4127564f5da3b0c88dad/editors/code/package.json"
  io.popen(string.format('curl -v -f -L -O %q &> /dev/null', json_url))

  local json_string = io.open('package.json'):read '*a'

  uv.update_time()
  local start = uv.hrtime()

  for i = 1,1000 do
    vim.fn.json_decode(json_string)
  end

  uv.update_time()
  print(string.format("Deserialization time vim.fn.json_decode: %s ms", (uv.hrtime() - start) * (1e-6)))

  uv.update_time()
  local start = uv.hrtime()

  for i = 1,1000 do
    vim.json.decode(json_string)
  end
  uv.update_time()
  print(string.format("Deserialization time vim.json.decode: %s ms", (uv.hrtime() - start) * (1e-6)))
  ```

Co-Authored-By: Björn Linse <bjorn.linse@gmail.com>
2021-09-26 00:35:55 -07:00
Michael Lingelbach
8decc9f52d feat(lua): add lua-cjson as vendored dependency
Derived from the openresty lua-cjson fork at commit 3d93d29709
2021-09-26 00:35:47 -07:00
Dundar Göc
b3b02eb529 docs(CONTRIBUTING.md): how to use uncrustify #15780
close #15780
2021-09-25 18:38:51 -07:00
gmntroll
8b0e6cc05d
fix(api): fix crash after set_option_value_for() #15390
Problem:
This crashes Nvim:
    tabedit
    call nvim_win_set_option(1000, 'statusline', 'status')
    split
    wincmd J
    wincmd j

Solution:
- Change `no_display` parameter value to be the same as in matching
  `restore_win_noblock` call. In case of different values `topframe`
  isn't restored to `curtab->tp_topframe`.
- Call `restore_win_noblock` if `switch_win_noblock` returns `FAIL`
  (`switch_win` must always have matching `restore_win`)
- Change `switch_win`/`restore_win` to `_noblock` versions to allow
  autocommands.

fixes #14097
fixes #13577
2021-09-25 17:48:06 -07:00
dundargoc
2f9b9e61d7
refactor: format with uncrustify #15778
* fixup: force exactly one whitespace between type and variable
2021-09-25 17:16:04 -07:00
James McCoy
05d685be52
Merge pull request #15776 from jamessan/macos-11-ci
Add macos-11 CI
2021-09-25 09:43:57 -04:00
Thomas Vigouroux
7cb34a341d
test(normal): CA_COMMAND_BUSY in visual select mode #15292
Fix was already applied in 5f144efefa #15688,
but this commit adds another dimension to the test.

Test correctly fails after reverting 5f144efefa.

ref #15288
2021-09-24 09:59:36 -07:00
James McCoy
64a5eddc89
ci: use runner, instead of os, for job name and cache key 2021-09-24 09:01:50 -04:00
James McCoy
e0cf32c6de
ci: add macOS 11 build 2021-09-24 09:01:30 -04:00
Justin M. Keyes
bc570b0064
Merge #15774 fix(pvs): fix warnings, script 2021-09-24 05:13:55 -07:00
Justin M. Keyes
55d1e630b4
Merge #15731 vim-patch:7.4.725,8.2.{0597,0598,0924,1035}
fixes #14581
2021-09-24 05:11:19 -07:00
dundargoc
7a26eb8a56
refactor: format with uncrustify #15755 2021-09-24 05:03:15 -07:00
Justin M. Keyes
03ed72642d fix(pvs): Exclude xdiff from analysis
ref 088161a945
ref fbe88ef8f5
2021-09-24 03:26:31 -07:00