From 9fa923bf92e56f51079e10b4144fb9c8dd24b1d9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 14 Nov 2025 20:13:32 +0530 Subject: Change repl modes to respect scope --- autoload/marks.kak | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'autoload/marks.kak') diff --git a/autoload/marks.kak b/autoload/marks.kak index 2f58c22..e1f7d72 100644 --- a/autoload/marks.kak +++ b/autoload/marks.kak @@ -1,3 +1,11 @@ +define-command marks-select -params 1 %{ + evaluate-commands %sh{ + mark=$("$kak_config/scripts/marks.fnl" get "${1:-0}") + [ -z "$mark" ] || echo "edit $mark" + } + marks-show +} + define-command marks-add -params 1..2 %{ nop %sh{ "$kak_config/scripts/marks.fnl" add "$1" "$2" } marks-show @@ -29,17 +37,9 @@ define-command marks-show %{ } } -define-command marks-switch -params 1 %{ - evaluate-commands %sh{ - mark=$("$kak_config/scripts/marks.fnl" get "${1:-0}") - [ -z "$mark" ] || echo "edit $mark" - } - marks-show -} - declare-user-mode marks map global user a ': enter-user-mode-with-count marks' -docstring 'Marks mode' -map global user ': marks-switch %val{count}' -docstring 'Switch marks' +map global user ': marks-select %val{count}' -docstring 'Select marks' map global marks a ': marks-add %val{buffile} %opt{user_mode_count}' -docstring 'Create new mark from buffer' map global marks d ': marks-delete %val{buffile}' -docstring 'Delete mark' map global marks C ': marks-clear' -docstring 'Clear mark' -- cgit v1.3.1