dotfiles/dot_config/fish/functions/__ysu__write_buffer.fish
punkfairie 60cb5740d7
Add .config/fish/conf.d/you_should_use.fish
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
2024-04-20 11:11:33 -07:00

18 lines
503 B
Fish
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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