From 4b60267f82ef1947f8a583c02eaf502cf1db69ca Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 2 Jun 2023 21:00:55 +0800 Subject: feat(:source): source current ft=lua buffer as Lua code (#23802) --- runtime/doc/news.txt | 3 +++ runtime/doc/repeat.txt | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 3fd2d4d40e..31f3ff2cd1 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -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* diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index b6cb126c3b..071b062957 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -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} -- cgit