diff --git a/README.md b/README.md index b0df120a0..875c35134 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,8 @@ require('llembas').apply(config, { private = { key = 'H', mods = 'CTRL|SHIFT' }, ide = { key = 'E', mods = 'CTRL|SHIFT' }, model = { key = 'M', mods = 'CTRL|SHIFT' }, -- the list of chat models - ac_model = { key = 'M', mods = 'CTRL|ALT' }, -- the list of autocomplete models + ac_model = { key = 'm', mods = 'CTRL|ALT' }, -- the list of autocomplete models (a capital + -- letter means the key with Shift) mode_next = { key = 'Tab', mods = 'CTRL' }, -- on the ask line: the other mode palette = { key = 'P', mods = 'CTRL|SHIFT|ALT' }, -- the terminal's command palette, once more ask_screen = false, always = false, new = false, mode = false, diff --git a/llembas/lua/llembas/core.lua b/llembas/lua/llembas/core.lua index cf6bef6fc..334e391ce 100644 --- a/llembas/lua/llembas/core.lua +++ b/llembas/lua/llembas/core.lua @@ -120,7 +120,9 @@ function M.defaults() private = { key = 'H', mods = 'CTRL|SHIFT' }, ide = { key = 'E', mods = 'CTRL|SHIFT' }, model = { key = 'M', mods = 'CTRL|SHIFT' }, -- the list of chat models - ac_model = { key = 'M', mods = 'CTRL|ALT' }, -- the list of autocomplete models + -- the list of autocomplete models. A small letter: the terminal reads a capital as + -- the key with Shift, which this chord does not have + ac_model = { key = 'm', mods = 'CTRL|ALT' }, -- On the ask line: the other mode (manual, auto). Anywhere else the key does what it -- did before (Ctrl+Tab: the next tab). mode_next = { key = 'Tab', mods = 'CTRL' }, diff --git a/llembas/tests/run.lua b/llembas/tests/run.lua index 0b17a0f30..381050b5a 100644 --- a/llembas/tests/run.lua +++ b/llembas/tests/run.lua @@ -150,7 +150,7 @@ test('options: defaults', function() eq(o.keys.cli.key, 'S', 'the CLI key') eq(o.keys.ai.key, 'I', 'the switch') eq(o.keys.model.key .. ' ' .. o.keys.model.mods, 'M CTRL|SHIFT', 'the list of chat models') - eq(o.keys.ac_model.key .. ' ' .. o.keys.ac_model.mods, 'M CTRL|ALT', 'the list of autocomplete models') + eq(o.keys.ac_model.key .. ' ' .. o.keys.ac_model.mods, 'm CTRL|ALT', 'the list of autocomplete models: a small letter, no Shift') eq(o.keys.mode_next.key .. ' ' .. o.keys.mode_next.mods, 'Tab CTRL', 'the other mode, on the ask line') eq(o.keys.palette.mods, 'CTRL|SHIFT|ALT', "the terminal's palette on a chord of its own") eq(o.keys.mode, false, 'the list of modes has no key until given one') @@ -971,7 +971,7 @@ test('apply: keys, events, and nothing else happens', function() end end eq(bound['CTRL|SHIFT+M'], 'llembas-model-key', 'the list of chat models') - eq(bound['CTRL|ALT+M'], 'llembas-autocomplete-model-key', 'the list of autocomplete models') + eq(bound['CTRL|ALT+m'], 'llembas-autocomplete-model-key', 'the list of autocomplete models') eq(bound['CTRL+Tab'], 'llembas-mode-next-key', 'the other mode') eq(bound['CTRL|SHIFT|ALT+P'], 'llembas-palette', "the terminal's palette, never handed on") eq(bound['CTRL|SHIFT+P'], 'llembas-pass-ctrl-shift-p', 'the palette chord is the IDE\'s while it is in front') diff --git a/llembas/tests/smoke.sh b/llembas/tests/smoke.sh index 7ecbda0b6..857e0c027 100755 --- a/llembas/tests/smoke.sh +++ b/llembas/tests/smoke.sh @@ -96,7 +96,7 @@ if [ "$P" = LLEMBAS_TERM ]; then if keys="$(clean "$TERMINAL" show-keys --lua 2>"$work/keys-err.txt")"; then expect "built-in configuration binds the ask key" "$keys" "llembas-ask" expect "the key for the list of chat models" "$keys" "key = 'M', action = act.EmitEvent 'llembas-model-key'" - expect "the key for the list of autocomplete models" "$keys" "key = 'M', action = act.EmitEvent 'llembas-autocomplete-model-key'" + expect "the key for the list of autocomplete models" "$keys" "mods = 'ALT\|CTRL', key = 'm', action = act.EmitEvent 'llembas-autocomplete-model-key'" expect "the mode key" "$keys" "llembas-mode-next-key" expect "the palette chord, which LLeMbas IDE has too" "$keys" "key = 'P', action = act.EmitEvent 'llembas-pass-ctrl-shift-p'" expect "the terminal's palette on a chord of its own" "$keys" "key = 'P', action = act.EmitEvent 'llembas-palette'"