emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/nlinum 9a52252 07/20: Fixes: debbugs:17906


From: Stefan Monnier
Subject: [elpa] externals/nlinum 9a52252 07/20: Fixes: debbugs:17906
Date: Sat, 28 Nov 2020 18:42:23 -0500 (EST)

branch: externals/nlinum
commit 9a522528e2faf56bbf54a781f6ca2a425ad03574
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Fixes: debbugs:17906
    
    * packages/nlinum/nlinum.el (nlinum--setup-window): Don't burp in
    non-graphic terminals.
---
 nlinum.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/nlinum.el b/nlinum.el
index 8719e92..82e274c 100644
--- a/nlinum.el
+++ b/nlinum.el
@@ -4,7 +4,7 @@
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience
-;; Version: 1.4
+;; Version: 1.5
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -72,12 +72,14 @@ Linum mode is a buffer-local minor mode."
   (aref (font-info (face-font face)) 2))
 
 (defun nlinum--setup-window ()
-  (let ((width (ceiling
-                ;; We'd really want to check the widths rather than the
-                ;; heights, but it's a start.
-                (/ (* nlinum--width 1.0
-                      (nlinum--face-height 'linum))
-                   (frame-char-height)))))
+  (let ((width (if (display-graphic-p)
+                   (ceiling
+                    ;; We'd really want to check the widths rather than the
+                    ;; heights, but it's a start.
+                    (/ (* nlinum--width 1.0
+                          (nlinum--face-height 'linum))
+                       (frame-char-height)))
+                 nlinum--width)))
     (set-window-margins nil (if nlinum-mode width)
                         (cdr (window-margins)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]