new feature: change behavior of sidebar channel buttons to toggle.
clicking on a channel in the sidebar with an open pane closes the pane. Sidebar channel buttons are now effectively toggles.
#466
I like the idea here, but I think it would be best to make it a configuration option. I know some users of the new-pane and replace-pane settings for default_action would prefer not to have this behavior, so I suggest we add a toggle-pane setting that will cover this use case.
I'd also like to see if we can address #451 in this PR, which is similar but not exactly the same. If the two ideas can be merged that'd be ideal, but if they're truly incompatible we could add a fourth default_action.
- Added the associated config option.
- Moved hacked Open code to its own event sequence.
- Added documentation for the config option.\
- Did not tackle #451 as I do not know the required behavior to meet it.
- I carelessly merged...
I removed the pane_toggling config since your update to DefaultAction means default_action = "toggle-pane" will set the configuration. Otherwise I just reorganized it a bit.
Looks good to me, but let's see if we need to implement a "focus before close" setting.
If I understand correctly, the first setting would describe the type of open action made when clicking, and the second would describe the action made when clicking on a buffer with the focused state. Since they describe slightly different concepts, maybe they should have distinct styling. Something like, open_action and focused_buffer? Or focused_buffer_action?
If I understand correctly, the first setting would describe the type of open action made when clicking, and the second would describe the action made when clicking on a buffer with the focused state. Since they describe slightly different concepts, maybe they should have distinct styling. Something like,
open_actionandfocused_buffer? Orfocused_buffer_action?
Yes! What about:
buffer_action and focused_buffer_action to keep it similar?
thanks accepting my suggestion and the help.
I completely missed the ability to minimize changes by reusing messages regarding opening and close buffers.
Yes! What about:
buffer_actionandfocused_buffer_actionto keep it similar?
Sounds good to me! Did you want to take a crack at the refactor @neutralparadoxdev? Happy to help, of course, but it's all yours if you want.
@neutralparadoxdev, I rebased and updated this PR to make it ready for review. Here's what I did:
- Renamed
default_actiontobuffer_action. - Added a
buffer_focused_actionwhich is a optional enum which hasclose-panevariant. By default this is not set.- When you set
buffer_focused_action = "close-pane"it will close a focused buffer, when pressed.
- When you set
@andymandias take a look if this make sense to you - I kinda like this new setting.
Sorry, this was a mistake. I'll reopen.