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

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

[nongnu] elpa/popup dcc9ee5 119/184: Merge pull request #80 from ancane/


From: ELPA Syncer
Subject: [nongnu] elpa/popup dcc9ee5 119/184: Merge pull request #80 from ancane/master
Date: Wed, 6 Oct 2021 00:01:25 -0400 (EDT)

branch: elpa/popup
commit dcc9ee52015e55767157ee7ee0599cda3d8b6694
Merge: 53bb3ec 649242e
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Merge pull request #80 from ancane/master
    
    :initial-index respects real popup height(beyond first popup page)
---
 popup.el            | 4 ++--
 tests/popup-test.el | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/popup.el b/popup.el
index a478699..9287706 100644
--- a/popup.el
+++ b/popup.el
@@ -1384,8 +1384,8 @@ If `INITIAL-INDEX' is non-nil, this is an initial index 
value for
             (popup-jump menu cursor)
           (popup-draw menu))
         (when initial-index
-          (popup-select menu
-                        (min (- (length list) 1) initial-index)))
+          (dotimes (counter (min (- (length list) 1) initial-index))
+              (popup-next menu)))
         (if nowait
             menu
           (popup-menu-event-loop menu keymap fallback
diff --git a/tests/popup-test.el b/tests/popup-test.el
index bfc19c7..67d3aeb 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -628,6 +628,10 @@ Qux" :nowait t)
     (should (popup-test-helper-popup-selected-item "Baz")))
 
   (popup-test-with-common-setup
+    (setq popup (popup-menu* '("Foo" "Bar" "Baz") :initial-index 2 :height 1 
:scroll-bar t :nowait t))
+    (should (popup-test-helper-popup-selected-item "Baz")))
+
+  (popup-test-with-common-setup
     (setq popup (popup-menu* '("Foo" "Bar" "Baz") :initial-index -1 :nowait t))
     (should (popup-test-helper-popup-selected-item "Foo")))
 



reply via email to

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