Commit Graph

24380 Commits

Author SHA1 Message Date
bfredl
bb7033a033 fix(rpc): don't free args on error in rpc_send_event
fixup #21631
fixes #21690
2023-01-09 13:59:35 +01:00
bfredl
fc2cd28547
Merge pull request #21702 from glepnir/fix_2
fix(api): convert title_pos string in nvim_win_get_config
2023-01-09 12:33:08 +01:00
bfredl
df60ac9767
Merge pull request #21675 from bfredl/nonstdio
fix(embed): handle stdio in server properly
2023-01-09 12:28:10 +01:00
bfredl
1d16bba4d8 fix(embed): handle stdio in server properly
Rename stdin/stdout in the server, so that RPC data won't get corrupted.
This also restores the use of stderr to write directly to the terminal.
2023-01-09 11:17:11 +01:00
zeertzjq
d64549bc4e
Merge pull request #21488 from dundargoc/refactor/char_u/16.1
refactor/char u/16.1
2023-01-09 17:37:21 +08:00
zeertzjq
7ba39b4378 test: add more tests for Unicode 2023-01-09 17:11:39 +08:00
dundargoc
08c2c74806 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2023-01-09 17:03:40 +08:00
zeertzjq
53adccb6e0
test(tui_spec): doesn't use Unicode in cursor_address test (#21703)
Using Unicode makes the test flaky because of #16245.
2023-01-09 17:02:45 +08:00
Raphael
3a8be82175 fix: use enum type 2023-01-09 17:00:32 +08:00
Raphael
ad34ab38db fix: format 2023-01-09 14:22:10 +08:00
Raphael
e351ab179b fix(ui): add test case 2023-01-09 14:17:32 +08:00
Raphael
1f18c27404 fix(ui): convert title_pos string in nvim_win_get_config 2023-01-09 13:57:46 +08:00
zeertzjq
c19bd47c0a
test(tui_spec): improve cursor_address test (#21700) 2023-01-09 12:20:50 +08:00
zeertzjq
a174f4e53f
vim-patch:9.0.1158: code is indented more than necessary (#21697)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11787)

7f8b2559a3

Omit reset_last_used_map(): only used in Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-09 07:16:36 +08:00
TJ DeVries
904c13e6b5
dist: transpile cfilter.vim => cfilter.lua #21662
Vim has changed cfilter.vim from vimscript to vim9script.
Nvim supports only vimscript, not vim9script.
2023-01-08 12:31:38 -08:00
dundargoc
266a1c61b9
Merge pull request #21678 from dundargoc/build/remove-old-workarounds
build: remove old cmake workarounds that aren't necessary anymore
2023-01-08 11:01:24 +01:00
dundargoc
50687e60ae build: remove workaround for ancient clang versions
We don't need to support this as it's only required when using
AddressSanitizer, meaning it only affects developers.
2023-01-08 11:00:16 +01:00
dundargoc
623dad1a2c build: remove workaround for old luajit versions
Luajit version 2.1.0-beta3 was released 2017, there's no reason to use
such an old version on macOS. Also, the version check doesn't work
anymore as LUAJIT_VERSION seems to not be defined anywhere.
2023-01-08 10:58:51 +01:00
Mathias Fußenegger
d1b3611f03
feat(lsp): show active clients in :checkhealth vim.lsp (#21670)
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`
2023-01-08 09:23:08 +01:00
jdrouhard
0b136a14dc
fix(lsp): partially revert semantic token gravity change from #21574 (#21680) 2023-01-08 07:43:15 +01:00
dundargoc
d89290b453
ci(news): checkout to HEAD commit instead of merge commit (#21679)
The default merge branch is unreliable when trying to determine number
of commits in a PR. Using the HEAD branch of the PR removes this
ambiguity.
2023-01-07 16:51:52 +01:00
Gregory Anders
f601c4b1ca
fix(editorconfig): do not highlight unknown properties as errors (#21673)
Other plugins may define their own custom properties outside of Neovim's
builtin EditorConfig support. Instead of highlighting these unknown
properties as errors, do not highlight them at all.

This still differentiates between known and unknown properties, which
helps to catch typos or mistakes, but does not use the garish "error"
highlight that signals something is wrong.
2023-01-07 08:20:55 -07:00
Gregory Anders
3636338449
Merge pull request #21649 from gpanders/editorconfig-enable
feat(editorconfig): allow editorconfig to be toggled dynamically
2023-01-07 08:20:37 -07:00
Gregory Anders
6ffa434f0b refactor(editorconfig)!: change editorconfig_enable to editorconfig 2023-01-07 08:19:37 -07:00
Gregory Anders
34d1eaa792 feat(editorconfig): allow editorconfig to be toggled dynamically
Rather than only check `editorconfig_enable` when the plugin is loaded,
check it each time the autocommand fires, so that users may enable or
disable it dynamically.

Also check for a buffer local version of the variable, so that
editorconfig can be enabled or disabled per-buffer.
2023-01-07 08:19:12 -07:00
Justin M. Keyes
42afa0369a
Merge #21663 lua: "nvim -l" scriptname in _G.arg[0] 2023-01-06 22:07:34 -05:00
Justin M. Keyes
e17430c1cd feat(lua): store "nvim -l" scriptname in _G.arg[0] 2023-01-07 03:03:38 +01:00
Justin M. Keyes
7fc5d6ea50 refactor: eliminate bump-deps.sh using "nvim -l" 2023-01-07 02:47:18 +01:00
Justin M. Keyes
b741788a3a lint: bump_deps.lua 2023-01-07 02:41:17 +01:00
zeertzjq
1c6be5e5e6
fix(coverity/433537): don't call kv_concat_len() when read_size is 0 (#21664)
fix(coverity): don't call kv_concat_len() when read_size is 0
2023-01-07 07:50:48 +08:00
f7ad46e69e
fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() (#21665)
Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
2023-01-06 15:26:31 +01:00
bfredl
0996430392
Merge pull request #21666 from bfredl/padbell
fix(tui): do not invoke loop recursively for pad()
2023-01-06 13:35:01 +01:00
bfredl
b303ab9a7d fix(tui): do not invoke loop recursively for pad()
fixes #21610
2023-01-06 11:01:02 +01:00
Justin M. Keyes
08ebf8d3a8
Merge #18706 execute Lua with "nvim -l" 2023-01-05 13:06:21 -05:00
Justin M. Keyes
628b717022 refactor: extract code to open stdin for reading 2023-01-05 17:44:12 +01:00
Justin M. Keyes
7089f33144 refactor(lua): move _G.arg init to nlua_init() 2023-01-05 17:10:02 +01:00
Justin M. Keyes
e8ab218716 feat(message): avoid spam on failed os_msg
also de-dupe the code
2023-01-05 17:10:02 +01:00
Justin M. Keyes
f43de742e8 feat(lua): execute stdin ("-") as Lua 2023-01-05 17:10:02 +01:00
Justin M. Keyes
adef308a59 feat(lua): exit 1 on Lua "-l" script error 2023-01-05 17:10:02 +01:00
Justin M. Keyes
45549f031e feat(lua): send "--" literally to Lua "-l" script
Problem:
When "-l" is followed by "--", we stop sending args to the Lua script
and treat "--" in the usual way. This was for flexibility but didn't
have a strong use-case, and has these problems:
- prevents Lua "-l" scripts from handling "--" in their own way.
- complicates the startup logic (must call nlua_init before command_line_scan)

Solution:
Don't treat "--" specially if it follows "-l".
2023-01-05 17:10:02 +01:00
Justin M. Keyes
599e1d019a ci: use nvim -l in api-docs job 2023-01-05 17:10:02 +01:00
Justin M. Keyes
7c94bcd2d7 feat(lua)!: execute Lua with "nvim -l"
Problem:
Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua
scripts, especially scripts that take arguments or produce output.

Solution:
- support "nvim -l [args...]" for running scripts. closes #15749
- exit without +q
- remove lua2dox_filter
- remove Doxyfile. This wasn't used anyway, because the doxygen config
  is inlined in gen_vimdoc.py (`Doxyfile` variable).
- use "nvim -l" in docs-gen CI job

Examples:

    $ nvim -l scripts/lua2dox.lua --help
    Lua2DoX (0.2 20130128)
    ...

    $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2
    $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l -

TODO?
  -e executes Lua code
  -l loads a module
  -i enters REPL _after running the other arguments_.
2023-01-05 17:10:02 +01:00
TJ DeVries
39d70fcafd
dist: generated version of ccomplete.vim (#21623)
This is the first PR featuring a conversion of an upstream vim9script file
into a Lua file.

The generated file can be found in `runtime/autoload/ccomplete.vim` in
the vim repository. Below is a limited history of the changes of that file
at the time of conversion.

```
❯ git log --format=oneline runtime/autoload/ccomplete.vim
c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files
a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files
4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files
d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files
20aac6c1126988339611576d425965a25a777658 Update runtime files.
30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files.
b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files.
00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files.
8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a
...
```

The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated
(for any bug fixes or new features, like implementing class and interface, the latest in vim9script).

Further PRs will improve the DX of generated the converted lua and
tracking which files in the neovim's code base have been generated.
2023-01-05 11:00:32 -05:00
bfredl
19591e9918
fix(ui): fix fragile UI_CALL macro invocation (#21656)
Fixup #21605

Depending on the phase of the moon, UI_CALL expanding UI_LOG expanding the default value of entered_free_all_mem might or might not work.
2023-01-05 13:31:47 +01:00
Justin M. Keyes
c889f75436 project: rearrange ISSUE_TEMPLATE/bug_report.yml
Problem:
The "system info" fields in the bug report take up a lot of space at the
top. That hides the most relevant part of the bug report. To read the
actual bug, you always have to scroll down.

Solution:
Move the "system info" fields to the bottom.
2023-01-05 10:48:48 +01:00
bfredl
85eb564bac
Merge pull request #21605 from bfredl/uidvp
The UI Devirtualization Project
2023-01-05 10:41:14 +01:00
bfredl
47ba78f89a refactor(ui): devirtualize the ui layer
- The defined interface for the UI is only the RPC protocol. The original
  UI interface as an array of function pointers fill no function.
- On the server, all the UI:s are all RPC channels.
  - ui.c is only used on the server.
  - The compositor is a preprocessing step for single-grid UI:s
- on the client, ui_client and tui talk directly to each other
  - we still do module separation, as ui_client.c could form the basis
    of a libnvim client module later.

Items for later PR:s
- vim.ui_attach is still an unhappy child, reconsider based on plugin experience.
- the flags in ui_events.in.h are still a mess. Can be simplified now.
- UX for remote attachment needs more work.
- startup for client can be simplified further (think of the millisecs we can save)
2023-01-05 09:48:26 +01:00
zeertzjq
ae64772a88
fix(diff): avoid restoring invalid 'foldcolumn' value (#21650)
Use "0" for 'foldcolumn' when w_p_fdc_save is empty, like how
"manual" is used for 'foldmethod' when w_p_fdm_save is empty.
2023-01-05 07:12:02 +08:00
zeertzjq
89232b8b48
fix(tui): make a copy of data->params before unibi_format() (#21643)
Problem:    When unibi_format() modifies params and data->buf overflows,
            unibi_format() is called again, causing the params to be
            modified twice. This can happen for escapes sequences that
            use the %i terminfo format specifier (e.g. cursor_address),
            which makes unibi_format() increase the param by 1.
Solution:   Make a copy of data->params before calling unibi_format().
2023-01-05 00:25:25 +08:00
Chris DeLuca
1bd6e4469b
docs(website): soft wrap code blocks #21644
Use `white-space: pre-wrap` to preserve white space as per `pre`, but to
allow line wrapping if the display runs out of horizontal space.

This prevents lines overflowing their box, and causing horizontal
scrolling across the entire page on small screens.

This `pre-wrap` technique is used by GitHub to format code for mobile.

See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#pre-wrap
2023-01-04 07:15:08 -08:00