feat(:source): source current ft=lua buffer as Lua code (#23802)

This commit is contained in:
zeertzjq
2023-06-02 21:00:55 +08:00
committed by GitHub
parent 36fd2fcaae
commit 4b60267f82
4 changed files with 62 additions and 46 deletions

View File

@@ -92,6 +92,9 @@ The following changes to existing APIs or features add new behavior.
• |LspRequest| autocmd callbacks now contain additional information about the LSP
request status update that occurred.
• `:source` without arguments treats a buffer with its 'filetype' set to "lua"
as Lua code regardless of its extension.
==============================================================================
REMOVED FEATURES *news-removed*

View File

@@ -183,7 +183,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
*:so* *:source* *load-vim-script*
:[range]so[urce] [file] Runs |Ex| commands or Lua code (".lua" files) from
[file], or current buffer if no [file].
[file].
If no [file], the current buffer is used, and it is
treated as Lua code if its 'filetype' is "lua" or its
file name ends with ".lua".
Triggers the |SourcePre| autocommand.
*:source!*
:[range]so[urce]! {file}