Git Product home page Git Product logo

git-gutter-fringe's Introduction

git-gutter-fringe.el

melpa badge melpa stable badge gh actions badge

Introduction

git-gutter-fringe.el is fringe version of of git-gutter.el.

git-gutter.el does not work with linum-mode but git-gutter-fringe.el can work with linum-mode. In contrast, git-gutter-fringe.el does not work in tty frame(emacs -nw), but git-gutter.el can work in tty frame.

NOTE: You can not use both git-gutter.el and git-gutter-fringe.el

Screenshot

Screenshot of git-gutter-fringe.el

Requirements

Installation

You can install git-gutter.el from MELPA with package.el (M-x package-install git-gutter-fringe).

And you can also install it with el-get.

Basic Usage

Interfaces are same as git-gutter.el.

  • git-gutter
  • git-gutter:clear
  • git-gutter:toggle

Sample Configuration

;; You need to install fringe-helper.el
(require 'git-gutter-fringe)

Customize

Look and feel

git-gutter-fringe-customize

You can change faces like following.

(set-face-foreground 'git-gutter-fr:modified "yellow")
(set-face-foreground 'git-gutter-fr:added    "blue")
(set-face-foreground 'git-gutter-fr:deleted  "white")

Change signs in fringe

git-gutter-fringe-change-signs

;; Please adjust fringe width if your own sign is too big.
(setq-default left-fringe-width  20)
(setq-default right-fringe-width 20)

(fringe-helper-define 'git-gutter-fr:added nil
  ".XXXXXX."
  "XX....XX"
  "X......X"
  "X......X"
  "XXXXXXXX"
  "XXXXXXXX"
  "X......X"
  "X......X")

(fringe-helper-define 'git-gutter-fr:deleted nil
  "XXXXXX.."
  "XX....X."
  "XX.....X"
  "XX.....X"
  "XX.....X"
  "XX.....X"
  "XX....X."
  "XXXXXX..")

(fringe-helper-define 'git-gutter-fr:modified nil
  "XXXXXXXX"
  "X..XX..X"
  "X..XX..X"
  "X..XX..X"
  "X..XX..X"
  "X..XX..X"
  "X..XX..X"
  "X..XX..X")

Position of fringe

git-gutter-fringe-right

You can change position of fringe, left or right. Default is left.

(setq git-gutter-fr:side 'right-fringe)

Comparison with diff-hl

I suppose if you enable vc-mode, you should use diff-hl rather than git-gutter-fringe. I always use git-gutter.el(and I love git-gutter.el), however I don't use git-gutter-fringe and don't do dog-fooding myself.

diff-hl is based on Emacs VC. git-gutter-fringe does not use vc.

You can use git-gutter-fringe even if you disable vc-mode. While diff-hl benefits from VC. For example, if vc supports new VCS which is greater than git, diff-hl works with such VCS with no code modification. However git-gutter.el does not benefit from vc-mode, I need to add code for supporting such new great VCS.

See also

git-gutter-fringe's People

Contributors

alvinfrancis avatar gonewest818 avatar juszczakn avatar kui avatar sabof avatar stakemori avatar syohex avatar tanzoniteblack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-gutter-fringe's Issues

Deleted indicator appearing one line above where it should be

Hi there,

I've noticed that the deleted indicator appears one line up from where it should be. It only happens with git-gutter-fringe, not with normal git-gutter. You can see it on this screenshot:

bug

The window on the top is before I delete the function repeatable-enlarge-window. The next window is with git-gutter and the last one with git-gutter-fringe. You can see how in the last one the deleted indicator is one line above, next to the (insert "\n" (replace-regexp-in-string ...

Unclearable overlays

version: GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0, Carbon Version 157 AppKit 1344.72)

Occasionally I will get git-gutter-fringe overlays stuck in my fringe which I can't clear by toggling the fringe, toggling linum, or even calling git-gutter:clear or git-gutter-fr:clear.

I don't know exactly what triggers this. I think it may only happen when there's only 1 hunk left to show in the gutter (e.g. after making a few edits to a file, and then undoing them one by one), but then again that may be only because I only notice after undoing all my temporary edits to a file.

I did some poking, and it looks like the 'git-gutter property on the overlays gets removed without the overlays themselves getting removed. That is, (overlay-get ov 'git-gutter) returns nil on an overlay that I can clearly see is still showing a git-gutter-fringe overlay in it.

This could be a git-gutter problem instead of something specific to git-gutter-fringe, but I only use git-gutter-fringe so I couldn't tell.

global-display-line-numbers-mode support?

Hi! Does git-gutter-fringe support Emacs 26.1's global-display-line-numbers-mode as well or better than linum-mode? It would be nice to see this project and git-gutter's README.md's updated to address this.

No characters, only bars.

Updated to emacs 27.2 using libXaw instead of GTK. The +,- indicators are replaced with colored bars. Any idea where to start diagnosing?

The little red triangle is the deleted line indicator.
image

The yellow bar is the added line indicator and the purple bar is the modified line indicator
image

Order of inheritance of fringe face

Currently, the order of inheritance of faces in 9c63b4d puts the fringe face before the git-gutter faces. This causes the fringe face to totally override the git-gutter faces as noted by the :inherit face attribute.

:inherit
The name of a face from which to inherit attributes, or a list of face names. Attributes from inherited faces are merged into the face like an underlying face would be, with higher priority than underlying faces (see Displaying Faces). If a list of faces is used, attributes from faces earlier in the list override those from later faces.

Shouldn't the order be reversed so that the git-gutter faces always override the fringe face?

Tramp

I noticed git-gutter.el works over tramp but fringe does not(for me)?

Any explanation as to why this is before I go down the rabbit hole?

bug: fringe update is not consistant

After brief usage, I find fringe does not update accurately sometimes, although mostly working, only random failures.

The following screen shot shows the problem.

Screenshot from 2013-02-28 21:40:55

in the image, top window has fringe shown which is wrong as you can see magit buffer (bottom window) shows no changes made in the repo.

Conflicts with flycheck

As in topic.
Conflict is when fringe is configured to show symbols on left.

When configured to show symbols on right then everything is ok.

fringe never clears

Hello,

I have a problem similar to #3, except that I'm getting it with the current version and it seems to be perfectly consistent... I've installed via el-get-install git-gutter-fringe, and then in .emacs I have:

(require 'git-gutter-fringe)
(global-git-gutter-mode 1)
(setq git-gutter:lighter "")

And I find that the fringe appears when I edit lines, but once a mark appears in the fringe, it never goes away. I can commit (via calling git on the command-line, or via magit), I can re-save after committing, etc., but any lines that were previously modified will continue to be marked as modified, even if they have been committed. The only way to clear the fringe is to close the buffer entirely and then re-open it.

This is with emacs 24.3.1 from debian testing.

Dies with error Wrong type argument: processp, nil

I just installed git-gutter-fringe for the first time by running the following commands in *scratch*:

(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
        ("melpa" . "http://melpa.milkbox.net/packages/")
        ))
(("gnu" . "http://elpa.gnu.org/packages/") ("melpa" . "http://melpa.milkbox.net/packages/"))

(package-initialize)
t

(package-refresh-contents)
nil

(package-install 'git-gutter-fringe)
nil

I then opened a file that is under git version control, ran M-x git-gutter, and received the error:

git-gutter:start-diff-process: Wrong type argument: processp, nil

Is there any way to get a more detailed traceback so that I can learn what, exactly, went wrong?

linum-mode in Emacs 29.1

Using Debian Sid's version of Emacs (29.1 29.1+1-4), I get:

Error (use-package): git-gutter-fringe/:catch: Symbol’s value as variable is void: global-linum-mode

linum-mode seems to be deprecated now in favor of display-line-numbers-mode...

And, of course, the fringe marks for add/changed/deleted do not show.

My configuration is very simple:

(use-package git-gutter-fringe
  :config
  (global-git-gutter-mode))

git-gutter-fringe is broken in a tty frame

In a tty frame, it would be nice if git-gutter-fringe degraded nicely to just work like standard git-gutter. As it stands now, the tty frame not only doesn't show the git status in the gutter, but the entire buffer is displayed in a broken way. I've even had this cause my emacs to lock up.

Right-aligned fringe creates blank left fringe

When I use git-gutter-fringe on the right side, a blank fringe/gutter appears after saving.

File just opened:
screen shot 2014-08-26 at 13 40 23

File saved:
screen shot 2014-08-26 at 13 40 40

My configuration is very basic:

(require 'git-gutter-fringe)
(global-git-gutter-mode t)
(setq git-gutter-fr:side 'right-fringe)

The jumping gutter disappears when I disable git-gutter-fringe, so it is not caused by any other packages.

I'd try looking into the code myself but I'm fairly new to emacs so I wouldn't even know where to begin :-)

DOCS: how to run both modes?

It's not clear if it's possible to run with both git-gutter and git-gutter-fringe (i.e. one for tty frames and one for gui frames). Could you ammend the docs to make that clear please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.