diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-03-22 10:59:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-22 10:59:38 +0100 |
commit | c45b5e2c5b0f02742099ebccc44462fe4203e99c (patch) | |
tree | 13811fb22e65a99413aa5373c41e8c77d99ca779 /runtime | |
parent | 48ce2ef912cbbe43b85b45a8a97f8d240318718a (diff) | |
parent | a92b38934a2d00c13ee4d1969d994da15e0857ab (diff) | |
download | rneovim-c45b5e2c5b0f02742099ebccc44462fe4203e99c.tar.gz rneovim-c45b5e2c5b0f02742099ebccc44462fe4203e99c.tar.bz2 rneovim-c45b5e2c5b0f02742099ebccc44462fe4203e99c.zip |
Merge pull request #22743 from bfredl/luaequals
feat(lua): allow `:=expr` as a shorter version of `:lua =expr`
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/lua.txt | 6 | ||||
-rw-r--r-- | runtime/doc/news.txt | 5 | ||||
-rw-r--r-- | runtime/doc/various.txt | 7 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 |
4 files changed, 12 insertions, 7 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index cec3c1303f..4f56593491 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -233,11 +233,11 @@ command calls. The |lua-stdlib| modules, user modules, and anything else on The Lua print() function redirects its output to the Nvim message area, with arguments separated by " " (space) instead of "\t" (tab). - *:lua* + *:lua=* *:lua* :lua {chunk} Executes Lua chunk {chunk}. If {chunk} starts with "=" the rest of the - chunk is evaluated as an expression and printed. `:lua =expr` is - equivalent to `:lua print(vim.inspect(expr))` + chunk is evaluated as an expression and printed. `:lua =expr` or `:=expr` is + equivalent to `:lua print(vim.inspect(expr))`. Examples: >vim :lua vim.api.nvim_command('echo "Hello, Nvim!"') diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index c326ae15c7..57b3e00709 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -237,6 +237,11 @@ The following changes to existing APIs or features add new behavior. • The `win_viewport` UI event now contains information about virtual lines, meaning that smooth scrolling can now be implemented more consistenlty. +• The `:= {expr}` syntax can be used to evaluate a lua expression, as + a shorter form of `:lua ={expr}`. `:=` and `:[range]=` without argument + are unchanged. However `:=#` and similar variants using |ex-flags| + are no longer supported. + ============================================================================== REMOVED FEATURES *news-removed* diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index ccde53cc06..8244ae4230 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -173,13 +173,12 @@ g8 Print the hex values of the bytes used in the Like ":z" or ":z!", but number the lines. *:=* -:= [flags] Print the last line number. - See |ex-flags| for [flags]. +:= Without arg: Print the last line number. + with args: equivalent to `:lua ={expr}`. see |:lua| -:{range}= [flags] Prints the last line number in {range}. For example, +:{range}= Prints the last line number in {range}. For example, this prints the current line number: > :.= -< See |ex-flags| for [flags]. :norm[al][!] {commands} *:norm* *:normal* Execute Normal mode commands {commands}. This makes diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 9c01e3dbc7..cd93e4d17a 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -460,6 +460,7 @@ Commands: |:doautocmd| does not warn about "No matching autocommands". |:wincmd| accepts a count. `:write!` does not show a prompt if the file was updated externally. + |:=| does not accept |ex-flags|. With an arg it is equivalent to |:lua=| Command-line: The meanings of arrow keys do not change depending on 'wildoptions'. |