mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-23 20:13:05 +03:00
Fixed git_prompt bug, thank god
This commit is contained in:
parent
305cc12f54
commit
1c286fc473
11
conf.d/lean_cursor_movement.fish
Normal file
11
conf.d/lean_cursor_movement.fish
Normal file
@ -0,0 +1,11 @@
|
||||
function _cursor_up -a number
|
||||
if test $number -gt 0
|
||||
printf '\033['$number'A'
|
||||
end
|
||||
end
|
||||
|
||||
function _cursor_right -a number
|
||||
if test $number -gt 0
|
||||
printf '\033['$number'C'
|
||||
end
|
||||
end
|
@ -1,6 +1,7 @@
|
||||
function local_install -a localRepo
|
||||
source "$localRepo/install.fish"; and _set_lean_defaults
|
||||
|
||||
cp -r "$localRepo/conf.d" $__fish_config_dir
|
||||
cp -r "$localRepo/functions" $__fish_config_dir
|
||||
cp -r "$localRepo/lean_theme" $__fish_config_dir
|
||||
cp -r "$localRepo/tests" $__fish_config_dir
|
||||
|
@ -1,5 +0,0 @@
|
||||
function _up -a number
|
||||
if test $number -ne 0
|
||||
echo -ne '\033['$number'A'
|
||||
end
|
||||
end
|
@ -13,7 +13,6 @@ function fish_prompt --description 'Write out the prompt'
|
||||
|
||||
printf '\r'
|
||||
lean_right_prompt
|
||||
_up $lean_left_prompt_height
|
||||
|
||||
printf '\r'
|
||||
lean_left_prompt
|
||||
|
@ -5,7 +5,7 @@ function lean_left_prompt
|
||||
set -l itemOutput (_$item)
|
||||
|
||||
if test -n "$itemOutput"
|
||||
echo -ne $itemOutput
|
||||
printf $itemOutput
|
||||
end
|
||||
if test $item = 'lean_newline'
|
||||
set -U lean_left_prompt_height (math $lean_left_prompt_height+1)
|
||||
|
@ -1,19 +1,21 @@
|
||||
function lean_right_prompt
|
||||
set -l splitText (string split '\n' (_fetch_right_prompt_items))
|
||||
|
||||
for thing in $splitText[1..-2]
|
||||
_print_at_end $thing
|
||||
end
|
||||
if test (count $splitText) -eq $lean_left_prompt_height
|
||||
set -g fishRightPromptRun $splitText[-1]
|
||||
set -g lean_right_prompt_fish $splitText[-1]
|
||||
else
|
||||
_print_at_end $splitText[-1]
|
||||
set -g fishRightPromptRun ''
|
||||
set -g lean_right_prompt_fish ''
|
||||
end
|
||||
echo
|
||||
|
||||
_cursor_up (math $lean_left_prompt_height-1)
|
||||
end
|
||||
|
||||
function fish_right_prompt
|
||||
echo $fishRightPromptRun
|
||||
echo $lean_right_prompt_fish
|
||||
end
|
||||
|
||||
function _fetch_right_prompt_items
|
||||
@ -32,6 +34,9 @@ end
|
||||
|
||||
function _print_at_end -a text
|
||||
set -l startLocation (math $COLUMNS-(string length (lean_decolor $text)))
|
||||
echo -ne '\033['$startLocation'C'
|
||||
echo $text
|
||||
_cursor_right $startLocation
|
||||
echo -n $text
|
||||
|
||||
printf '\v'
|
||||
printf '\r'
|
||||
end
|
Loading…
Reference in New Issue
Block a user