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

linum-relative should respect user's linum-format #9

Closed
tuhdo opened this issue May 4, 2014 · 1 comment
Closed

linum-relative should respect user's linum-format #9

tuhdo opened this issue May 4, 2014 · 1 comment

Comments

@tuhdo
Copy link

tuhdo commented May 4, 2014

When toggling on/off linum-relative, it removes user setting for linum-format. User option should be reserved.

@tuhdo
Copy link
Author

tuhdo commented May 4, 2014

Here is the change that I made to make linum-relative respect user's format:

diff --git a/elpa/linum-relative-20131210.2053/linum-relative.el b/elpa/linum-relative-20131210.2053/linum-relative.el
index 1da995b..8e6c356 100644
--- a/elpa/linum-relative-20131210.2053/linum-relative.el
+++ b/elpa/linum-relative-20131210.2053/linum-relative.el
@@ -80,6 +80,8 @@ linum-releative will show the real line number at current line."
 (defvar linum-relative-last-pos 0
   "Store last position.")

+(defvar user-format 'dynamic
+  "Store user format")
 ;;;; Advices
 (defadvice linum-update (before relative-linum-update activate)
   "This advice get the last position of linum."
@@ -103,9 +105,10 @@ 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 user-format)
+    (setq user-format linum-format)
+    (setq linum-format 'linum-relative)))

 (setq linum-format 'linum-relative)

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

1 participant