[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 9aa922d 01/16: Use `vertical-motion` instead of `
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/corfu 9aa922d 01/16: Use `vertical-motion` instead of `forward-line` |
Date: |
Wed, 28 Apr 2021 14:20:01 -0400 (EDT) |
branch: externals/corfu
commit 9aa922deb772689410d9d1eb2027b10794fc6582
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Use `vertical-motion` instead of `forward-line`
Partial fix of #15
---
corfu.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/corfu.el b/corfu.el
index 3149744..1a96dd8 100644
--- a/corfu.el
+++ b/corfu.el
@@ -204,8 +204,8 @@ If `line-spacing/=nil' or in text-mode, the background
color is used instead.")
(max-width (min (cdr corfu-width-limits) (/ (window-total-width)
2)))
(col (- pos (line-beginning-position)))
(rest-width (- (window-total-width) col 4))
- (ypos (- (line-number-at-pos)
- (save-excursion (move-to-window-line 0)
(line-number-at-pos))))
+ (ypos (count-screen-lines (save-excursion (move-to-window-line 0)
(point))
+ (point)))
(count (length lines))
(row 0) (width) (formatted) (beg))
(if (< rest-width (car corfu-width-limits))
@@ -216,12 +216,12 @@ If `line-spacing/=nil' or in text-mode, the background
color is used instead.")
lines (mapcar (lambda (x) (truncate-string-to-width x
max-width)) lines)
width (apply #'max (car corfu-width-limits) (mapcar
#'string-width lines))))
(beginning-of-line)
- (forward-line (if (and (< count ypos)
- (>= count (- (floor (window-pixel-height) (cdr
size)) ypos 2)))
- (- count) 1))
+ (vertical-motion (if (and (< count ypos)
+ (>= count (- (floor (window-pixel-height) (cdr
size)) ypos 1)))
+ (- count) 1))
(setq beg (point))
(when (save-excursion
- (forward-line 1)
+ (vertical-motion 1)
(/= (point) (line-beginning-position)))
(push #(" \n" 0 1 (cursor t)) formatted))
(dolist (line lines)
@@ -244,7 +244,7 @@ If `line-spacing/=nil' or in text-mode, the background
color is used instead.")
"\n")
formatted)
(setq row (1+ row))
- (forward-line 1)))
+ (vertical-motion 1)))
(let ((ov (make-overlay beg (point))))
(overlay-put ov 'priority 900)
(overlay-put ov 'window (selected-window))
- [elpa] externals/corfu fef8377 02/16: Add popup comment (See #10 and #15), (continued)
- [elpa] externals/corfu fef8377 02/16: Add popup comment (See #10 and #15), Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 5951abd 04/16: Reorder exit conditions, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 7155196 05/16: Simplify, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 59a3037 06/16: Ensure that overlay is deleted properly, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 9eb9ae6 08/16: Keep frame alive for performance, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu e5dad66 09/16: Use internal border, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu e4d66b6 10/16: Use spaces for border/bar instead of image, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu cdd215d 13/16: Ensure that frame buffer is set, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu a53a98a 16/16: Simplify face definitions, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 59949d3 03/16: Use child frames instead of overlays, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 9aa922d 01/16: Use `vertical-motion` instead of `forward-line`,
Protesilaos Stavrou <=
- [elpa] externals/corfu 4f6aac9 07/16: Ensure that documentation/location frame still works with child-frame popup, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu aab3bb5 11/16: Use redraw-frame, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 3cfb6f4 12/16: Pixel-perfect positioning, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 2ef1beb 14/16: Use italic face for "No match" message, Protesilaos Stavrou, 2021/04/28
- [elpa] externals/corfu 76d7bce 15/16: Rename corfu-confirm to corfu-no-match, Protesilaos Stavrou, 2021/04/28