@@ 106,7 106,8 @@ qpush()
fi
read -rp "Title: " title
- read -rp "Desc: " desc
+ write_desc
+ desc="$(tr_desc)"
if [ "$prio" = "$(tail -1 "$q" | cut -d"$delim" -f3)" ] # If max prio, simply put on top of stack.
then
@@ 211,6 212,19 @@ qclean()
rm "$qdir/"{q,id}
}
+# Write a description in your editor
+write_desc()
+{
+ > "$qdir/buffer" # Clear the buffer
+ $EDITOR "$qdir/buffer"
+}
+
+# Translates a description, and prints the result to stdout
+tr_desc()
+{
+ tr '\n' "$delim" < "$qdir/buffer" | sed "s|$delim|\\\n|g" # Replace newlines with \n
+}
+
# Read a string and split it into vars
parse()
{