]> git.gir.st - VimFx.git/commit
Improve keyboard shortcut overriding behavior
authorSimon Lydell <simon.lydell@gmail.com>
Sun, 11 Oct 2015 16:41:08 +0000 (18:41 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Sun, 11 Oct 2015 17:00:50 +0000 (19:00 +0200)
commita0bb23020cde1c12264e2aa4eee314c010310d26
tree9ad4298f86dab749cebe8454bb3d67b142d86fd5
parent7687d1400db741e63d6ee2cb2a794199d5fe7f7f
Improve keyboard shortcut overriding behavior

- When the feature was initially implemented, it was modeled after putting a
  series of `map` commands after each other in .vimrc, which is written in a
  procedural programming language. Then it makes sense that latter `map` calls
  override earlier ones. That's why VimFx used to let commands further down the
  list in VimFx's settings page in the Add-ons Manager override earlier
  commands. The more I used it, though, that didn't feel entirely natural. After
  a while I realized that in such an interface it makes sense having _earlier_
  commands win. With this commit, latter commands _don't_ override earlier ones
  anymore, and are ignored, showing an error message.

- The above point also means that editing a shortcut can never result in error
  messages appearing _above_ that command. If you add `g` to a shortcut near the
  end of the list, there used to appear an error message for every shortcut
  starting with `g` above it (which is quite a few), causing dis-orientation
  when the focused text box was moved down because of all those error messages.

- With this commit, the order of the modes, categories and commands is taken
  into account. That used to work only when the user hadn't customized the
  orders or hadn't added new modes, categories and/or commands.

- A small fix for `<force>` is also included. If a shortcut contains invalid
  usage of `<force>` it is now properly ignored (still showing an error
  message).
documentation/api.md
extension/lib/vimfx.coffee
extension/test/test-api.coffee
Imprint / Impressum