mirror of
https://github.com/IlanCosman/tide.git
synced 2024-08-15 19:20:22 +03:00
Merge f35461a077
into 44c521ab29
This commit is contained in:
commit
014122e8ce
@ -3,10 +3,12 @@ function _tide_item_character
|
|||||||
|
|
||||||
set -q add_prefix || echo -ns ' '
|
set -q add_prefix || echo -ns ' '
|
||||||
|
|
||||||
test "$fish_key_bindings" = fish_default_key_bindings && echo -ns $tide_character_icon ||
|
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||||
|
test $_tide_status = 0 && echo -ns $tide_character_icon || echo -ns $tide_character_icon_failure
|
||||||
|
else
|
||||||
switch $fish_bind_mode
|
switch $fish_bind_mode
|
||||||
case insert
|
case insert
|
||||||
echo -ns $tide_character_icon
|
test $_tide_status = 0 && echo -ns $tide_character_icon || echo -ns $tide_character_icon_failure
|
||||||
case default
|
case default
|
||||||
echo -ns $tide_character_vi_icon_default
|
echo -ns $tide_character_vi_icon_default
|
||||||
case replace replace_one
|
case replace replace_one
|
||||||
@ -14,4 +16,5 @@ function _tide_item_character
|
|||||||
case visual
|
case visual
|
||||||
echo -ns $tide_character_vi_icon_visual
|
echo -ns $tide_character_vi_icon_visual
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
tide_aws_icon # Actual aws glyph is harder to see
|
tide_aws_icon # Actual aws glyph is harder to see
|
||||||
tide_bun_icon
|
tide_bun_icon
|
||||||
tide_character_icon ❯
|
tide_character_icon ❯
|
||||||
|
tide_character_icon_failure ❯
|
||||||
tide_character_vi_icon_default ❮
|
tide_character_vi_icon_default ❮
|
||||||
tide_character_vi_icon_replace ▶
|
tide_character_vi_icon_replace ▶
|
||||||
tide_character_vi_icon_visual V
|
tide_character_vi_icon_visual V
|
||||||
|
180
tests/_tide_item_character.test.fish
Normal file
180
tests/_tide_item_character.test.fish
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
# RUN: %fish %s
|
||||||
|
_tide_parent_dirs
|
||||||
|
|
||||||
|
function _character
|
||||||
|
set -lx _tide_status $status
|
||||||
|
set -lx _tide_pipestatus $pipestatus
|
||||||
|
_tide_decolor (_tide_item_character)
|
||||||
|
end
|
||||||
|
|
||||||
|
set -lx tide_character_icon_failure ✘
|
||||||
|
|
||||||
|
# Check icons while fish_key_bindings is fish_default_key_bindings
|
||||||
|
set -lx fish_key_bindings fish_default_key_bindings
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
# Check icons while fish_key_bindings isn't fish_default_key_bindings
|
||||||
|
set -lx fish_key_bindings something_else
|
||||||
|
# Check icons while fish_bind_mode is default
|
||||||
|
set -lx fish_bind_mode default
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: ❮
|
||||||
|
|
||||||
|
# Check icons while fish_bind_mode is insert
|
||||||
|
set -lx fish_bind_mode insert
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: ❯
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: ✘
|
||||||
|
|
||||||
|
# Check icons while fish_bind_mode is replace
|
||||||
|
set -lx fish_bind_mode replace
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
# Check icons while fish_bind_mode is replace_one
|
||||||
|
set -lx fish_bind_mode replace_one
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: ▶
|
||||||
|
|
||||||
|
# Check icons while fish_bind_mode is visual
|
||||||
|
set -lx fish_bind_mode visual
|
||||||
|
|
||||||
|
true
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
false
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
true | false
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
true | true
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
false | true
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
false | false
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
# Check that not command works
|
||||||
|
not true | false
|
||||||
|
_character # CHECK: V
|
||||||
|
|
||||||
|
not false | true
|
||||||
|
_character # CHECK: V
|
Loading…
Reference in New Issue
Block a user