-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi line notes don't play nice #39
Comments
Hi @ioanniswd |
I don't think there is any problem at all until the notes are filtered one by one (happens with If you look at the |
Yes, the indentation and the bullets are the issue when it comes to $ stup copy --to tomorrow --from today
About to copy notes from Friday May 01, 2020 to Saturday May 02, 2020 for category personal
- Multi
>>> Copy this note [y,n,q,a]?: n
line
>>> Copy this note [y,n,q,a]?: n
note
>>> Copy this note [y,n,q,a]?: n
- Single line note
>>> Copy this note [y,n,q,a]?: n |
Ok, this needs a little work to think of the best approach to deal with. The fact that each note starts with a dash might be helpful to be able to group distinguish multiline notes via a regex. I will think about possible solutions. If anyone thinks of something let's add it here for discussion. PS: I really appreciate your contributions @ioanniswd @tiosgz, thank you very much |
I haven't found a way to do this using one regex-ed line, but I think this could work
arr=()
while IFS='' read line
do
if [[ "$line" =~ (^- ) ]]; then
arr+=( "$line" )
else
last=$((${#arr[*]} - 1))
arr[$last]+="\n$line"
fi
done < $notes_file Will find all the credits if you want (though it'd mean filtering ~20 tabs) |
@tiosgz I think it'll work. I can check that tomorrow and get back to you. If you already started or you want to work on this let me know to avoid conflict.
😆 no, I don't |
I don't plan doing this, because (as I know myself) I would never get it done. |
Mentioned in this issue comment by @tiosgz :
Applies to both
add
andcopy
commands.The text was updated successfully, but these errors were encountered: