AutoYADM commit: 2025-05-25 23:24:17
This commit is contained in:
parent
0a7eec16bc
commit
dadf5d2b3e
3 changed files with 61 additions and 40 deletions
|
@ -31,17 +31,36 @@ define-command ui-scrolloff-enable %{
|
|||
|
||||
define-command ui-scrolloff-toggle -docstring "toggle scrolloff" %{
|
||||
evaluate-commands %sh{
|
||||
CUR="$kak_opt_scrolloff"
|
||||
IFS=,
|
||||
read TARG HOR <<<$kak_opt_base_scrolloff
|
||||
IFS=,
|
||||
read VSCROLL _ <<<$kak_opt_scrolloff
|
||||
if [ "$VSCROLL" = 99 ]; then
|
||||
final="$TARG,$HOR"
|
||||
else
|
||||
final="99,$HOR"
|
||||
fi
|
||||
echo "set-option window scrolloff $final"
|
||||
# CUR="$kak_opt_scrolloff"
|
||||
# IFS=,
|
||||
# read TARG HOR <<<$kak_opt_base_scrolloff
|
||||
# IFS=,
|
||||
# read VSCROLL _ <<<$kak_opt_scrolloff
|
||||
# if [ "$VSCROLL" = 99 ]; then
|
||||
# final="$TARG,$HOR"
|
||||
# else
|
||||
# final="99,$HOR"
|
||||
# fi
|
||||
# echo "set-option window scrolloff $final"
|
||||
# Parse base_scrolloff
|
||||
IFS=, set -- $kak_opt_base_scrolloff
|
||||
TARG=${1:-0}
|
||||
HOR=${2:-0}
|
||||
|
||||
# Parse current scrolloff
|
||||
IFS=, set -- $kak_opt_scrolloff
|
||||
VSCROLL=${1:-0}
|
||||
CURHOR=${2:-0}
|
||||
|
||||
# Build the new scrolloff value
|
||||
if [ "$VSCROLL" = 99 ]; then
|
||||
final="$TARG,$HOR"
|
||||
else
|
||||
final="$VSCROLL,$CURHOR"
|
||||
fi
|
||||
|
||||
echo "set-option window scrolloff $final"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue