heynote
heynote copied to clipboard
Created and updated times
Add created/updated timestamps to block delimiter (#30)
New delimiter format with -c
for created time and -u
for updated time with ISO strings following (YYYY-MM-DDTHH:mm:ssZ
)
\n∞∞∞(${languageTokensMatcher})(-a)?(-c${timeMatcher})?(-u${timeMatcher})?\n
Presents the updated time in the status bar:
If this is headed in the right direct, i can keep going
I think so 👍! It was a while since I messed with the Lezer stuff, and the Lezer code in Heynote is the full extent of my experience with it, so I'm certainly not an expert when it comes to the grammar syntax.
A thought that popped up in my mind when thinking about this.. I think it would be a good idea to investigate how we could implement the actual updating of the timestamps in the Codemirror text buffer. I'm guessing that this should be done with some kind of transactionFilter, but the text in the reference manual seems to indicate that it might not be a very good idea. So it's probably smart to investigate that to make sure it's not a showstopper due to performance issues or similar.
We would only need a transactionFilter
to update the update times with every change. So it even if it turns out that it's a showstopper, it shouldn't prevent us from adding creation time.
@heyman this is "ready to go" but I'm having trouble solving two (known) bugs:
- When I "Select All" (twice) to get the whole scratch pad, and then "delete", I'm left with 2 blocks, not one. I can't fingure out why the
defaultSelectAll
doesn't actually select all the buffer text. - I can't get certain
language-detection.spec.js
tests to pass. When I debug the tests, the.pressSequentially(...
command types in the text and then ends up in an infinite loop of creating new blocks. I can't figure out where this is coming from and whether the bug is in the test or application side.
Any insight on either?