haberdashPI / vscode-master-key

Master your keybindings with documentation, discoverability, modal bindings, macros and expressive configuration
Other
7 stars 1 forks source link

update mode default resolution logic to overwrite, not merge #35

Closed bhainesva closed 1 month ago

bhainesva commented 1 month ago

Fixes #34. I used the lodash functions instead of object splatting so I didn't have to deal with typing the function 😬.

Tested with the following config to ensure that modes were overridden, but args / computed args were merged.

[header]
name = "Debug Key Bindings"
version = "1.0"

[[mode]]
name = "a"
default = true

[[mode]]
name = "b"

[[path]]
id = "actions"
name = "Actions"
default.mode = ["a", "b"]
default.args.to = "up"
default.args.select = false

[[bind]]
path = "actions"
key = "x"
name = "x"
command = "cursorMove"
args = { to = "down"}
mode = ["a"]

[[bind]]
path = "actions"
key = "x"
name = "x"
command = "cursorMove"
computedArgs = { select = true }
mode = ["b"]
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.15%. Comparing base (b01929e) to head (b78b984). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #35 +/- ## ========================================== + Coverage 78.09% 78.15% +0.06% ========================================== Files 24 24 Lines 2328 2326 -2 Branches 468 467 -1 ========================================== Hits 1818 1818 + Misses 318 317 -1 + Partials 192 191 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

haberdashPI commented 1 month ago

Awesome, thanks for getting this started! I've made a few small adjustments, and I've added a formal test. (Current commit runs just that test to verify it runs on CI).