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

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

[elpa] externals/olivetti 7b215a7 037/134: Fixes #7


From: Stefan Monnier
Subject: [elpa] externals/olivetti 7b215a7 037/134: Fixes #7
Date: Thu, 25 Apr 2019 09:57:23 -0400 (EDT)

branch: externals/olivetti
commit 7b215a75eb9f829084626cfccd18cde777fbec55
Author: Paul Rankin <address@hidden>
Commit: Paul Rankin <address@hidden>

    Fixes #7
---
 olivetti.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/olivetti.el b/olivetti.el
index f32e3ed..b9cd3b2 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -117,6 +117,13 @@ Can cause display issues in console mode."
   :type 'boolean
   :group 'olivetti)
 
+;;; Variables 
==================================================================
+
+(defvar olivetti--visual-line-mode
+  nil
+  "Non-nil if `visual-line-mode' is active when `olivetti-mode' is turned on.")
+(make-variable-buffer-local 'olivetti--visual-line-mode)
+
 ;;; Functions ==========================================================
 
 (defun olivetti-set-mode-line (&optional arg)
@@ -249,10 +256,15 @@ hidden."
                   'olivetti-set-environment nil t)
         (add-hook 'text-scale-mode-hook
                   'olivetti-set-environment nil t)
-        (visual-line-mode 1)
+        (setq olivetti--visual-line-mode visual-line-mode)
+        (unless olivetti--visual-line-mode
+          (visual-line-mode 1))
         (olivetti-set-environment))
     (olivetti-set-mode-line 'exit)
     (set-window-margins nil nil)
+    (unless olivetti--visual-line-mode
+      (visual-line-mode 0))
+    (kill-local-variable 'olivetti--visual-line-mode)
     (remove-hook 'window-configuration-change-hook
                  'olivetti-set-environment t)
     (remove-hook 'after-setting-font-hook



reply via email to

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