AutoYADM commit: 2025-05-26 01:28:38
This commit is contained in:
parent
8b77acf426
commit
ecb67ff683
2 changed files with 38 additions and 55 deletions
|
@ -32,37 +32,19 @@ 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"
|
||||
# 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"
|
||||
final="$TARG"
|
||||
else
|
||||
final="$VSCROLL,$CURHOR"
|
||||
final="99,$HOR"
|
||||
fi
|
||||
|
||||
echo "set-option window scrolloff $final"
|
||||
notify-send "$final"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue