Commit Graph

137 Commits

Author SHA1 Message Date
Maria José Solano
5d8ab32f38
feat(treesitter): add a query editor (#24703) 2023-08-25 13:17:36 -05:00
Sean Dewar
cbf54ec2a5
vim-patch:e978b4534a5e (#24697)
Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749)

e978b4534a

Also update the header for the following files that were converted to Vim9
script upstream:

- autoload/ccomplete.lua (vim9jitted)
- ftplugin.vim
- ftplugof.vim
- indent.vim
- indent/vim.vim
- makemenu.vim

This also updates the "Last Change" dates, even if some changes (due to rewrites
to Vim9 script) were not ported.

There's still a few other places where Bram is still mentioned as a maintainer
in the files we and Vim have:

- ftplugin/bash.vim
- indent/bash.vim
- indent/html.vim
- indent/mail.vim
- macros/accents.vim
- macros/editexisting.vim
- syntax/bash.vim
- syntax/shared/typescriptcommon.vim
- syntax/tar.vim
- syntax/typescript.vim
- syntax/typescriptreact.vim
- syntax/zimbu.vim

Maybe future patches will address that.

Also exclude changes to .po files that didn't apply automatically (the
`:messages` maintainer string isn't used in Nvim anyway).

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-13 13:25:10 +01:00
marshmallow
6a486c44e6
fix(gx): move to to _init_default_mappings #24420
Problem:
netrw may conflict with the Nvim default "gx" mapping.

Solution:
Initialize keymapping earlier by moving it to vim._init_default_mappings().
That also avoids needing to check maparg().
2023-07-24 08:35:19 -07:00
zeertzjq
df297e3c2b
fix(runtime): don't set gx mapping if already mapped (#24262)
This matches netrw's use of maparg().
2023-07-05 16:31:45 +08:00
Justin M. Keyes
e644e7ce0b fix(vim.ui.open): return (don't show) error message
Problem:
Showing an error via vim.notify() makes it awkward for callers such as
lsp/handlers.lua to avoid showing redundant errors.

Solution:
Return the message instead of showing it. Let the caller decide whether
and when to show the message.
2023-07-05 00:49:10 +02:00
Justin M. Keyes
67b2ed1004 fix(gx): visual selection, expand env vars
---
Rejected experiment: move vim.ui.open() to vim.env.open()

Problem:
`vim.ui` is where user-interface "providers" live, which can be
overridden. It would also be useful to have a "providers" namespace for
platform-specific features such as "open", clipboard, python, and the other
providers listed in `:help providers`. We could overload `vim.ui` to
serve that purpose as the single "providers" namespace, but
`vim.ui.nodejs()` for example seems awkward.

Solution:
`vim.env` currently has too narrow of a purpose. Overload it to also be
a namespace for `vim.env.open`.

diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 913f1fe20348..17d05ff37595 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -37,8 +37,28 @@ local options_info = setmetatable({}, {
   end,
 })

-vim.env = setmetatable({}, {
-  __index = function(_, k)
+vim.env = setmetatable({
+  open = setmetatable({}, {
+      __call = function(_, uri)
+        print('xxxxx'..uri)
+        return true
+      end,
+      __tostring = function()
+        local v = vim.fn.getenv('open')
+        if v == vim.NIL then
+          return nil
+        end
+        return v
+      end,
+    })
+  },
+  {
+  __index = function(t, k, ...)
+    if k == 'open' then
+      error()
+      -- vim.print({...})
+      -- return rawget(t, k)
+    end
     local v = vim.fn.getenv(k)
     if v == vim.NIL then
       return nil
2023-07-04 23:45:35 +02:00
marshmallow
af6e6ccf3d feat(vim.ui): vim.ui.open, "gx" without netrw
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
2023-07-04 23:45:00 +02:00
Christian Clason
c11986ed1a
vim-patch:b7398fe41c9e (#23627)
Update runtime files

b7398fe41c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-15 09:38:32 +02:00
Christian Clason
e3f36377c1
vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
dundargoc
2b35de386e
refactor: remove :CheckHealth
Using :CheckHealth invokes an error, and many of the features from :checkhealth
doesn't even work such as calling only a specific check. Users should use
:checkhealth instead.
2023-04-12 00:01:34 +02:00
dundargoc
880f7d12fe
feat!: remove vimballs (#22402)
Vimball is an outdated feature that is rarely used these days. It is not
a maintenance burden on its own, but it is nonetheless dead weight and
something we'd need to tell users to ignore when they inevitably ask
what it is.

See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
2023-04-11 19:10:36 +02:00
Gregory Anders
d675bd01b1
feat(lua): allow vim.F.if_nil to take multiple arguments (#22903)
The first argument which is non-nil is returned. This is useful when
using nested default values (e.g. in the EditorConfig plugin).

Before:

  local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true))

After:

  local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
2023-04-07 08:22:47 -06:00
Yochem van Rosmalen
2720d2c793
fix(treesitter): InspectTree does not respect 'splitright' #22692
Problem:
vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'.

Solution:
- Change the default `command` from `topleft 60vnew` to `60vnew`.
- Change :InspectTree to respect command mods (`:vertical`, count, etc.).

Closes #22656
2023-03-17 04:41:57 -07:00
Justin M. Keyes
673d2b52fa refactor!: rename vim.pretty_print => vim.print
Problem:
The function name `vim.pretty_print`:
1. is verbose, which partially defeats its purpose as sugar
2. does not draw from existing precedent or any sort of convention
   (except external projects like penlight or python?), which reduces
   discoverability, and degrades signaling about best practices.

Solution:
- Rename to `vim.print`.
- Change the behavior so that
  1. strings are printed without quotes
  2. each arg is printed on its own line
  3. tables are indented with 2 instead of 4 spaces
- Example:
  :lua ='a', 'b', 42, {a=3}
  a
  b
  42
  {
    a = 3
  }

Comparison of alternatives:
- `vim.print`:
  - pro: consistent with Lua's `print()`
  - pro: aligns with potential `nvim_print` API function which will
    replace nvim_echo, nvim_notify, etc.
  - con: behaves differently than Lua's `print()`, slightly misleading?
- `vim.echo`:
  - pro: `:echo` has similar "pretty print" behavior.
  - con: inconsistent with Lua idioms.
- `vim.p`:
  - pro: very short, fits with `vim.o`, etc.
  - con: not as discoverable as "echo"
  - con: less opportunity for `local p = vim.p` because of potential shadowing.
2023-03-13 01:25:09 +01:00
Christian Clason
f449121764
feat(treesitter): add :InspectTree command (#22477) 2023-03-02 18:03:11 +01:00
Christian Clason
66c384d4e8
vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

dd60c365cd

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
Christian Clason
144279ef30
vim-patch:be4e01637e71 (#22103)
Update runtime files.

be4e01637e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-03 09:18:18 +01: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
Gregory Anders
ab9a2c4925 feat(editorconfig): add builtin EditorConfig support 2023-01-03 10:28:55 -07:00
Folke Lemaitre
ef91146efc
feat: vim.inspect_pos, vim.show_pos, :Inspect 2022-12-17 13:05:31 +01:00
Christian Clason
3576776903
vim-patch:86b4816766d9 (#21314)
Update runtime files

86b4816766

vim-patch:9.0.1029: autoload directory missing from distribution

Problem:    Autoload directory missing from distribution.
Solution:   Add the autoload/zig directory to the list of distributed files.

84dbf855fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-08 16:33:38 +01:00
zeertzjq
65e8ed45de
vim-patch:9.0.0969: matchparen highlight is not updated when switching buffers (#21227)
Problem:    Matchparen highlight is not updated when switching buffers.
Solution:   Listen to the BufLeave and the BufWinEnter autocmd events.
            (closes vim/vim#11626)

28a896f54d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-29 10:17:57 +08:00
Lewis Russell
2afcdbd63a
feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
Christian Clason
d3cd79709b
vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02:00
bfredl
aad20de5ab fix(startup): nvim with --clean should not load user rplugins
runtime rplugins such like legacy script providers are not affected
by this change.
2022-06-04 18:37:54 +02:00
Christian Clason
c0efe49e78
vim-patch:519cc559b08b (#16340)
Update runtime files
519cc559b0
2021-11-17 10:02:59 +01:00
Gregory Anders
088026205f refactor: define diagnostic highlights in syntax.c 2021-10-03 20:06:06 -06:00
Gregory Anders
c13242cf47
fix(diagnostic): remove useless highlight links (#15683)
These links were actually defined backwards: the highlight groups
actually being used for display are the new "Diagnostic*" groups, so
linking the old "LspDiagnostics*" groups to these does absolutely
nothing, since there is nothing actually being highlighted with the
LspDiagnostics* groups.

These links were made in an attempt to preserve backward compatibility
with existing colorschemes. We could reverse the links to maintain this
preservation, but then that disallows us from actually defining default
values for the new highlight groups.

Instead, just remove the links and be done with the old LspDiagnostics*
highlight groups.

This is not technically a breaking change: the breaking change already
happened in #15585, but this PR just makes that explicit.
2021-09-17 08:17:54 +02:00
Gregory Anders
c2a65921d7
fix(diagnostic): don't override existing highlight groups #15682
Use the 'default' keyword to prevent overriding existing highlight groups.

ref #15585
2021-09-16 14:51:29 -07:00
Gregory Anders
a5bbb932f9 refactor: move vim.lsp.diagnostic to vim.diagnostic
This generalizes diagnostic handling outside of just the scope of LSP.
LSP clients are now a specific case of a diagnostic producer, but the
diagnostic subsystem is decoupled from the LSP subsystem (or will be,
eventually).

More discussion at [1].

[1]: https://github.com/neovim/neovim/pull/15585
2021-09-15 14:09:47 -06:00
Christian Clason
5fd21b8d3e
vim-patch:6c391a74fe90 (#15654)
Update runtime files
6c391a74fe

omit autoload/getscript.vim

skip doc/eval.txt (needs 8.2.2468)
skip doc/various.txt (needs 8.2.3400)

(typofixes courtesy of @dundargoc)
2021-09-13 16:33:41 +02:00
Christian Clason
1a9d2a4040
vim-patch:89a9c159f23f #15641
Update runtime files
89a9c159f2

Omit:
nsis/lang/turkish.nsi
pixmaps/gen-inline-pixbufs.sh
doc/popup.txt
doc/terminal.txt
tutor/tutor*
src/[g]vimtutor
CONTRIBUTING.md

Skip:
doc/eval.txt (needs 8.1.2342)
doc/testing.txt (needs 8.2.0299)
2021-09-13 06:05:27 -07:00
zeertzjq
6ff1e3fa1f
fix(man.vim): use -addr=other instead of -range=-1 #15172
-range=-1 requires the current file to have at least <count> lines, whereas -addr=other doesn't.

-addr=other also sets <count> to -1 by default when it is not specified, though this feature seems undocumented.
2021-08-26 04:36:31 -07:00
Justin M. Keyes
2548a9e180
fix(man.vim): filetype=man is too eager #15488
Problem:
"set filetype=man" assumes the user wants :Man features, this does extra
stuff like renaming the buffer as "man://".

Solution:
- old entrypoint was ":set filetype=man", but this is too presumptuous #15487
- make the entrypoints more explicit:
  1. when the ":Man" command is run
  2. when a "man://" buffer is opened
- remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim
- MANPAGER is supported via ":Man!", as documented.

fixes #15487
2021-08-26 02:19:52 -07:00
Jan Edmund Lazo
7e36c9a2d3
vim-patch:56994d215815
Update runtime files.
56994d2158
2021-05-02 12:44:04 -04:00
Jan Edmund Lazo
abb13dde98
vim-patch:130cbfc31235
Update runtime files
130cbfc312
2021-05-02 12:03:34 -04:00
Jan Edmund Lazo
330500a5bf
vim-patch:cb80aa2d53e5
Update runtime files.
cb80aa2d53

Omit runtime/doc/tabpage.txt.
Patch v8.2.1401 is not ported yet.

Port optwin.vim changes without gettext().
Patch v8.2.1544 is not ported yet.
2021-05-01 22:29:02 -04:00
Jan Edmund Lazo
d1a2523f6c
vim-patch:1d59aa1fdfb1
Update runtime files.
1d59aa1fdf
2021-05-01 01:37:13 -04:00
Jan Edmund Lazo
7c6ca6fed8
vim-patch:73fef33014db
Update runtime files
73fef33014

Omit usr_46.txt.
2021-04-28 22:14:37 -04:00
Jan Edmund Lazo
0185625c04
vim-patch:47e13953ffdb
Update runtime files
47e13953ff

Ignore *.rej files, generated by vim-patch.sh.
Source of mistakes for 1st-time contributors.
2021-04-28 21:29:57 -04:00
Jan Edmund Lazo
3d86857f28
vim-patch:2cfb4a2a7248
Update runtime files
2cfb4a2a72
2021-04-28 21:29:56 -04:00
Jan Edmund Lazo
5e1f434764
vim-patch:2963456ff2b7
Update runtime files.
2963456ff2
2021-04-27 09:21:33 -04:00
Jan Edmund Lazo
52564c9aa2
vim-patch:09c6f265b210
Update runtime files.
09c6f265b2

Omit getmousepos().
Patch v8.1.2304 is not ported yet.
2021-04-27 09:21:30 -04:00
Jan Edmund Lazo
6cdb755507
vim-patch:5ef1c6a4838a
Update runtime files
5ef1c6a483

"scrollfocus" is for Windows GUI only so it is N/A.
2021-04-27 09:21:29 -04:00
Jan Edmund Lazo
d4b65fa6fb
vim-patch:1ff14ba24c4d
Update runtime files.
1ff14ba24c
2021-04-27 09:21:28 -04:00
Jan Edmund Lazo
766a107839
vim-patch:589edb340454
Updte runtime files
589edb3404

Omit state() changes in eval.txt because patch v8.1.2047 is not merged.
2021-04-27 09:21:27 -04:00
Jan Edmund Lazo
b46a92f519
runtime/tar: 23515b4ef7580af8b9d3b964a558ab2007cacda5
Port tar files only in order to support '*.tar.zst' files.

Close https://github.com/neovim/neovim/pull/13337
2021-02-17 23:59:17 -05:00
Jan Edmund Lazo
1d84277738
runtime/tar: 2963456ff2b740244b3a064785fe681b1998d75e
Port tar files for release v31 only.
2021-02-17 23:39:37 -05:00
Jan Edmund Lazo
44ba77e589
runtime/netrw: 2963456ff2b740244b3a064785fe681b1998d75e
Port netrw files for release v168 only.
2021-02-16 07:51:25 -05:00