diff options
author | Javier Lopez <graulopezjavier@gmail.com> | 2022-07-19 10:12:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 09:12:10 -0600 |
commit | 61302fb39106424997626359df826051df3f202e (patch) | |
tree | 5cb76c174ad2200cd9ffceabe5db5fa12f331df0 | |
parent | b154d951e6c01919278bf77a4079396c2df471f4 (diff) | |
download | rneovim-61302fb39106424997626359df826051df3f202e.tar.gz rneovim-61302fb39106424997626359df826051df3f202e.tar.bz2 rneovim-61302fb39106424997626359df826051df3f202e.zip |
docs: fix vim.filetype.add by avoiding quotes (#19433)
* Problem
Quotes are special in doxygen, and should be escaped. *Sometimes* they
cause doc generation issues. Like in #17785
* Solution
Replace double quotes with single quotes
-rw-r--r-- | runtime/doc/lua.txt | 24 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 089cf0ce9d..aeb1699908 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2029,30 +2029,30 @@ add({filetypes}) *vim.filetype.add()* vim.filetype.add({ extension = { - foo = "fooscript", + foo = 'fooscript', bar = function(path, bufnr) if some_condition() then - return "barscript", function(bufnr) + return 'barscript', function(bufnr) -- Set a buffer variable vim.b[bufnr].barscript_version = 2 end end - return "bar" + return 'bar' end, }, filename = { - [".foorc"] = "toml", - ["/etc/foo/config"] = "toml", + ['.foorc'] = 'toml', + ['/etc/foo/config'] = 'toml', }, pattern = { - [".*‍/etc/foo/.*"] = "fooscript", + ['.*/etc/foo/.*'] = 'fooscript', -- Using an optional priority - [".*‍/etc/foo/.*%.conf"] = { "dosini", { priority = 10 } }, - ["README.(%a+)$"] = function(path, bufnr, ext) - if ext == "md" then - return "markdown" - elseif ext == "rst" then - return "rst" + ['.*/etc/foo/.*%.conf'] = { 'dosini', { priority = 10 } }, + ['README.(a+)$'] = function(path, bufnr, ext) + if ext == 'md' then + return 'markdown' + elseif ext == 'rst' then + return 'rst' end end, }, diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 70c8cd15eb..c2dcc2a2c8 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2241,30 +2241,30 @@ end --- <pre> --- vim.filetype.add({ --- extension = { ---- foo = "fooscript", +--- foo = 'fooscript', --- bar = function(path, bufnr) --- if some_condition() then ---- return "barscript", function(bufnr) +--- return 'barscript', function(bufnr) --- -- Set a buffer variable --- vim.b[bufnr].barscript_version = 2 --- end --- end ---- return "bar" +--- return 'bar' --- end, --- }, --- filename = { ---- [".foorc"] = "toml", ---- ["/etc/foo/config"] = "toml", +--- ['.foorc'] = 'toml', +--- ['/etc/foo/config'] = 'toml', --- }, --- pattern = { ---- [".*/etc/foo/.*"] = "fooscript", +--- ['.*/etc/foo/.*'] = 'fooscript', --- -- Using an optional priority ---- [".*/etc/foo/.*%.conf"] = { "dosini", { priority = 10 } }, ---- ["README.(%a+)$"] = function(path, bufnr, ext) ---- if ext == "md" then ---- return "markdown" ---- elseif ext == "rst" then ---- return "rst" +--- ['.*/etc/foo/.*%.conf'] = { 'dosini', { priority = 10 } }, +--- ['README.(%a+)$'] = function(path, bufnr, ext) +--- if ext == 'md' then +--- return 'markdown' +--- elseif ext == 'rst' then +--- return 'rst' --- end --- end, --- }, |