diff --git a/support/lite/plugins/betterfind.lua b/support/lite/plugins/betterfind.lua new file mode 100644 index 0000000..8c8c7c4 --- /dev/null +++ b/support/lite/plugins/betterfind.lua @@ -0,0 +1,25 @@ +local core = require "core" +local command = require "core.command" +local keymap = require "core.keymap" +local CommandView = require "core.commandview" + +local function is_finding() + return core.active_view:is(CommandView) and core.active_view.label == "Find Text: " +end + +command.add(is_finding, { + ["better-find:done"] = function() core.active_view:submit() end, + ["better-find:next"] = function() + local commandview = core.active_view + commandview.state.submit(commandview:get_text()) + core.set_active_view(core.last_active_view) + command.perform("find-replace:repeat-find") + core.set_active_view(commandview) + end +}) + +keymap.add { + ["escape"] = "better-find:done", + ["return"] = "better-find:next" +} + diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..c2deedc --- /dev/null +++ b/todo.txt @@ -0,0 +1,3 @@ +tooling ideas: +* REPLy buffer (Polywell?) + diff --git a/vendor/lite/data/plugins/betterfind.lua b/vendor/lite/data/plugins/betterfind.lua new file mode 120000 index 0000000..e32350c --- /dev/null +++ b/vendor/lite/data/plugins/betterfind.lua @@ -0,0 +1 @@ +../../../../support/lite/plugins/betterfind.lua \ No newline at end of file