Navigation Menu

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

Marks in fringe stop working properly #1

Closed
choltz opened this issue Jun 10, 2018 · 7 comments
Closed

Marks in fringe stop working properly #1

choltz opened this issue Jun 10, 2018 · 7 comments

Comments

@choltz
Copy link

choltz commented Jun 10, 2018

Repro steps (Emacs 26.1)

  1. Open clean emacs with no packages loaded
  2. Open an empty buffer
  3. M-x evil-mode
  4. M-x evil-fringe-mark-mode
  5. Add four lines to the file
  123
  123
  123
  123
  1. Go the first line
  2. Add marks a-d in the first four lines
a 123
b 123
c 123
d 123
  1. Go to the first line
  2. Type mb

Expected Results:
The buffer should look like this:

b 123
  123
c 123
d 123

Actual Results:
The buffer looks like this:

a 123
  123
c 123
d 123
@Andrew-William-Smith
Copy link
Owner

Thanks for reporting this issue! The reason the second mark (b) does not replace the first (a) seems to lie within how Emacs determines which fringe overlays to display if two are set for the same line. Basically, the bitmap it displays is the one assigned an overlay at an earlier point in the file; thus, marks placed closer to the beginning of each line (say, on the “1” in your example) will always be displayed over marks toward the end of the line (on the “3”). If two overlays are placed at the same point, however, it seems to be indeterminate which one is displayed.

I can see how the current behaviour is confusing; I’ll add an option to always overwrite the bitmap in the fringe, regardless of line position or which mark was placed first. @choltz, does that sound good to you?

@choltz
Copy link
Author

choltz commented Jun 14, 2018

Sounds good to me. Thank you!

@Andrew-William-Smith
Copy link
Owner

Andrew-William-Smith commented Jun 19, 2018

Sorry for the late response; I've been on vacation for a week. This issue should be fixed in fdb147d; could you update your installation of this package and see if it conforms to your expectations? (If you installed from MELPA, it may take a few hours to update.)

I added a boolean configuration value evil-fringe-mark-always-overwrite that controls whether or not the bitmap displayed in the fringe for a line is the most recently placed or the closest to the fringe. This value is set to t by default, so you should not have to update your configuration to achieve the behaviour you'd expect—which definitely makes more sense than the old behaviour. I made this a configuration option instead of a fixed behaviour to prevent workflow disruptions, in case anyone preferred the line position-based display.

@choltz
Copy link
Author

choltz commented Jun 20, 2018

Thank you for taking the time to look into this.

I'm still seeing the same issue. When I complete the test case described above, the buffer looks like this:

a 123
  123
c 123
d 123

To ensure I had the correct copy of evil-fringe-mark, I cloned this repo and referenced it in my .emacs startup, instead of relying on melpa.

To be thorough, I also explicitly set (setq evil-fringe-mark-always-overwrite t), but the result was the same.

@Andrew-William-Smith
Copy link
Owner

While implementing a solution to Issue #3, I changed the behaviour such that evil-fringe-mark-always-overwrite ensures that only one bitmap is placed per line; all previous bitmaps are deleted, but enqueued for reinsertion if the mark that replaced them is moved. Since you've already replaced your MELPA install with a clone of the repository, could you try out the latest commit on the develop branch (52ce92e)?

Here's a demo of it working on my machine:

evil-fringe-mark Overwrite Preview

(Also, please ensure that the package installed from MELPA is completely removed from your load-path. Thanks!)

@choltz
Copy link
Author

choltz commented Jun 29, 2018

I plugged in the develop branch and it worked great. And it remembers the first mark if I move the second mark to a new line. Good stuff.

@Andrew-William-Smith
Copy link
Owner

Great! I've merged the develop branch into master, so it should be available on MELPA within a few hours. Thank you for helping to improve evil-fringe-mark!

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

No branches or pull requests

2 participants