Commit Graph

18993 Commits

Author SHA1 Message Date
Eisuke Kawashima
7014731035
build: enhance Makefile
- fix regression where `-j` is not passed to ninja
  (39c886551b, #15708)
- enable to pass `-l` (load) to ninja as well
- s/BUILD_TYPE/CMAKE_GENERATOR/
2021-09-21 15:54:14 +09:00
James McCoy
21f7555277
Merge pull request #15743 from jamessan/libuv-threads
build: Add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
2021-09-20 21:56:49 -04:00
James McCoy
2435cf77d1
build: add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
This is a workaround for not yet having fully correct Find* cmake
modules for static builds.

https://github.com/Tronic/cmake-modules/issues/3#issuecomment-624469020
2021-09-20 21:19:52 -04:00
Gregory Anders
0216aed20c
fix(diagnostic): clamp line numbers in display layer (#15729)
Some parts of LSP need to use cached diagnostics as sent from the LSP
server unmodified. Rather than fixing invalid line numbers when
diagnostics are first set, fix them when they are displayed to the user
(e.g. in show() or one of the get_next/get_prev family of functions).
2021-09-20 11:32:21 -07:00
dundargoc
f4ca3a29dd
refactor: reformat with uncrustify #15736
* fix function parameter comments
* remove space after star in function names
2021-09-20 09:35:41 -07:00
itchyny
1f8c91bf72
fix(inccommand): ignore trailing commands only for *previewed* command #15638
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.

fix #8796, update #7494
2021-09-20 07:33:10 -07:00
dundargoc
30fefee684
refactor: format with uncrustify #15726 2021-09-20 06:53:38 -07:00
Justin M. Keyes
490e09c6d8
Merge #15727 build(lint): check scripts/*.lua 2021-09-19 16:56:57 -07:00
Justin M. Keyes
41da72ffb6 build(lint): commit linter 2021-09-19 16:39:34 -07:00
Justin M. Keyes
736299bf22 build(lint): check scripts/*.lua 2021-09-19 16:36:08 -07:00
kylo252
39c886551b
refactor(Makefile): use built-in make commands #15708
Changes to the main Makefile:
- add `MAKEFILE_PATH` and `MAKEFILE_DIR` that are set with native commands
- add `NVIM_PRG`
- rename `BUILD_TYPE` to `CMAKE_GENERATOR` to align with CMake naming
- remove the misleading `BUILD_CMD` and use `BUILD_TOOL` instead

Add the following phony target to quickly test the changes

```make
debug-print:
	@echo makefile path: $(MAKEFILE_PATH)
	@echo makefile dir: $(MAKEFILE_DIR)
	@echo build dir: $(BUILD_DIR)
	@echo cmake generator tool: $(CMAKE_GENERATOR)
	@echo build-tool: $(BUILD_TOOL)
	@echo nvim-prg: $(NVIM_PRG)
```
2021-09-19 15:53:48 -07:00
Gregory Anders
e61ea7772e
feat(diagnostic): match(), tolist(), fromlist() #15704
* feat(diagnostic): add vim.diagnostic.match()
  Provide vim.diagnostic.match() to generate a diagnostic from a string and
  a Lua pattern.
* feat(diagnostic): add tolist() and fromlist()
2021-09-19 15:13:23 -07:00
dundargoc
853346a94d
refactor: format with uncrustify #15722 2021-09-19 13:07:42 -07:00
Justin M. Keyes
6565adcbff
build(lint): commit linter #15725
Example test failure:

    $ nvim -es +"lua require('scripts.lintcommit')._test()"
    [ FAIL ]: expected=true, got=false
        input: ":no type before colon 1"
    [ FAIL ]: expected=true, got=false
        input: "ci: tab after colon"

Example main({trace=true}) output:

    $ nvim -es +"lua require('scripts.lintcommit').main()"
    run: { "git", "branch", "--show-current" }
    run: { "git", "merge-base", "origin/master", "master" }
    run: { "git", "merge-base", "upstream/master", "master" }
    run: { "git", "rev-list", "89db07556dbdce97c0c150ed7e47d80e1ddacad3..master" }
    run: { "git", "show", "-s", "--format=%s", "d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc" }
    Invalid commit message: "buildlint): commit linter #15620"
        Commit: d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc
        Invalid commit type "buildlint)". Allowed types are:
        { "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "test", "chore", "vim-patch" }
        See also:
            https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages
            https://www.conventionalcommits.org/en/v1.0.0/
2021-09-19 12:57:57 -07:00
Jan Edmund Lazo
89db07556d
Merge pull request #15630 from zeertzjq/vim-8.2.3424
vim-patch:8.1.{1071,1078,1079,1110},8.2.{2640,3424,3425,3437}
2021-09-19 14:31:10 -04:00
Justin M. Keyes
2aa662568a build(lint): commit linter #15620 2021-09-19 11:06:47 -07:00
dundargoc
65572c719a
build(lint): commit linter #15620 2021-09-19 09:27:08 -07:00
Justin M. Keyes
2afbce7651
refactor(tests): remove redir_exec #15718
Problem
- `redir_exec` is obsolete, but it keeps getting used in new tests
  because people copy existing tests.
- Disadvantages of `redir_exec`:
  - Captures extra junk before the actual error/message that we _want_ to test.
  - Does not fail on error, unlike e.g. `command()`.

Solution
- Use new functions like `nvim_exec` and `pcall_err`.
2021-09-19 02:29:37 -07:00
zeertzjq
f4ce4c1677 vim-patch:8.2.3437: compiler warnings for 32/64 bit usage
Problem:    Compiler warnings for 32/64 bit usage.
Solution:   Add type casts. (Mike Williams, closes vim/vim#8870)
f5785cf059
2021-09-19 13:13:44 +08:00
zeertzjq
a348c666a3 vim-patch:8.2.3425: warning for using uninitialized variable
Problem:    Warning for using uninitialized variable.
Solution:   Initialize it. (John Marriott)
56e14698b4
2021-09-19 13:13:44 +08:00
zeertzjq
51567db4b6 vim-patch:8.2.3424: a sequence of spaces is hard to see in list mode
Problem:    A sequence of spaces is hard to see in list mode.
Solution:   Add the "multispace" option to 'listchars'. (closes vim/vim#8834)
f14b8ba137
2021-09-19 13:13:44 +08:00
zeertzjq
177e87525a vim-patch:8.2.2640: screenstring() returns non-existing composing characters
Problem:    screenstring() returns non-existing composing characters.
Solution:   Only use composing characters if there is a base character.
f1387285e2
2021-09-19 13:13:44 +08:00
zeertzjq
59e80c4dfc vim-patch:8.1.1110: composing chars on space wrong when 'listchars' is set
Problem:    Composing chars on space wrong when 'listchars' is set.
Solution:   Do not use "space" and "nbsp" entries of 'listchars' when there is
            a composing character.  (Yee Cheng Chin, closes vim/vim#4197)
e5e4e22c1c
2021-09-19 13:13:44 +08:00
zeertzjq
c14dc616bf vim-patch:8.1.1079: no need for a separate ScreenLinesUtf8() test function
Problem:    No need for a separate ScreenLinesUtf8() test function.
Solution:   Get the composing characters with ScreenLines().
48aed0824e
2021-09-19 13:13:44 +08:00
zeertzjq
32663b0f7e vim-patch:8.1.1078: when 'listchars' is set a composing char on a space is wrong
Problem:    When 'listchars' is set a composing char on a space is wrong.
Solution:   Separate handling a non-breaking space and a space. (Yasuhiro
            Matsumoto, closes vim/vim#4046)
5f8069bbf5
2021-09-19 13:13:44 +08:00
zeertzjq
963474321b vim-patch:8.1.1071: cannot get composing characters from the screen
Problem:    Cannot get composing characters from the screen.
Solution:   Add screenchars() and screenstring(). (partly by Ozaki Kiichi,
            closes vim/vim#4059)
2912abb3a2
2021-09-19 13:13:44 +08:00
Gregory Anders
924e8e4f2d
fix(diagnostic): only update decorations for loaded buffers (#15715)
When vim.diagnostic.config() is called, the decorations for diagnostics
are re-displayed to use the new configuration. This should only be done
for loaded buffers.
2021-09-18 14:01:03 -07:00
Justin M. Keyes
77399184d7
ci(labeler): diagnostic 2021-09-18 13:29:56 -07:00
hrsh7th
41cfba63cd
feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)
- Fix the cursor position after applying TextEdits
- Support reversed range of TextEdit
- Invoke nvim_buf_set_text one by one
2021-09-18 13:19:21 -07:00
Michael Lingelbach
340f77e78e
Merge pull request #15710 from gpanders/show_line_diagnostics
fix(diagnostic): resolve nil bufnr in show_line_diagnostics
2021-09-18 10:31:40 -07:00
Jaehwang Jerry Jung
de406f651c
vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)
Problem:    Filler lines are wrong when changing text in diff mode.
Solution:   Don't change the filler lines on every change.  Check
            scrollbinding when updating the filler lines. (closes vim/vim#8809)
04626c243c
2021-09-18 12:38:58 -04:00
dundargoc
51a98aa0c2
refactor: format #15702 2021-09-18 09:34:23 -07:00
Gregory Anders
752d2d2081 test: add test case for show_line_diagnostics 2021-09-18 10:07:54 -06:00
Gregory Anders
ef52433847 fix(diagnostic): resolve nil bufnr in show_line_diagnostics 2021-09-18 09:44:30 -06:00
Björn Linse
6cad86fffd
Merge pull request #15632 from bfredl/rtptest
runtime: always use DIP_START and remove duplication of start packages in &rtp
2021-09-18 17:14:25 +02:00
Björn Linse
a860f7880f refactor(runtime): handle pack/foo/start/bar/after dirs properly
The order should be:
XDG_CONFIG_HOME/nvim
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/
XDG_CONFIG_HOME/nvim/after
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/after
2021-09-18 13:59:19 +02:00
Björn Linse
396280d303 refactor(runtime): always use DIP_START when searching for runtime files
Now remove the addition of "start/*" packages in 'packpath' as
explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming
very long when using a lot of plugins as packages.

To get the effective search path as a list, use |nvim_list_runtime_paths()|
2021-09-18 13:53:50 +02:00
Mathias Fußenegger
8ef2b56cac
fix(diagnostic): change default severity_sort order 2021-09-18 13:21:54 +02:00
Gregory Anders
0dcf4ab27b fix(diagnostic): remove check on nil return value
vim.diagnostic._set_signs doesn't return anything, so checking the
return value will always fail.
2021-09-17 21:10:10 -06:00
Gregory Anders
445ef41314 refactor(diagnostic): combine config() and set() calls 2021-09-17 21:07:24 -06:00
Gregory Anders
15d501ff7a refactor(diagnostic): group local functions together 2021-09-17 21:07:24 -06:00
dundargoc
1f49268c46
refactor: convert TRUE/FALSE to true/false (#15660) 2021-09-18 00:24:39 +02:00
Gregory Anders
938ed458e2 fix(diagnostic): change default severity_sort order
When severity_sort is true, higher severities should be displayed before
lower severities (e.g. ERROR is displayed over WARN).

Also improved the test case for this.
2021-09-17 14:59:30 -06:00
Michael Lingelbach
ede5695eb1
Merge pull request #15696 from gpanders/diagnostic-sign-fix
Diagnostic hot fixes
2021-09-17 11:31:56 -07:00
ii14
4d7dcbe49f
fix(termdebug): replace mapset with nvim_set_keymap (#15699)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2021-09-17 19:29:27 +02:00
Oliver Marriott
d9f93e5642
fix(typo): overriden -> overridden (RE: PR #14159) (#15360) 2021-09-17 13:07:00 -04:00
Gregory Anders
32c0631183 fix(diagnostic): support severity_sort 2021-09-17 10:50:25 -06:00
Justin M. Keyes
d8de4eb685
test: reorg #15698
Problem:
Subdirectories like "visual", "insert", "normal" encourage people to
separate *related* tests for no good reason.  Typically the _mode_ is
not the relevant topic of a test (and when it is, _then_ create
an appropriate describe() or it()).

Solution:
- Delete the various `test/functional/<mode>/` subdirectories, move
  their tests to more meaningful topics.
- Rename `…/normal/` to `…/editor/`.
  - Move or merge `…/visual/*` and `…/insert/*` tests into here where
    appropriate.
- Rename `…/eval/` to `…/vimscript/`.
  - Move `…/viml/*` into here also.

* test(reorg): insert/* => editor/mode_insert_spec.lua
* test(reorg): cmdline/* => editor/mode_cmdline_spec.lua
* test(reorg): eval core tests => eval_spec.lua
2021-09-17 09:16:40 -07:00
Gregory Anders
f87779a24d fix(diagnostic): correctly handle folder level diagnostics 2021-09-17 09:28:11 -06:00
Gregory Anders
15fbc9b69e docs(diagnostics): fix typos 2021-09-17 08:57:51 -06:00