aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/force_syntax.lua13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/force_syntax.lua b/plugins/force_syntax.lua
index 48a1853..5c1d2eb 100644
--- a/plugins/force_syntax.lua
+++ b/plugins/force_syntax.lua
@@ -103,23 +103,20 @@ end
command.add("core.docview", {
["force-syntax:select-file-syntax"] =
function()
- core.command_view:enter(
- "Set syntax for this file",
- function(text, item) -- submit
+ core.command_view:enter("Set syntax for this file", {
+ submit = function(text, item)
local list, _ = get_syntax_list()
doc().force_syntax = list[item.text]
doc():reset_syntax()
end,
- function(text) -- suggest
+ suggest = function(text)
local _, keylist = get_syntax_list()
local res = common.fuzzy_match(keylist, text)
-- Force Current and Auto detect syntax to the bottom
-- if the text is empty
table.sort(res, #text == 0 and bias_sorter or sorter)
return res
- end,
- nil, -- cancel
- nil -- validate
- )
+ end
+ })
end
})