Skip to content

Improve keybindings consistency

As pointed out in #83 (closed), Mousepad 0.5.1 has a bug in the keybinding to paste text in the search entry. This is a regression caused by 27c4216f, where I went a bit too fast, even though this was a legitimate commit.

Indeed, more generally, there is an old inconsistency between text view keybindings and text entries keybindings (search bar and replace dialog), so that they are not fully configurable via accels.scm, and conflicts may appear between them, like the one in the regression above or another one discussed recently in !57 (merged).

This MR is meant to be a general solution to this problem, allowing to customize all keybindings (without excluding e.g. "Select All" like in !57 (merged)) with consistency between the text view and search widgets text entries.

This is achieved essentially by two means:

  • restrict the scope of window editing actions that may conflict with text entries keybindings to the text view (based on focus);
  • override text entries keybindings with those of the corresponding actions following user customizations in accels.scm (using GtkBindingSet).

Side note: To be consistent with what is done for the text view, I did not replace text entries keybindings with those set in accels.scm, I simply added the latter. I think we can leave this as is, but it could easily be changed using gtk_binding_entry_skip() (applied to the text view and the text entries).

Edited by Gaël Bonithon

Merge request reports