punkfairie
60cb5740d7
Add .config/fish/functions/__ysu__check_aliases.fish Add .config/fish/functions/__ysu__check_git_aliases.fish Add .config/fish/functions/__ysu__check_hardcore.fish Add .config/fish/functions/__ysu__flush_buffer.fish Add .config/fish/functions/__ysu__get_field.fish Add .config/fish/functions/__ysu__message.fish Add .config/fish/functions/__ysu__set_default.fish Add .config/fish/functions/__ysu__set_field.fish Add .config/fish/functions/__ysu__write_buffer.fish
18 lines
503 B
Fish
18 lines
503 B
Fish
function __ysu__write_buffer \
|
||
--argument-names contents
|
||
set --global __BUFFER "$contents$__BUFFER\n"
|
||
|
||
set --local position "before"
|
||
if set -q YSU__MESSAGE_POSITION
|
||
set position "$YSU__MESSAGE_POSITION"
|
||
end
|
||
|
||
if [ "$position" = "before" ]
|
||
__ysu__flush_buffer
|
||
else if [ "$position" != "after" ]
|
||
echo "\
|
||
$RED$BOLDUnknown value for MESSAGE_POSITION $YSU__MESSAGE_POSITION
|
||
Expected value 'before' or 'after'"
|
||
__ysu__flush_buffer
|
||
end
|
||
end
|