Implement more comfortable "find text" UI

This commit is contained in:
Jeremy Penner 2020-11-21 13:40:47 -05:00
parent d3fc2d1739
commit 998cab3cb8
3 changed files with 29 additions and 0 deletions

View file

@ -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"
}

3
todo.txt Normal file
View file

@ -0,0 +1,3 @@
tooling ideas:
* REPLy buffer (Polywell?)

1
vendor/lite/data/plugins/betterfind.lua vendored Symbolic link
View file

@ -0,0 +1 @@
../../../../support/lite/plugins/betterfind.lua