Commit Graph

18779 Commits

Author SHA1 Message Date
Björn Linse
469652d0d5 refactor(lua): rename nlua_msgpack_ => nlua_api_
These functions do not involve msgpack. Initially the nvim api was
sometimes called the "msgpack API", but entry points from vim script
and lua are equally valid (and don't need to reference "msgpack")
2021-08-28 16:50:59 +02:00
Dundar Göc
2d240024ac refactor: format screen.c with uncrustify 2021-08-28 16:18:36 +02:00
Dundar Göc
5a66205944 refactor: update uncrustify config file to better fit neovim style guide 2021-08-28 16:17:53 +02:00
Jose Alvarez
04938eed3e
fix(lsp): check if buffer is valid in changetracking (#15505) 2021-08-28 11:57:06 +02:00
Gregory Anders
8af13ed946
fix(process_wait): drain proc.events directly #15501
After a process's refcnt is decremented to zero, it enqueues a
`process_close_event` on its own event queue. In `process_wait`, this
event should be processed immediately so that any process close
callbacks are executed before `process_wait` returns.

Update `process_wait` to always process the process's event queue after
the process is freed, rather than the event queue passed in as an
argument.
2021-08-27 19:17:11 -07:00
Justin M. Keyes
ff7f7dd26b
Merge #15433 defaults: auto-create backup dir 2021-08-27 18:08:20 -07:00
Gregory Anders
e5d464d8e0 docs: update 'backupdir' and 'undodir' descriptions 2021-08-27 10:45:25 -06:00
Gregory Anders
4e516e53bf fix: remove trailing slashes before making directory
Remove the trailing slashes from 'undofile' and 'backupdir' before
creating directories. They cause problems on Windows which doesn't
recognize these slashes as proper path separators.
2021-08-27 10:45:25 -06:00
Gregory Anders
460019366e feat: defaults: auto-create backup dir
Copy the behavior of 'undodir' and create the last specified directory
in the 'backupdir' option if it doesn't exist.

Use trailing slashes for 'backupdir' as well as 'viewdir' and 'undodir'
by default. Note that 'undodir' always behaves as though it has the
trailing slashes, regardless of whether or not they are present. They
are added to the default option value to minimize surprise.

The '.' value in 'backupdir' is kept because the default behavior for
backups is solely to have a backup if the save of the main file to disk
fails. As soon as that save is completed the backup file is removed, so
generally there is no need to put them in a central location.

Co-authored by: murphy66 <murphy66@gmail.com>
2021-08-27 10:34:44 -06:00
zeertzjq
32024787b6
vim-patch:8.1.2229: color number column above/below cursor #15409
Problem:    Cannot color number column above/below cursor differently.
Solution:   Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624)
efae76ab1a
2021-08-27 05:50:37 -07:00
notomo
08e223cebb
tests(lua/on_yank): assert conditions that fail correctly #15495
The test added in 274a3504a7
does not fail if the code changes are reverted.
2021-08-27 04:54:01 -07:00
zeertzjq
f6e662bbe9
feat(lsp): get_border_size(): support repeating border char list #15474 2021-08-27 04:19:17 -07:00
notomo
274a3504a7
fix(lua): verify buffer in highlight.on_yank (#15482)
Resolve an issue with deferred clearing of highlight failing if the 
buffer is deleted before the timeout by checking whether the
buffer is valid first.
2021-08-26 16:37:36 +02: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
zeertzjq
d8ddd1e425
fix(man.vim): reduce false positives for manReference #14242
Co-authored-by: Anmol Sethi <hi@nhooyr.io>
2021-08-26 04:31:37 -07:00
Justin M. Keyes
4c499899b2
Merge #15293 Vimscript "method" syntax
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
2021-08-26 04:26:32 -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
Gregory Anders
8d62f5fd58
vim-patch:8.2.3362: buffer overflow when completing long tag name (#15449)
Problem:    Buffer overflow when completing long tag name.
Solution:   Allocate the buffer dynamically. (Gregory Anders, closes vim/vim#8769)
489d60996d
2021-08-25 21:57:18 -04:00
Björn Linse
10d7d73b2d
Merge pull request #15475 from vigoux/bufupdates-paste
Send correct byte updates on visual paste
2021-08-25 20:56:15 +02:00
Thomas Vigouroux
14231463a4
fix(bufupdates): send correct updates for visual paste
One step further towards stable tree-sitter.

Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2021-08-25 15:11:39 +02:00
Thomas Vigouroux
a373ca1d82
Merge pull request #15466 from vigoux/ts-query-auto
feat(ts): add query module in treesitter keys
2021-08-24 17:45:54 +02:00
Michael Lingelbach
5d633546bf
fix(lsp): enable additional capabilities (#15470)
Declaration, type-definition, and implementation capabilities were
previously disabled if the client received table output from the server
capabilities. The workDoneProgress capability is sent for many servers
for all supported capabilities as part of this table. Default to setting 
capability to table instead of false.
2021-08-23 16:25:15 -04:00
Christian Clason
a92e83ac14
vim-patch:6aa5729 (#15463)
Update Scala syntax file
6aa57295cf
2021-08-23 17:58:45 +02:00
Gregory Anders
5756470a2b
build: remove CFLAGS from :version in non-debug builds #15424
A step towards reproducible builds.
2021-08-23 07:57:17 -07:00
Thomas Vigouroux
8e0963d307
feat(ts): add query module in treesitter keys 2021-08-23 15:34:08 +02:00
Lewis Russell
c5d76c5b9b
fix(doc): example for vim.diff() (#15464) 2021-08-23 13:47:54 +02:00
Thomas Vigouroux
34b60ec894
Merge pull request #15434 from Dkendal/feature-lua-treesitter-sibling
feat(treesitter): add next, prev sibling method
2021-08-23 09:14:40 +02:00
Justin M. Keyes
4b3ffde208 docs: issue templates 2021-08-22 17:37:08 -07:00
Justin M. Keyes
fb5db6c7cf docs: issue templates 2021-08-22 16:56:41 -07:00
notomo
90b2da16ae
fix(window.c): win_close from other tabpage #15454
Fix #15313
2021-08-22 15:27:20 -07:00
Jesse Atkinson
da5d023c97
vim-patch:8.2.3358: structurizr files are not recognized (#15417)
Problem:    Structurizr files are not recognized.
Solution:   Recognize the file by contents. (Bastian Venthur, closes vim/vim#8764)
dea561111a
2021-08-22 14:40:59 -07:00
Gregory Anders
c2a211b8e3
docs: make Lua docstrings consistent #15255
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.

Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
2021-08-22 13:55:28 -07:00
Björn Linse
649dbb3b15
Merge pull request #15457 from bfredl/oldmap
refactor(map): remove extra-allocating map_new/map_free functions
2021-08-22 17:29:17 +02:00
Björn Linse
de21e6ef3d refactor(map): remove extra-allocating map_new/map_free functions
Note: the reason for removing them is not that there after this refactor
is no use of them, but rather that having them available is an
anti-pattern: they manange an _extra_ heap allocation which has
nothing to do with the functionality of the map itself (khash
manages the real buffers internally). In case there happens to
be a reason to allocate the map structure itself later, this
should be made explicit using xcalloc/xfree calls.
2021-08-22 16:15:38 +02:00
dundargoc
db1b0ee3b3
refactor: replace TRUE/FALSE with true/false #15425 2021-08-22 07:10:57 -07:00
Lewis Russell
783140c670
fix(doc): move vim.diff doc (#15456)
... to prevent bots from overwriting it
2021-08-22 13:52:56 +02:00
Björn Linse
7ebb25cca1
Merge pull request #15451 from bfredl/metamap
perf(map): get rid of unnecessary pointer indirections for maps.
2021-08-22 13:12:58 +02:00
Lewis Russell
3d3c0c669d
feat(api): add lua C bindings for xdiff (#14536)
* feat(api): add lua C bindings for xdiff

* chore: opt.hunk_lines -> opt.result_type

opt.on_hunk now takes precedence over opt.result_type

* chore: fix indents

Fix indents

* chore: change how priv is managed

Assign priv NULL and unconditionally apply XFREE_CLEAR to it when
finished.
2021-08-22 12:22:04 +02:00
Björn Linse
c265fd31ab refactor(api): remove unneccesary indirection around handles
These things are just maps to pointers, no need to perform
a huge song and dance around it.
2021-08-22 11:28:47 +02:00
Björn Linse
b888018aed refactor(marktree): embed the keymap in the MarkTree struct 2021-08-22 10:46:04 +02:00
Björn Linse
b2277a4279 refactor(map): get rid of spurious subsystem_init() functions due to maps 2021-08-22 10:46:04 +02:00
Björn Linse
6d23a58b7d refactor(extmark): remove pointer indirection for extmark use of maps 2021-08-22 10:46:01 +02:00
Björn Linse
4500253f60 refactor(syntax): don't use pointer indirected maps for no reason 2021-08-22 10:10:15 +02:00
Björn Linse
9e651a9d09 perf(map): reduce double pointer indirection to single pointer indirection
the only field of Map(...) was a pointer to a khash_t. make it contain
the struct by value instead.
2021-08-22 09:54:21 +02:00
Justin M. Keyes
8331cd13c4
docs #15447
- update ":help 'hidden'" #15410
- update ":help K" #15398
- try to capture some of the debug steps from #12036 (bpftrace, USDT probes)
2021-08-21 18:26:33 -07:00
Gregory Anders
a90513c24b
feat(keywordprg): use :terminal for external commands #15398
Open external 'keywordprg' commands in a :terminal in a new tab. <Esc> is
mapped to stop the job and close the buffer.

Closes #2995
Closes #2761
2021-08-21 17:23:10 -07:00
Gregory Anders
50b30de200
feat(terminal): TermClose: set exit code in v:event.status #15406
Closes #4713
2021-08-20 10:45:28 -07:00
Dylan Kendal
140084180e
feat(treesitter): add next, prev sibling method
Add tsnode methods to change to the next, previous, named or unnamed
nodes.
2021-08-20 11:58:15 -04:00
Björn Linse
599af74514
Merge pull request #15295 from gpanders/ftdetect
fix: only source package ftdetect files once
2021-08-20 11:30:43 +02:00
github-actions[bot]
2ae9ff1285
docs: regenerate (#15431)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-08-19 20:28:18 +02:00