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

improved line number interaction #1

Open
masukomi opened this issue Mar 16, 2022 · 2 comments
Open

improved line number interaction #1

masukomi opened this issue Mar 16, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@masukomi
Copy link
Owner

Desired behavior

when you comment on a line the private comment should be displayed on the line above it with no line number(s) beside it.

desired behavior

1  <first line of code>
   private comment on line 2
   another line of private comment
2 <second line of code>

Actual behavior

When you comment on a line the private comment has the line number displayed next to the first line of the comment and the line you were commenting on has no line number displayed next to it.

To put it another way, visually, it is taking over the line number's assignment.

actual behavior

1  <first line of code>
2 private comment on line 2
   another line of private comment
   <second line of code>

emacs-virtual-comment and phantom-inline-comment exhibit the same behavior, so maybe this is just a consequence of emacs behavior and not something easily addressed?

Example:
CleanShot 2022-03-15 at 21 08 53@2x

@masukomi masukomi added the enhancement New feature or request label Mar 16, 2022
@dickmao
Copy link
Collaborator

dickmao commented Mar 16, 2022

One would have to insert the private comment as a so-called "after-string" to the overlay of the preceding line. This makes things more delicate since now the overlay does not correspond to the target line but rather the one before it -- but let's see how it might look.

Edit: (This new property also makes private commenting the first line a tad problematic).

In the branch display-line-numbers-mode, this is the best I could do without invading the emacs C core (which I could do).

Screenshot_2022-03-16_11-29-44

One could douse the face coloring so that the unsightly colored newline on line 32 doesn't show up, but that would douse the coloring on all private comments.

I'm sorry I couldn't make this happen. I did not foresee a display-line-numbers-mode user (I am a line-number-mode person).

@masukomi
Copy link
Owner Author

No worries. I suspected there was some underlying emacs thing that explained why both of the other offerings did this. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants