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