reduce tmux display-message noisiness and add @fingers-show-copied-notification option
This commit is contained in:
parent
abca481d49
commit
55c47402b3
|
@ -86,6 +86,7 @@ NOTE: for changes to take effect, you'll need to source again your `.tmux.conf`
|
|||
* [@fingers-selected-highlight-style](#fingers-selected-highlight-style)
|
||||
* [@fingers-hint-position](#fingers-hint-position)
|
||||
* [@fingers-keyboard-layout](#fingers-keyboard-layout)
|
||||
* [@fingers-show-copied-notification](#fingers-show-copied-notification)
|
||||
|
||||
## @fingers-key
|
||||
|
||||
|
@ -233,6 +234,12 @@ Hints are generated taking optimal finger movement into account. You can choose
|
|||
* `dvorak-right-hand`
|
||||
* `dvorak-homerow`
|
||||
|
||||
## @fingers-show-copied-notification
|
||||
|
||||
`default: 0`
|
||||
|
||||
Show a message using `tmux display-message` notifying about the copied result.
|
||||
|
||||
# Acknowledgements and inspiration
|
||||
|
||||
This plugin is heavily inspired by
|
||||
|
|
|
@ -62,6 +62,8 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
|||
config.backdrop_style = tmux.parse_style(value)
|
||||
when "selected_highlight_style"
|
||||
config.selected_highlight_style = tmux.parse_style(value)
|
||||
when "show_copied_notification"
|
||||
config.show_copied_notification = value
|
||||
end
|
||||
|
||||
if option.match(/pattern/)
|
||||
|
|
|
@ -20,6 +20,7 @@ module Fingers
|
|||
property selected_highlight_style : String
|
||||
property backdrop_style : String
|
||||
property tmux_version : String
|
||||
property show_copied_notification : String
|
||||
|
||||
FORMAT_PRINTER = TmuxStylePrinter.new
|
||||
|
||||
|
@ -76,6 +77,7 @@ module Fingers
|
|||
@selected_highlight_style = FORMAT_PRINTER.print("fg=blue"),
|
||||
@backdrop_style = "",
|
||||
@tmux_version = "",
|
||||
@show_copied_notification = "0",
|
||||
@benchmark_mode = "0"
|
||||
)
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ module Fingers
|
|||
original_pane: original_pane
|
||||
).run
|
||||
|
||||
tmux.display_message("Copied: #{state.result}", 1000) unless state.result.empty?
|
||||
tmux.display_message("Copied: #{state.result}", 1000) if should_notify?
|
||||
end
|
||||
|
||||
private def hide_cursor
|
||||
|
@ -70,8 +70,11 @@ module Fingers
|
|||
state.modifier = modifier
|
||||
match = hinter.lookup(state.input)
|
||||
|
||||
handle_match(match) if match
|
||||
tmux.display_message(state.input, 300)
|
||||
if match
|
||||
handle_match(match)
|
||||
else
|
||||
tmux.display_message(state.input, 300)
|
||||
end
|
||||
end
|
||||
|
||||
private def process_multimode
|
||||
|
@ -102,5 +105,9 @@ module Fingers
|
|||
private def request_exit!
|
||||
state.exiting = true
|
||||
end
|
||||
|
||||
private def should_notify?
|
||||
!state.result.empty? && Fingers.config.show_copied_notification == "1"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue