From c2433589dca022a7f40cdcbd0cd1ad8aba6ee4a9 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Sat, 27 Jan 2024 02:00:50 +0100 Subject: feat(ex_cmds): ranged :lua #27167 :{range}lua executes the specified lines in the current buffer as Lua code, regardless of its extension or 'filetype'. Close #27103 --- runtime/doc/lua.txt | 5 +++++ runtime/doc/news.txt | 3 +++ 2 files changed, 8 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 433a9fc266..fecdfd9bd0 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -254,6 +254,11 @@ arguments separated by " " (space) instead of "\t" (tab). < To see the LuaJIT version: >vim :lua =jit.version < +:{range}lua + Executes the |[range]| in the current buffer as Lua code. Unlike |:source|, + this will execute the specified lines regardless of the extension or + |'filetype'| of the buffer. + *:lua-heredoc* :lua << [trim] [{endmarker}] {script} diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 2212b9910b..40717f8ecf 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -340,6 +340,9 @@ The following changes to existing APIs or features add new behavior. • |:source| without arguments treats a buffer with its 'filetype' set to "lua" as Lua code regardless of its extension. +• |:lua| with a |[range]| executes that range in the current buffer as Lua code + regardless of its extension. + • |:checkhealth| buffer now implements |folding|. The initial folding status is defined by the 'foldenable' option. -- cgit