doc: vim.fn, vim.call(), vim.api [ci skip]

This commit is contained in:
Justin M. Keyes
2019-10-27 15:05:59 -07:00
parent c66297452c
commit 9ef16a1628
11 changed files with 241 additions and 97 deletions

View File

@@ -165,6 +165,20 @@ end
--- Paste handler, invoked by |nvim_paste()| when a conforming UI
--- (such as the |TUI|) pastes text into the editor.
---
--- Example: To remove ANSI color codes when pasting:
--- <pre>
--- vim.paste = (function()
--- local overridden = vim.paste
--- return function(lines, phase)
--- for i,line in ipairs(lines) do
--- -- Scrub ANSI color codes from paste input.
--- lines[i] = line:gsub('\27%[[0-9;mK]+', '')
--- end
--- overridden(lines, phase)
--- end
--- end)()
--- </pre>
---
--@see |paste|
---
--@param lines |readfile()|-style list of lines to paste. |channel-lines|