aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/fs.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/fs.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/fs.lua')
-rw-r--r--runtime/lua/vim/fs.lua27
1 files changed, 15 insertions, 12 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua
index 7cd9e3cf04..22612a7255 100644
--- a/runtime/lua/vim/fs.lua
+++ b/runtime/lua/vim/fs.lua
@@ -5,7 +5,8 @@ local iswin = vim.uv.os_uname().sysname == 'Windows_NT'
--- Iterate over all the parents of the given path.
---
--- Example:
---- <pre>lua
+---
+--- ```lua
--- local root_dir
--- for dir in vim.fs.parents(vim.api.nvim_buf_get_name(0)) do
--- if vim.fn.isdirectory(dir .. "/.git") == 1 then
@@ -17,7 +18,7 @@ local iswin = vim.uv.os_uname().sysname == 'Windows_NT'
--- if root_dir then
--- print("Found git repository at", root_dir)
--- end
---- </pre>
+--- ```
---
---@param start (string) Initial path.
---@return fun(_, dir: string): string? # Iterator
@@ -165,7 +166,8 @@ end
--- to narrow the search to find only that type.
---
--- Examples:
---- <pre>lua
+---
+--- ```lua
--- -- location of Cargo.toml from the current buffer's path
--- local cargo = vim.fs.find('Cargo.toml', {
--- upward = true,
@@ -183,7 +185,7 @@ end
--- local cpp_hpp = vim.fs.find(function(name, path)
--- return name:match('.*%.[ch]pp$') and path:match('[/\\\\]lib$')
--- end, {limit = math.huge, type = 'file'})
---- </pre>
+--- ```
---
---@param names (string|string[]|fun(name: string, path: string): boolean) Names of the items to find.
--- Must be base names, paths and globs are not supported when {names} is a string or a table.
@@ -322,16 +324,17 @@ end
--- variables are also expanded.
---
--- Examples:
---- <pre>lua
---- vim.fs.normalize('C:\\\\Users\\\\jdoe')
---- --> 'C:/Users/jdoe'
---
---- vim.fs.normalize('~/src/neovim')
---- --> '/home/jdoe/src/neovim'
+--- ```lua
+--- vim.fs.normalize('C:\\\\Users\\\\jdoe')
+--- -- 'C:/Users/jdoe'
+---
+--- vim.fs.normalize('~/src/neovim')
+--- -- '/home/jdoe/src/neovim'
---
---- vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
---- --> '/Users/jdoe/.config/nvim/init.vim'
---- </pre>
+--- vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
+--- -- '/Users/jdoe/.config/nvim/init.vim'
+--- ```
---
---@param path (string) Path to normalize
---@param opts table|nil Options: