aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/builtin.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-09-14 08:23:01 -0500
committerGitHub <noreply@github.com>2023-09-14 08:23:01 -0500
commit2e92065686f62851318150a315591c30b8306a4b (patch)
tree3d4d216f7b031cd2e966380f9b32d1aae472d32f /runtime/lua/vim/_meta/builtin.lua
parent9fc321c9768d1a18893e14f46b0ebacef1be1db4 (diff)
downloadrneovim-2e92065686f62851318150a315591c30b8306a4b.tar.gz
rneovim-2e92065686f62851318150a315591c30b8306a4b.tar.bz2
rneovim-2e92065686f62851318150a315591c30b8306a4b.zip
docs: replace <pre> with ``` (#25136)
Diffstat (limited to 'runtime/lua/vim/_meta/builtin.lua')
-rw-r--r--runtime/lua/vim/_meta/builtin.lua48
1 files changed, 26 insertions, 22 deletions
diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua
index d7b76a803c..0a6dd3e151 100644
--- a/runtime/lua/vim/_meta/builtin.lua
+++ b/runtime/lua/vim/_meta/builtin.lua
@@ -131,7 +131,8 @@ function vim.str_utf_pos(str) end
--- The result can be added to {index} to get the starting byte of a character.
---
--- Examples:
---- <pre>lua
+---
+--- ```lua
--- -- The character 'æ' is stored as the bytes '\xc3\xa6' (using UTF-8)
---
--- -- Returns 0 because the index is pointing at the first byte of a character
@@ -139,7 +140,7 @@ function vim.str_utf_pos(str) end
---
--- -- Returns -1 because the index is pointing at the second byte of a character
--- vim.str_utf_start('æ', 2)
---- </pre>
+--- ```
---
--- @param str string
--- @param index number
@@ -150,7 +151,8 @@ function vim.str_utf_start(str, index) end
--- to.
---
--- Examples:
---- <pre>lua
+---
+--- ```lua
--- -- The character 'æ' is stored as the bytes '\xc3\xa6' (using UTF-8)
---
--- -- Returns 0 because the index is pointing at the last byte of a character
@@ -158,7 +160,7 @@ function vim.str_utf_start(str, index) end
---
--- -- Returns 1 because the index is pointing at the penultimate byte of a character
--- vim.str_utf_end('æ', 1)
---- </pre>
+--- ```
---
--- @param str string
--- @param index number
@@ -204,7 +206,8 @@ function vim.schedule(callback) end
--- this time.
---
--- Examples:
---- <pre>lua
+---
+--- ```lua
---
--- ---
--- -- Wait for 100 ms, allowing other events to process
@@ -226,7 +229,7 @@ function vim.schedule(callback) end
--- if vim.wait(10000, function() return vim.g.timer_result end) then
--- print('Only waiting a little bit of time!')
--- end
---- </pre>
+--- ```
---
--- @param time integer Number of milliseconds to wait
--- @param callback? fun(): boolean Optional callback. Waits until {callback} returns true
@@ -258,22 +261,23 @@ function vim.wait(time, callback, interval, fast_only) end
--- likewise experimental).
---
--- Example (stub for a |ui-popupmenu| implementation):
---- <pre>lua
----
---- ns = vim.api.nvim_create_namespace('my_fancy_pum')
----
---- vim.ui_attach(ns, {ext_popupmenu=true}, function(event, ...)
---- if event == "popupmenu_show" then
---- local items, selected, row, col, grid = ...
---- print("display pum ", #items)
---- elseif event == "popupmenu_select" then
---- local selected = ...
---- print("selected", selected)
---- elseif event == "popupmenu_hide" then
---- print("FIN")
---- end
---- end)
---- </pre>
+---
+--- ```lua
+--- ns = vim.api.nvim_create_namespace('my_fancy_pum')
+---
+--- vim.ui_attach(ns, {ext_popupmenu=true}, function(event, ...)
+--- if event == "popupmenu_show" then
+--- local items, selected, row, col, grid = ...
+--- print("display pum ", #items)
+--- elseif event == "popupmenu_select" then
+--- local selected = ...
+--- print("selected", selected)
+--- elseif event == "popupmenu_hide" then
+--- print("FIN")
+--- end
+--- end)
+--- ```
+---
--- @param ns integer
--- @param options table<string, any>
--- @param callback fun()