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

Consider using indicators.el #16

Open
serialprimate opened this issue Nov 22, 2013 · 9 comments
Open

Consider using indicators.el #16

serialprimate opened this issue Nov 22, 2013 · 9 comments

Comments

@serialprimate
Copy link

Don't know if it has been suggested before, but maybe use indicators.el to mark (relative) fringes more precisely with bitmaps.

Also if using indicators.el, don't show deleted lines -- just mark the delete position in fringe too.

@dgutov
Copy link
Owner

dgutov commented Nov 22, 2013

Do you have a screenshot, to give an idea how that would look?

@serialprimate
Copy link
Author

I am thinking along the lines of eclipse's "Quick Diff" feature. It dynamically highlights changes relative to the file on disk or a revision in the left fringe and relatively for the whole buffer in the scroll region. It is more intuitive than occur for example. Indicators.el allows the fringe elements to be precisely positioned and sized.

You can see some guy's (overly customized) screenshot. Its the best I could find in 5 minutes.

Instead of seeing the lines you remove you have only a marker between lines where code used to be. For that reason you only see the code how it is now. Placing the mouse on the fringe where there are highlights (adds, modifies, deletions) shows the diff in a tool tip. However the tool tip diff might be a later step.

Its a suggestion as I noticed you were some of the way there already.

@dgutov
Copy link
Owner

dgutov commented Nov 26, 2013

I meant a screenshot of indicators.el in action, but this one also got the idea across. I'll see what it allows to do.

@dgutov dgutov closed this as completed in a696ca3 Jan 14, 2014
@dgutov
Copy link
Owner

dgutov commented Jan 17, 2014

Sorry, it was closed by a commit in company-mode during a weird broken push. My mistake.

@dgutov dgutov reopened this Jan 17, 2014
@dgutov
Copy link
Owner

dgutov commented Jan 19, 2014

I've pushed a new minor mode using indicators.el to the branch indicators. Do you like how it works?

Note the limitations:

  1. Only one color per window line (because of how fringes work in Emacs).
  2. Instead of pixel-perfect rectangles, like in Eclipse, we can only have a bunch of horizontal lines, one per each changed line in the buffer. This should be fixable if indicators.el ever provides an API that supports ranges, but drawing these rectangles contiguously over several window lines will take some work, and the one-color-per-window-line rule from item 1 will also contribute to making them look weirder from time to time.

@serialprimate
Copy link
Author

Thanks for this chance to give feedback and I'll let you know asap. I'm in
the middle of rebuilding my pc following a lightning strike!

Matt

On Sun, Jan 19, 2014 at 1:37 PM, Dmitry Gutov [email protected]:

I've pushed a new minor mode using indicators.el to the branch indicators.
Do you like how it works?

Note the limitations:

Only one color per window line (because of how fringes work in Emacs).
2.

Instead of pixel-perfect rectangles, like in Eclipse, we can only have
a bunch of horizontal lines, one per each changed line in the buffer. This
should be fixable if indicators.el ever provides an API that supports
ranges, but drawing these rectangles contiguously over several window lines
will take some work, and the one-color-per-window-line rule from item 1
will also contribute to making them look weirder from time to time.


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-32700270
.

@dgutov
Copy link
Owner

dgutov commented Jan 19, 2014

I'm in the middle of rebuilding my pc following a lightning strike!

Wow, there's something you don't read every day. :) Please take your time.

@serialprimate
Copy link
Author

I'm looking at the git case on windows. I can see is that you can implement some of the the existing functionality with indicators.el so it does work.

Btw I don't know much lisp, but is this a bug?:

(dolist (buffer (buffer-list))
(when diff-hl-mode (diff-hl-update)))

Do you think the limitations you mentioned above limit the usefulness of indicators.el for diff-hl at the moment?

@dgutov
Copy link
Owner

dgutov commented Feb 16, 2014

I'm looking at the git case on windows. I can see is that you can implement some of the the existing functionality with indicators.el so it does work.

Sorry, I don't understand. Could you rephrase that?

Btw I don't know much lisp, but is this a bug?:

If you mean that this block only executes when diff-hl-indicators-mode is being disabled, yes, look like it. I've pushed a fix.

Do you think the limitations you mentioned above limit the usefulness of indicators.el for diff-hl at the moment?

I do. Ideally, Emacs core should implement some sort of layered rendering for fringes, but who knows if we ever get that.

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

No branches or pull requests

2 participants