allow realtive offsets for line numbers
I'm dying for this feature in my notes :P While looking for a workaround, I came across other options that have been discussed here and elsewhere that would be good to have:
- prepend note
- append note
- targetted lines relative to the current line (perhaps 0 replaces the current line, -1 would be the line above the button, and 1 would be the one below?)
- specific numerical line in a note (exists)
Alright, so the current design plan would allow for very simple expressions (for line numbers in button actions) like the following:
-
selfStart -
selfEnd + 1 -
fileStart-15 -
fileEnd +7 -
4
Simple numbers are still allowed, but on top of that simple addition and subtraction where the left-hand operand is a relative number and the right-hand operand is a user-specified number. Just a relative number should also be possible.
selfStart and selfEnd refer to the beginning of the button block (only for code block buttons) according to the markdown post processor section info. If the info is not available, the action should error when run.
fileStart and fileEnd refer to line 1 and the final line respectively.
Possibly frontmatterStart and frontmatterEnd for frontmatter offsets, defaulting to fileStart if not available (e.g. due to no frontmatter being present in the note).
i really need this.
I'm happy to work on this if no one has taken it on
@mProjectsCode let me know if you'd like me to and I'll try to get something back to you by midweek