aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/netrw.vim5
-rw-r--r--runtime/autoload/provider/clipboard.vim9
-rw-r--r--runtime/doc/filetype.txt2
-rw-r--r--runtime/doc/lua.txt5
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--runtime/doc/spell.txt2
-rw-r--r--runtime/doc/syntax.txt4
-rw-r--r--runtime/doc/ui.txt6
-rw-r--r--runtime/filetype.vim15
-rw-r--r--runtime/lua/vim/lsp/callbacks.lua11
-rw-r--r--runtime/lua/vim/lsp/util.lua6
-rw-r--r--runtime/lua/vim/shared.lua11
-rw-r--r--runtime/lua/vim/treesitter.lua2
-rw-r--r--runtime/lua/vim/uri.lua3
14 files changed, 67 insertions, 18 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index fa86223d53..b69ad7187a 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -5460,6 +5460,11 @@ fun! netrw#CheckIfRemote(...)
else
let curfile= expand("%")
endif
+
+ " Ignore terminal buffers
+ if &buftype ==# 'terminal'
+ return 0
+ endif
" call Decho("curfile<".curfile.">")
if curfile =~ '^\a\{3,}://'
" call Dret("netrw#CheckIfRemote 1")
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index c86f7d0c2f..a96a0a61b7 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -113,8 +113,13 @@ function! provider#clipboard#Executable() abort
let s:paste['*'] = s:paste['+']
return 'doitclient'
elseif executable('win32yank.exe')
- let s:copy['+'] = 'win32yank.exe -i --crlf'
- let s:paste['+'] = 'win32yank.exe -o --lf'
+ if has('wsl') && getftype(exepath('win32yank.exe')) == 'link'
+ let win32yank = resolve(exepath('win32yank.exe'))
+ else
+ let win32yank = 'win32yank.exe'
+ endif
+ let s:copy['+'] = win32yank.' -i --crlf'
+ let s:paste['+'] = win32yank.' -o --lf'
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'win32yank'
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index c649688d99..1fce37c594 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -275,7 +275,7 @@ Note that the last one is the value of $VIMRUNTIME which has been expanded.
Note that when using a plugin manager or |packages| many directories will be
added to 'runtimepath'. These plugins each require their own directory, don't
-put them directly in ~/.vim/plugin.
+put them directly in ~/.config/nvim/plugin.
What if it looks like your plugin is not being loaded? You can find out what
happens when Vim starts up by using the |-V| argument: >
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 800f24b5c9..7f376cbbf0 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -908,7 +908,10 @@ deep_equal({a}, {b}) *vim.deep_equal()*
deepcopy({orig}) *vim.deepcopy()*
Returns a deep copy of the given object. Non-table objects are
copied as in a typical Lua assignment, whereas table objects
- are copied recursively.
+ are copied recursively. Functions are naively copied, so
+ functions in the copied table point to the same functions as
+ those in the input table. Userdata and threads are not copied
+ and will throw an error.
Parameters: ~
{orig} Table to copy
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 06977ac454..5fb80d75ce 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6701,6 +6701,10 @@ A jump table for the options with a short description can be found at |Q_op|.
While the menu is active these keys have special meanings:
+ CTRL-Y - accept the currently selected match and stop
+ completion.
+ CTRL-E - end completion, go back to what was there before
+ selecting a match.
<Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
<Down> - in filename/menu name completion: move into a
subdirectory or submenu.
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 1f1599f560..b88e26cdff 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -504,7 +504,7 @@ then Vim will try to guess.
Multiple {inname} arguments can be given to combine
regions into one Vim spell file. Example: >
- :mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU
+ :mkspell ~/.config/nvim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU
< This combines the English word lists for US, CA and AU
into one en.spl file.
Up to eight regions can be combined. *E754* *E755*
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 30ccb699cd..57337aeac2 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -4647,8 +4647,8 @@ in their own color.
":colorscheme" in a color scheme script.
To customize a colorscheme use another name, e.g.
- "~/.vim/colors/mine.vim", and use `:runtime` to load
- the original colorscheme: >
+ "~/.config/nvim/colors/mine.vim", and use `:runtime` to
+ load the original colorscheme: >
runtime colors/evening.vim
hi Statement ctermfg=Blue guifg=Blue
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index de54ce59b6..b243d9ba50 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -592,6 +592,12 @@ tabs.
When |ext_messages| is active, no message grid is used, and this event
will not be sent.
+["win_viewport", grid, win, topline, botline, curline, curcol]
+ Indicates the range of buffer text displayed in the window, as well
+ as the cursor position in the buffer. All positions are zero-based.
+ `botline` is set to one more than the line count of the buffer, if
+ there are filler lines past the end.
+
==============================================================================
Popupmenu Events *ui-popupmenu*
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 49e1e9909b..5068f9be76 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2019 Nov 26
+" Last Change: 2020 Apr 12
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -229,11 +229,14 @@ au BufNewFile,BufRead *.bl setf blank
" Blkid cache file
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
+" BSDL
+au BufNewFile,BufRead *bsd,*.bsdl setf bsdl
+
" Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel setf bzl
if has("fname_case")
" There is another check for BUILD further below.
- autocmd BufRead,BufNewFile BUILD setf bzl
+ autocmd BufRead,BufNewFile BUILD setf bzl
endif
" C or lpc
@@ -1639,9 +1642,11 @@ au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
" Systemd unit files
au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd
" Systemd overrides
-au BufNewFile,BufRead /etc/systemd/system/*.d/*.conf setf systemd
+au BufNewFile,BufRead */etc/systemd/system/*.d/*.conf setf systemd
+au BufNewFile,BufRead */.config/systemd/user/*.d/*.conf setf systemd
" Systemd temp files
-au BufNewFile,BufRead /etc/systemd/system/*.d/.#* setf systemd
+au BufNewFile,BufRead */etc/systemd/system/*.d/.#* setf systemd
+au BufNewFile,BufRead */.config/systemd/user/*.d/.#* setf systemd
" Synopsys Design Constraints
au BufNewFile,BufRead *.sdc setf sdc
@@ -1772,7 +1777,7 @@ au BufNewFile,BufRead *.va,*.vams setf verilogams
au BufNewFile,BufRead *.sv,*.svh setf systemverilog
" VHDL
-au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl
+au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho setf vhdl
" Vim script
au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
diff --git a/runtime/lua/vim/lsp/callbacks.lua b/runtime/lua/vim/lsp/callbacks.lua
index 644c12f98c..c403a3fd51 100644
--- a/runtime/lua/vim/lsp/callbacks.lua
+++ b/runtime/lua/vim/lsp/callbacks.lua
@@ -29,6 +29,17 @@ M['textDocument/publishDiagnostics'] = function(_, _, result)
return
end
util.buf_clear_diagnostics(bufnr)
+
+ -- https://microsoft.github.io/language-server-protocol/specifications/specification-current/#diagnostic
+ -- The diagnostic's severity. Can be omitted. If omitted it is up to the
+ -- client to interpret diagnostics as error, warning, info or hint.
+ -- TODO: Replace this with server-specific heuristics to infer severity.
+ for _, diagnostic in ipairs(result.diagnostics) do
+ if diagnostic.severity == nil then
+ diagnostic.severity = protocol.DiagnosticSeverity.Error
+ end
+ end
+
util.buf_diagnostics_save_positions(bufnr, result.diagnostics)
util.buf_diagnostics_underline(bufnr, result.diagnostics)
util.buf_diagnostics_virtual_text(bufnr, result.diagnostics)
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 5dd010f2a4..763e9719a7 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -522,8 +522,7 @@ function M.open_floating_preview(contents, filetype, opts)
end
api.nvim_buf_set_lines(floating_bufnr, 0, -1, true, contents)
api.nvim_buf_set_option(floating_bufnr, 'modifiable', false)
- -- TODO make InsertCharPre disappearing optional?
- api.nvim_command("autocmd CursorMoved,BufHidden,InsertCharPre <buffer> ++once lua pcall(vim.api.nvim_win_close, "..floating_winnr..", true)")
+ M.close_preview_autocmd({"CursorMoved", "CursorMovedI", "BufHidden"}, floating_winnr)
return floating_bufnr, floating_winnr
end
@@ -725,7 +724,8 @@ do
[protocol.DocumentHighlightKind.Read] = "LspReferenceRead";
[protocol.DocumentHighlightKind.Write] = "LspReferenceWrite";
}
- highlight_range(bufnr, reference_ns, document_highlight_kind[reference["kind"]], start_pos, end_pos)
+ local kind = reference["kind"] or protocol.DocumentHighlightKind.Text
+ highlight_range(bufnr, reference_ns, document_highlight_kind[kind], start_pos, end_pos)
end
end
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 1bf1c63fd7..d18fcfaf95 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -8,6 +8,9 @@ local vim = vim or {}
--- Returns a deep copy of the given object. Non-table objects are copied as
--- in a typical Lua assignment, whereas table objects are copied recursively.
+--- Functions are naively copied, so functions in the copied table point to the
+--- same functions as those in the input table. Userdata and threads are not
+--- copied and will throw an error.
---
--@param orig Table to copy
--@returns New table of copied keys and (nested) values.
@@ -34,10 +37,16 @@ vim.deepcopy = (function()
string = _id,
['nil'] = _id,
boolean = _id,
+ ['function'] = _id,
}
return function(orig)
- return deepcopy_funcs[type(orig)](orig)
+ local f = deepcopy_funcs[type(orig)]
+ if f then
+ return f(orig)
+ else
+ error("Cannot deepcopy object of type "..type(orig))
+ end
end
end)()
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index 8dacfa11cf..1836227540 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -124,7 +124,7 @@ end
function M.parse_query(lang, query)
M.require_language(lang)
local self = setmetatable({}, Query)
- self.query = vim._ts_parse_query(lang, query)
+ self.query = vim._ts_parse_query(lang, vim.fn.escape(query,'\\'))
self.info = self.query:inspect()
self.captures = self.info.captures
self.regexes = {}
diff --git a/runtime/lua/vim/uri.lua b/runtime/lua/vim/uri.lua
index 1065f84f4c..d91fb7ffd3 100644
--- a/runtime/lua/vim/uri.lua
+++ b/runtime/lua/vim/uri.lua
@@ -70,6 +70,7 @@ local function uri_from_bufnr(bufnr)
end
local function uri_to_fname(uri)
+ uri = uri_decode(uri)
-- TODO improve this.
if is_windows_file_uri(uri) then
uri = uri:gsub('^file:///', '')
@@ -77,7 +78,7 @@ local function uri_to_fname(uri)
else
uri = uri:gsub('^file://', '')
end
- return uri_decode(uri)
+ return uri
end
-- Return or create a buffer for a uri.