[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/corfu-popup 323a92088c 20/26: Fix popon breaking when righ
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/corfu-popup 323a92088c 20/26: Fix popon breaking when right fringe is zero on graphical display (#3) |
Date: |
Sun, 22 May 2022 12:58:16 -0400 (EDT) |
branch: elpa/corfu-popup
commit 323a92088c83b461a3cf3951c9d644db575902d1
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Fix popon breaking when right fringe is zero on graphical display (#3)
---
corfu-popup.el | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/corfu-popup.el b/corfu-popup.el
index 703dad8f96..156127fbad 100644
--- a/corfu-popup.el
+++ b/corfu-popup.el
@@ -48,6 +48,18 @@
:link '(url-link "https://codeberg.org/akib/emacs-corfu-popup")
:prefix "corfu-popup-")
+(defcustom corfu-popup-position-right-margin 0
+ "Number of columns of margin at the right of window.
+
+Always keep the popup this many columns away from the right edge of the
+window.
+
+Note: If the popup breaks or crosses the right edge of window, you may set
+this variable to warkaround it. But remember, that's a *bug*, so if that
+ever happens to you please report the issue at
+https://codeberg.org/akib/emacs-corfu-popup/issues."
+ :type 'integer)
+
(declare-function corfu--auto-tick "corfu") ;; OK, byte-compiler?
(defvar corfu-popup--popon nil
@@ -112,7 +124,7 @@ Show a vertical scroll bar of size BAR + 1 from LOth line."
(frame-char-width))))
(+ width margin-left-width margin-right-width)))
(popon-pos (if (equal (cdr corfu-popup--last-position)
- (list pos (window-start)
+ (list pos popon-width (window-start)
(buffer-modified-tick)))
(car corfu-popup--last-position)
(let ((pos (popon-x-y-at-pos pos)))
@@ -123,9 +135,14 @@ Show a vertical scroll bar of size BAR + 1 from LOth line."
(line-number-display-width)
(if (display-graphic-p)
(let ((fringes (window-fringes)))
- (/ (+ (car fringes) (cadr fringes))
- (frame-char-width)))
+ (+ (/ (+ (car fringes)
+ (cadr fringes))
+ (frame-char-width))
+ (if (zerop (cadr fringes))
+ 1
+ 0)))
(1+ (if (zerop (window-hscroll)) 0 1)))
+ corfu-popup-position-right-margin
popon-width))
0)
(if (and (< (floor (window-screen-lines))
@@ -134,7 +151,8 @@ Show a vertical scroll bar of size BAR + 1 from LOth line."
(- (cdr pos) (length lines))
(1+ (cdr pos))))))))
(setq corfu-popup--last-position
- (list popon-pos pos (window-start) (buffer-modified-tick)))
+ (list popon-pos pos popon-width (window-start)
+ (buffer-modified-tick)))
(setq corfu-popup--popon
(popon-create
(cons
- [nongnu] elpa/corfu-popup e5c7035190 06/26: Fix byte compilation error, (continued)
- [nongnu] elpa/corfu-popup e5c7035190 06/26: Fix byte compilation error, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 0effb93594 03/26: Fix typo, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 3b649cce35 07/26: Patch out display-graphic-p call at compile time, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 7a1fbd2676 09/26: Fix README, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup b2dd179e57 10/26: Fix typo, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 03b5c7a74c 14/26: Update terminal screenshots, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 9e1e2d3f04 16/26: Lower required Emacs version, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 0b2fd81ac0 17/26: Remove obsolete use of define-minor-mode, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 3a8e98a982 21/26: Rename corfu-popup to corfu-terminal, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 59730db33b 23/26: Don't ship images in packages, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 323a92088c 20/26: Fix popon breaking when right fringe is zero on graphical display (#3),
ELPA Syncer <=
- [nongnu] elpa/corfu-popup fcb35a8c45 24/26: Add user option to disable on GUI, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 2b4a7d7d16 18/26: Remove hardcoded popon height, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup eb4106aa5a 22/26: Add corfu-popup.el for backward compatibility, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup aaaaea5932 25/26: Use new integration strategy, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 359e2e9849 26/26: Remove unused macro, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup fabfd00ff8 15/26: Update README as kind-icon no longer causes problem, ELPA Syncer, 2022/05/22
- [nongnu] elpa/corfu-popup 4ce83ab8bd 19/26: Fix #3: Keep popon within the visible part of window, ELPA Syncer, 2022/05/22