Skip to content

Conversation

justinmk
Copy link
Member

@justinmk justinmk commented Nov 12, 2019

  • Add :help :lua-heredoc
  • Rework :help lua-commands
  • Rename if_lua.txt => lua.txt

@@ -167,16 +167,15 @@ end
---
--- Example: To remove ANSI color codes when pasting:
--- <pre>
--- vim.paste = (function()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be more idiomatic Lua to do

do
  local overriden = vim.paste
  vim.paste = function(lines, phase)
    ...
  end
end

This is more of a lua-style question, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to discuss that over here? #11312

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@norcalli the "js style" in this PR saves a line. But the do-end thing is good to mention somewhere, and makes sense for cases where a function isn't being defined, IMO

- Rework :help lua-commands
- Rename if_lua.txt => lua.txt
@justinmk justinmk changed the title WIP: doc [ci skip] doc [ci skip] Nov 18, 2019
@justinmk justinmk merged commit af53a0c into neovim:master Nov 18, 2019
@justinmk justinmk deleted the doc branch November 18, 2019 03:07
@SolaWing
Copy link
Contributor

SolaWing commented Apr 3, 2021

I find that doc declare module conflicts for runtimepath as last wins. but in my test, it's first wins.
Also, similar to runtime to load vim file, it's also first wins.

so may need to fix the doc?

Module conflicts are resolved by "last wins".  For example if both of these
are on 'runtimepath':
    runtime/lua/foo.lua
    ~/.config/nvim/lua/foo.lua
then `require('foo')` loads "~/.config/nvim/lua/foo.lua", and
"runtime/lua/foo.lua" is not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants