diff options
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/_editor.lua | 10 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 10 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/ui.lua | 2 |
5 files changed, 17 insertions, 11 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index d4db4850bd..8e372b806c 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -174,11 +174,11 @@ do if vim.fn.getcmdtype() ~= '' then -- cmdline-mode: paste only 1 line. if not got_line1 then got_line1 = (#lines > 1) - vim.api.nvim_set_option('paste', true) -- For nvim_input(). - -- Escape "<" and control characters - local line1 = lines[1]:gsub('<', '<lt>'):gsub('(%c)', '\022%1') - vim.api.nvim_input(line1) - vim.api.nvim_set_option('paste', false) + -- Escape control characters + local line1 = lines[1]:gsub('(%c)', '\022%1') + -- nvim_input() is affected by mappings, + -- so use nvim_feedkeys() with "n" flag to ignore mappings. + vim.api.nvim_feedkeys(line1, 'n', true) end return true end diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 603f9f854a..d8d4afb6c2 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -103,6 +103,11 @@ local extension = { cbl = "cobol", atg = "coco", recipe = "conaryrecipe", + hook = function(path, bufnr) + if getline(bufnr, 1) == '[Trigger]' then + return "conf" + end + end, mklx = "context", mkiv = "context", mkii = "context", @@ -436,6 +441,7 @@ local extension = { xin = "omnimark", opam = "opam", ["or"] = "openroad", + scad = "openscad", ora = "ora", org = "org", org_archive = "org", @@ -902,7 +908,7 @@ local filename = { Dockerfile = "dockerfile", npmrc = "dosini", ["/etc/yum.conf"] = "dosini", - ["/etc/pacman.conf"] = "dosini", + ["/etc/pacman.conf"] = "conf", [".npmrc"] = "dosini", [".editorconfig"] = "dosini", dune = "dune", @@ -1181,7 +1187,7 @@ local pattern = { [".*/etc/DIR_COLORS"] = "dircolors", [".*/etc/dnsmasq%.conf"] = "dnsmasq", ["php%.ini%-.*"] = "dosini", - [".*/etc/pacman%.conf"] = "dosini", + [".*/etc/pacman%.conf"] = "conf", [".*/etc/yum%.conf"] = "dosini", [".*lvs"] = "dracula", [".*lpe"] = "dracula", diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index f5aefd4402..9871f00677 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -141,7 +141,7 @@ M['workspace/configuration'] = function(_, result, ctx) local response = {} for _, item in ipairs(result.items) do if item.section then - local value = util.lookup_section(client.config.settings, item.section) or vim.NIL + local value = util.lookup_section(client.config.settings, item.section) -- For empty sections with no explicit '' key, return settings as is if value == vim.NIL and item.section == '' then value = client.config.settings or vim.NIL diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 401dac9acd..30587afb38 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1950,8 +1950,8 @@ end function M.lookup_section(settings, section) for part in vim.gsplit(section, '.', true) do settings = settings[part] - if not settings then - return + if settings == nil then + return vim.NIL end end return settings diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 9d4b38f08a..165dada1b8 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -16,7 +16,7 @@ local M = {} --- `items`, or the context in which select() was called. ---@param on_choice function ((item|nil, idx|nil) -> ()) --- Called once the user made a choice. ---- `idx` is the 1-based index of `item` within `item`. +--- `idx` is the 1-based index of `item` within `items`. --- `nil` if the user aborted the dialog. --- --- |