mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
doc: vim.fn, vim.call(), vim.api [ci skip]
This commit is contained in:
@@ -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|
|
||||
|
Reference in New Issue
Block a user