Commit Graph

18784 Commits

Author SHA1 Message Date
Justin M. Keyes
13748512f6
test(busted): disable colors in test-runner output #15610
Problem
-------

Because test/busted/outputHandlers/nvim.lua doesn't know if it's running
in a terminal (no "isatty" equivalent), it outputs color codes in CI
logs and local tooling that runs the tests in a pipe:

    [1m[ SKIPPED ] 

This is just noise, hard for humans to read.

Solution
--------

Disable the color codes. If we later find a clever way to detect
a terminal in nvim.lua, we might consider re-enabling colors, but that
would still affect the CI build logs...
2021-09-09 09:18:43 -07:00
Björn Linse
422198cde6
Merge pull request #15091 from yatli/mouse_drag_fix
fix #15075 (mouse crash in multigrid)
2021-09-09 17:37:59 +02:00
Justin M. Keyes
d8339be691
Merge #15460 feat(lua)!: register_keystroke_callback => on_key 2021-09-09 06:55:35 -07:00
Justin M. Keyes
9f3679cbfd docs: naming conventions 2021-09-09 06:28:11 -07:00
Justin M. Keyes
69fe427df4 feat(lua)!: register_keystroke_callback => on_key
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.

ref 3ccdbc570d #12536

BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
2021-09-09 06:09:33 -07:00
Sean Dewar
4eb1ebbcf7
fix(doc): various fixes #15604
In particular:
- jobwait: omitting {timeout} arg is the same as -1.
- sockconnect: omitting {opts} arg is the same as {}.
- jobsend: obsoleted by chansend; don't mention it in job_control.txt.
- menu_get: add to |functions| table.

[skip ci]
2021-09-09 00:37:59 -07:00
Christian Clason
ed0c747788
Merge pull request #15602 from clason/vim-8.2.3390
vim-patch:8.2.3390: included xdiff code is outdated

build: move src/nvim/xdiff to src/xdiff
2021-09-09 08:43:20 +02:00
Christian Clason
fbe88ef8f5 build: move src/nvim/xdiff to src/xdiff
Closes #11239
2021-09-08 22:34:54 +02:00
Christian Clason
69f4438d35 vim-patch:8.2.3390: included xdiff code is outdated
Problem:    Included xdiff code is outdated.
Solution:   Sync with xdiff in git 2.33. (Christian Brabandt, closes vim/vim#8431)
ba02e4720f
2021-09-08 22:33:20 +02:00
Zi How Poh
c1f573fbc9
feat(lsp): support textDocument/prepareRename (#15514) 2021-09-08 17:00:15 +02:00
Christian Clason
11289ad733
fix(termdebug): replace term_getline with getbufline #15598
Correct incomplete runtime file port in
79cbbd5179
2021-09-08 07:35:40 -07:00
Christian Clason
79cbbd5179
vim-patch:d2ea7cf10a4d #15571
Update runtime files
d2ea7cf10a

omit `runtime/doc/if_tcl.txt`
omit `runtime/doc/textprop.txt`
omit `runtime/tutor/*`
omit `runtime/syntax/vim.vim` (cherry-picked in 2dd7828511)

manual merge of `runtime/pack/dist/opt/termdebug/plugin/termdebug.vim`
2021-09-08 07:24:12 -07:00
Justin M. Keyes
5e5a329ea2
test: timeout at 20 minutes #15597
Set a maximum test run-time of 20 minutes to:
- fail faster
- avoid wasting CI resources
- set a bound on the test time (if tests take longer than 20 minutes we
  need to invest in parallelizing them...)

Timeout looks like:

    -- Tests exited non-zero: Process terminated due to timeout
    -- No output to stderr.
    CMake Error at /…/neovim/cmake/RunTests.cmake:86
    (message):
      functional tests failed with error: Process terminated due to timeout
2021-09-08 07:21:28 -07:00
Michael Lingelbach
384a43fe71
chore(lsp): fix formatting in vim.lsp.log (#15596) 2021-09-07 21:48:19 -07:00
Michael Lingelbach
257e8a7431
Merge pull request #15595 from mjlbach/feat/add-healthcheck-lsp
* feat(lsp): add lsp healthcheck

* feat(lsp): add warning message for large log size
2021-09-07 21:16:19 -07:00
Michael Lingelbach
e6777a7a04 feat(lsp): add warning message for large log size 2021-09-07 20:52:08 -07:00
Michael Lingelbach
e26802650d feat(lsp): add lsp healthcheck
Add healthcheck for language server client, currently only checks
logging status.
2021-09-07 20:51:40 -07:00
Björn Linse
47f99d6644
Merge pull request #15575 from dundargoc/refactor/uncrustify
refactor: format files with uncrustify
2021-09-07 22:18:46 +02:00
Yatao Li
28ac6c00e6 fix(multigrid): #15075 mouse events crash neovim 2021-09-08 01:57:40 +08:00
Dundar Göc
1e49a1c888 refactor: format files with uncrustify 2021-09-07 19:07:51 +02:00
Jit
db695cc4ca
fix(screen): missing search highlights when redrawing from timer #15380
* Revert "vim-patch:8.1.2294: cursor pos wrong with concealing and search causes a scroll"
* Add a test which covers #13074 910bbc3cca
  while reverting the screen.c code changes from there.

Fixes #14064
2021-09-06 15:18:33 -07:00
Mathias Fußenegger
687a0b3d3e
fix(lsp): adapt codelens resolve to handler signature change (#15578)
Follow up to https://github.com/neovim/neovim/pull/15504
2021-09-06 17:30:53 +02:00
Jose Alvarez
3f526feebf
fix(lsp): update workspace/applyEdit handler signature (#15573) 2021-09-05 12:48:54 -07:00
Michael Lingelbach
23fe6dba13
Merge pull request #15504 from mjlbach/feat/change-handler-signature
feat(lsp)!: change handler signature
2021-09-05 10:27:52 -07:00
Michael Lingelbach
f7dabbc115 docs: regenerate 2021-09-05 10:05:38 -07:00
Michael Lingelbach
df17d7844e feat(lsp)!: change handler signature
Previously, the handler signature was:

  function(err, method, params, client_id, bufnr, config)

In order to better support external plugins that wish to extend the
protocol, there is other information which would be advantageous to
forward to the client, such as the original params of the request that
generated the callback.

In order to do this, we would need to break symmetry of the handlers, to
add an additional "params" as the 7th argument.

Instead, this PR changes the signature of the handlers to:

  function(err, result, ctx, config)

where ctx (the context) includes params, client_id, and bufnr. This also leaves
flexibility for future use-cases.

BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring
updating handler calls
2021-09-05 10:04:30 -07:00
Björn Linse
7a0468e7ad
Merge pull request #15569 from bfredl/end_fill
refactor(screen): let win_line() always handle fillers after last line
2021-09-05 17:45:46 +02:00
Ben Noordhuis
c9c9422af0
build: fix fpclassify -Wfloat-conversion warning #15570
Work around a glibc bug where it truncates the argument to fpclassify()
from double to float by implementing fpclassify() ourselves.

Correctness test (Note that the FP_SUBNORMAL test depends on an atof() that
knows how to parse subnormals. Glibc does, not sure about other libcs.):

    #include <math.h>
    #include <stdint.h>
    #include <string.h>

    int xfpclassify(double d)
    {
      uint64_t m;
      int e;

      memcpy(&m, &d, sizeof(m));
      e = 0x7ff & (m >> 52);
      m = 0xfffffffffffffULL & m;

      switch (e) {
        default: return FP_NORMAL;
        case 0x000: return m ? FP_SUBNORMAL : FP_ZERO;
        case 0x7ff: return m ? FP_NAN : FP_INFINITE;
      }
    }

    #include <assert.h>
    #include <stdlib.h>

    int main(void)
    {
      assert(FP_ZERO == xfpclassify(atof("0.0")));
      assert(FP_ZERO == xfpclassify(atof("-0.0")));
      assert(FP_NORMAL == xfpclassify(atof("1.0")));
      assert(FP_NORMAL == xfpclassify(atof("-1.0")));
      assert(FP_INFINITE == xfpclassify(atof("inf")));
      assert(FP_INFINITE == xfpclassify(atof("-inf")));
      assert(FP_NAN == xfpclassify(atof("nan")));
      assert(FP_NAN == xfpclassify(atof("-nan")));
      assert(FP_SUBNORMAL == xfpclassify(atof("1.8011670033376514e-308")));
      return 0;
    }
2021-09-05 07:37:25 -07:00
Björn Linse
274248c354 refactor(screen): let win_line() always handle fillers after last line 2021-09-05 11:22:45 +02:00
Izhak Jakov
dce50312e1
vim-patch:90df4b9 (#15494)
Add JSONC runtime files

Co-authored-by: Izhak Jakov <izhakjakov>
2021-09-04 19:49:17 +02:00
Björn Linse
6117877823
Merge pull request #15563 from dundargoc/refactor/uncrustify
refactor: update uncrustify config and format screen.c
2021-09-04 09:39:30 +02:00
Dundar Göc
15af08ad17 refactor: update uncrustify config and format screen.c
Also set new option cmt_trailing_single_line_c_to_cpp to true. It
converts trailing, single-line c-comments (/**/) into cpp-comments (//).
2021-09-03 21:23:23 +02:00
Justin M. Keyes
5f8518b3f0
fix(defaults): "syntax sync maxlines=1" on CmdwinEnter #15552
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.

ref #15401 622a36b1f1
2021-09-02 10:29:59 -07:00
Gregory Anders
622a36b1f1
feat(defaults): limit syntax cost on CmdwinEnter #15401
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.

ref #6289 #6399
2021-09-02 04:17:04 -07:00
Justin M. Keyes
6751d6254b
refactor(tests): use assert_alive() #15546 2021-09-01 09:42:53 -07:00
Justin M. Keyes
0603eba6e7
feat(api): nvim_get_chan_info: include "argv" for jobs #15537
ref #15440
2021-09-01 07:29:38 -07:00
Mathias Fußenegger
5c643dee7b
docs(lsp): remove private lsp.diagnostic functions from docs (#15541)
Both `apply_to_diagnostic_items` and `show_diagnostics` are local
functions and cannot be called by users.
2021-09-01 14:28:15 +02:00
Mathias Fußenegger
684550ff38
docs(lsp): document codelens.get bufnr parameter (#15540)
Alternative to https://github.com/neovim/neovim/pull/15224
2021-09-01 13:29:11 +02:00
Justin M. Keyes
284199bc4b
Merge #15402 fix(terminal): close without ! if the job is stopped 2021-08-31 07:24:25 -07:00
Gregory Anders
3c081d0280 fix(jobwait): always drain process event queues #15402
Problem:
jobwait() returns early if the job was stopped, but the job might have
pending callbacks on its event queue which are required to complete its
teardown. State such as term->closed might not be updated yet (by the
pending callbacks), so codepaths such as :bdelete think the job is still
running.

Solution:
Always flush the job's event queue before returning from jobwait().

ref #15349
2021-08-31 06:53:06 -07:00
Gregory Anders
55defa1a41 fix(terminal): close without ! if the job is stopped
- If the terminal job is still running then ! is still required.

Closes #4683
2021-08-31 06:46:56 -07:00
Björn Linse
9695691ee4
Merge pull request #15526 from bfredl/f_meta
fix(lua): make core vim module not dependent on $VIMRUNTIME modules
2021-08-30 18:09:53 +02:00
Björn Linse
6f2d0ea311 fix(lua): make core vim module not dependent on $VIMRUNTIME functions
fixes #15524

Note: this is obviously a quickfix. A scalabe solution will
involve being able to specify a _list_ of modules to be
put into packages.preload, without needing to manually copypasta
a blurb of C code. Perhaps even involving bytecode for
static builds (to speedup initialization)
2021-08-30 17:31:44 +02:00
Oliver Marriott
c52ec8f9eb
fix(tutor): formatting, layout #15098
* fix(tutor): adjust over-80ch lines and corresponding expect file
* fix(tutor): standardise indentation and formatting, add nowrap modeline

- unifies the formatting/layout, which was a bit inconsistent,
- adds a nowrap modeline

Since the tutor uses a lot of conceals, which are included in the character
count when calculating line wrapping, lines were breaking at what looked like
odd spots, which gives a poor first impression and lowered readability.

I have adjusted some lines to be over 80ch in the source, but once they're
rendered out with conceals, they're actually under 80, so even with nowrap we
don't visually extend past 80.

fix #15088
2021-08-30 05:27:35 -07:00
Jose Alvarez
325fad8983
fix(lsp): resolve bufnr in buf_is_attached (#15523) 2021-08-30 07:46:00 -04:00
Matthieu Coudron
3ab73ff81f
chore(flake): fix for recent nixpkgs (#15520)
https://github.com/NixOS/nixpkgs/pull/134463 made keepDebugInfo obsolete
for generic packages.
This copies what keepDebugInfo used to do.
2021-08-30 11:55:02 +02:00
Thomas Vigouroux
215c9b5792
Merge pull request #15498 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-08-30 09:47:39 +02:00
Xiao
b35de6c525
vim-patch:8.2.2938: after using motion force from feedkeys() it sticks (#15240)
Problem:    After using motion force from feedkeys() it may not be reset.
Solution:   Clear motion_force in clearop(). (closes vim/vim#8323)
21492743e8
2021-08-29 17:08:39 -04:00
marvim
119b4daced docs: regenerate 2021-08-29 15:34:51 +00:00
Björn Linse
4e66e74fd7
Merge pull request #15304 from bfredl/quantumtheory
fix(lua): preserve argument list ... which has not the same length as #{...}
2021-08-29 17:34:00 +02:00