TryBindKeyPlug tries to bind a key for the plugin without writing to bindings.json. This operation can be rejected by lockbindings to prevent unexpected actions by the user.
(k, v string, overwrite bool)
| 264 | // TryBindKeyPlug tries to bind a key for the plugin without writing to bindings.json. |
| 265 | // This operation can be rejected by lockbindings to prevent unexpected actions by the user. |
| 266 | func TryBindKeyPlug(k, v string, overwrite bool) (bool, error) { |
| 267 | if l, ok := config.GlobalSettings["lockbindings"]; ok && l.(bool) { |
| 268 | return false, errors.New("bindings is locked by the user") |
| 269 | } |
| 270 | return TryBindKey(k, v, overwrite, false) |
| 271 | } |
| 272 | |
| 273 | // TryBindKey tries to bind a key by writing to config.ConfigDir/bindings.json |
| 274 | // Returns true if the keybinding already existed or is binded successfully and a possible error |
nothing calls this directly
no test coverage detected