Skip to content
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

allow realtive offsets for line numbers #296

Open
mProjectsCode opened this issue Apr 9, 2024 · 6 comments
Open

allow realtive offsets for line numbers #296

mProjectsCode opened this issue Apr 9, 2024 · 6 comments
Labels
accepting PR A good pull request that implements this issue will be accepted priority-high todo

Comments

@mProjectsCode
Copy link
Owner

No description provided.

@Tejeev
Copy link

Tejeev commented Jun 5, 2024

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)

@mProjectsCode
Copy link
Owner Author

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).

@DZL1943
Copy link

DZL1943 commented Sep 11, 2024

i really need this.

@jjmax75
Copy link

jjmax75 commented Oct 27, 2024

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

@Tejeev
Copy link

Tejeev commented Jan 7, 2025

@mProjectsCode Have you seen this? ^

@mProjectsCode
Copy link
Owner Author

Ah, seems like I overlooked this. Well-made PRs are always welcome.

@mProjectsCode mProjectsCode added the accepting PR A good pull request that implements this issue will be accepted label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting PR A good pull request that implements this issue will be accepted priority-high todo
Projects
None yet
Development

No branches or pull requests

4 participants