Skip to content

Commit

Permalink
Merge pull request #12 from Ganneff/master
Browse files Browse the repository at this point in the history
Respect user set linum-format
Fixes #9
  • Loading branch information
coldnew committed Feb 25, 2015
2 parents f2ce1fe + 81e2da1 commit eca3d2b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions linum-relative.el
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ linum-releative will show the real line number at current line."
(defvar linum-relative-last-pos 0
"Store last position.")

(defvar linum-relative-user-format linum-format
"Store the users linum-format")

;;;; Advices
(defadvice linum-update (before relative-linum-update activate)
"This advice get the last position of linum."
Expand All @@ -117,9 +120,11 @@ linum-releative will show the real line number at current line."
(defun linum-relative-toggle ()
"Toggle between linum-relative and linum."
(interactive)
(if (eq linum-format 'dynamic)
(setq linum-format 'linum-relative)
(setq linum-format 'dynamic)))
(if (eq linum-format 'linum-relative)
(setq linum-format linum-relative-user-format)
(progn
(setq linum-relative-user-format linum-format)
(setq linum-format 'linum-relative))))

(setq linum-format 'linum-relative)

Expand Down

0 comments on commit eca3d2b

Please sign in to comment.