diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/quickfix.txt | 4 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 14 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 9 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 3 | ||||
-rw-r--r-- | runtime/doc/usr_05.txt | 2 | ||||
-rw-r--r-- | runtime/filetype.vim | 1 | ||||
-rw-r--r-- | runtime/ftplugin.vim | 4 | ||||
-rw-r--r-- | runtime/indent.vim | 3 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 8 | ||||
-rw-r--r-- | runtime/syntax/synload.vim | 3 |
10 files changed, 36 insertions, 15 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index a937cfee98..ebc7e2a1b4 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1208,8 +1208,8 @@ not "b:current_compiler". What the command actually does is the following: - Delete the "current_compiler" and "b:current_compiler" variables. - Define the "CompilerSet" user command. With "!" it does ":set", without "!" it does ":setlocal". -- Execute ":runtime! compiler/{name}.vim". The plugins are expected to set - options with "CompilerSet" and set the "current_compiler" variable to the +- Execute ":runtime! compiler/{name}.(vim|lua)". The plugins are expected to + set options with "CompilerSet" and set the "current_compiler" variable to the name of the compiler. - Delete the "CompilerSet" user command. - Set "b:current_compiler" to the value of "current_compiler". diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index dd05084652..6755747dcf 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -172,9 +172,11 @@ Using Vim scripts *using-scripts* For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. *:so* *:source* *load-vim-script* -:so[urce] {file} Read Ex commands from {file}. These are commands that - start with a ":". +:so[urce] {file} Runs vim or lua {file} Triggers the |SourcePre| autocommand. + + Note: Only files ending with `.lua` is sourced as + lua file. Anything else is assumed to be vimscript. *:source!* :so[urce]! {file} Read Vim commands from {file}. These are commands that are executed from Normal mode, like you type @@ -187,8 +189,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. *:ru* *:runtime* :ru[ntime][!] [where] {file} .. - Read Ex commands from {file} in each directory given - by 'runtimepath' and/or 'packpath'. There is no error + Source vim/lua {file} in each directory given by + 'runtimepath' and/or 'packpath'. The vim files are + executed in same mannar as |:source| and lua files + similarly as |:luafile|. There is no error for non-existing files. Example: > @@ -244,6 +248,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. Note that {name} is the directory name, not the name of the .vim file. All the files matching the pattern pack/*/opt/{name}/plugin/**/*.vim ~ + and + pack/*/opt/{name}/plugin/**/*.lua ~ will be sourced. This allows for using subdirectories below "plugin", just like with plugins in 'runtimepath'. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index ae9022c56c..2110b88330 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -469,10 +469,15 @@ accordingly. Vim proceeds in this order: 7. Load the plugin scripts. *load-plugins* This does the same as the command: > :runtime! plugin/**/*.vim + :runtime! plugin/**/*.lua < The result is that all directories in the 'runtimepath' option will be searched for the "plugin" sub-directory and all files ending in ".vim" - will be sourced (in alphabetical order per directory), also in - subdirectories. + and ".lua" will be sourced (in alphabetical order per directory), + also in subdirectories. First all the "*.vim" files will be sourced and + then all the "*.lua" files will be sourced. If two files with same + name but different extensions exists they will be treated in same + manner. For example when both "foo.vim" and "foo.lua" exists then + first "foo.vim" will be sourced then "foo.lua" will be sourced. However, directories in 'runtimepath' ending in "after" are skipped here and only loaded after packages, see below. Loading plugins won't be done when: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index b159f655fa..bf649b5940 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4749,8 +4749,9 @@ in their own color. feature it will output "unknown". :colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' - for the file "colors/{name}.vim". The first one that + for the file "colors/{name}.(vim|lua)". The first one that is found is loaded. + Note: "colors/{name}.vim" is tried first. Also searches all plugins in 'packpath', first below "start" and then under "opt". diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index d8634ac6ed..d0206ba82d 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -411,7 +411,7 @@ Examples for the "stuff" filetype on Unix: > The <filetype> part is the name of the filetype the plugin is to be used for. Only files of this filetype will use the settings from the plugin. The <name> part of the plugin file doesn't matter, you can use it to have several plugins -for the same filetype. Note that it must end in ".vim". +for the same filetype. Note that it must end in ".vim" or ".lua". Further reading: diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ed70ac5ce8..89cc1a8fc5 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2303,6 +2303,7 @@ au BufNewFile,BufRead *.txt " Use the filetype detect plugins. They may overrule any of the previously " detected filetypes. runtime! ftdetect/*.vim +runtime! ftdetect/*.lua " NOTE: The above command could have ended the filetypedetect autocmd group " and started another one. Let's make sure it has ended to get to a consistent diff --git a/runtime/ftplugin.vim b/runtime/ftplugin.vim index a434b9372b..feef949dba 100644 --- a/runtime/ftplugin.vim +++ b/runtime/ftplugin.vim @@ -28,7 +28,9 @@ augroup filetypeplugin " When there is a dot it is used to separate filetype names. Thus for " "aaa.bbb" load "aaa" and then "bbb". for name in split(s, '\.') - exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' + exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim' + " Load lua ftplugins + exe printf('runtime! ftplugin/%s.lua ftplugin/%s_*.lua ftplugin/%s/*.lua', name, name, name) endfor endif endfunc diff --git a/runtime/indent.vim b/runtime/indent.vim index 12f03648ca..2b64dd44b9 100644 --- a/runtime/indent.vim +++ b/runtime/indent.vim @@ -24,7 +24,8 @@ augroup filetypeindent " When there is a dot it is used to separate filetype names. Thus for " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". for name in split(s, '\.') - exe 'runtime! indent/' . name . '.vim' + exe 'runtime! indent/' . name . '.vim' + exe 'runtime! indent/' . name . '.lua' endfor endif endfunc diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index dabe400e0d..05b68472e7 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -271,8 +271,12 @@ local function set_diagnostic_cache(diagnostics, bufnr, client_id) end -- Account for servers that place diagnostics on terminating newline if buf_line_count > 0 then - local start = diagnostic.range.start - start.line = math.min(start.line, buf_line_count - 1) + diagnostic.range.start.line = math.min( + diagnostic.range.start.line, buf_line_count - 1 + ) + diagnostic.range["end"].line = math.min( + diagnostic.range["end"].line, buf_line_count - 1 + ) end end diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index f373161c7c..3863a84c1a 100644 --- a/runtime/syntax/synload.vim +++ b/runtime/syntax/synload.vim @@ -55,7 +55,8 @@ fun! s:SynSet() " load each in sequence. Skip empty entries. for name in split(s, '\.') if !empty(name) - exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" + exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" + exe "runtime! syntax/" . name . ".lua syntax/" . name . "/*.lua" endif endfor endif |