[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-explorer 918c133 11/29: Add row counter variable
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/ivy-explorer 918c133 11/29: Add row counter variable |
Date: |
Tue, 12 Mar 2019 09:04:35 -0400 (EDT) |
branch: externals/ivy-explorer
commit 918c1335b08430171ab8a2906b27c34af8d3c811
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Add row counter variable
---
ivy-explorer.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/ivy-explorer.el b/ivy-explorer.el
index 4f2b246..6175347 100644
--- a/ivy-explorer.el
+++ b/ivy-explorer.el
@@ -161,19 +161,23 @@ Only the background color is significant."
(defvar ivy-explorer--col-n nil
"Current columns size of grid.")
+(defvar ivy-explorer--row-n nil
+ "Current row size of grid.")
+
(defun ivy-explorer--get-menu-string (strings &optional cols width)
"Given a list of STRINGS create a menu string.
The menu string will be segmented into columns. If COLS is given
use at max COLS columns (defaults to 4). Decision for number of
-columns is based on WIDTH which default to frame width. Returns a
-cons cell with the number of columns created as the `car' and the
-menu string as `cdr'."
+columns is based on WIDTH which defaults to frame width. Returns
+a cons cell with the (columns . rows) created as the `car' and
+the menu string as `cdr'."
(with-temp-buffer
(let* ((length (apply 'max
(mapcar #'string-width strings)))
(wwidth (or width (frame-width)))
(columns (min (or cols 4) (/ wwidth (+ 2 length))))
+ (rows 1)
(colwidth (/ wwidth columns))
(column 0)
(first t)
@@ -186,6 +190,7 @@ menu string as `cdr'."
(if (or (< wwidth (+ (max colwidth length) column))
(zerop length))
(progn
+ (cl-incf rows)
(insert "\n" (if (zerop length) "\n" ""))
(setq column 0))
(insert " \t")
@@ -195,13 +200,12 @@ menu string as `cdr'."
(insert str)
(setq column (+ column
(* colwidth (ceiling length colwidth)))))))
- (cons columns (buffer-string)))))
+ (cons (cons columns rows) (buffer-string)))))
;; * Ivy explorer window, adapted from lv.el
(defvar display-line-numbers)
(defvar golden-ratio-mode)
-(defvar ivy-posframe-hide-minibuffer)
(defvar ivy-explorer--window nil
"Holds the current ivy explorer window.")
@@ -613,16 +617,17 @@ Call the permanent action if possible.")
(list "")))
(menu (ivy-explorer--get-menu-string
strings ivy-explorer-max-columns))
- (mcols (car menu))
+ (mcols (caar menu))
+ (mrows (cdar menu))
(mstring (cdr menu)))
(setq ivy-explorer--col-n mcols)
+ (setq ivy-explorer--row-n mrows)
(funcall ivy-explorer-message-function mstring)))
(defun ivy-explorer--internal (f &rest args)
"Invoke ivy explorer for F with ARGS."
(let ((ivy-display-function #'ivy-explorer--display-function)
- (ivy-posframe-hide-minibuffer nil)
(completing-read-function 'ivy-completing-read)
;; max number of candidates
(ivy-height (funcall ivy-explorer-max-function))
- [elpa] externals/ivy-explorer updated (be8008b -> 5f9dafc), Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4262a07 04/29: Ignore ivy-posframe-hide-minibuffer setting., Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 3325d82 02/29: Add bol/eol commands for grid (#6), Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 5161d5f 06/29: Remove unused ivy-explorer-lv-force-update variable, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 545e0a9 05/29: Make message function a user option, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer e7e2e4e 12/29: Improve posframe support, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 918c133 11/29: Add row counter variable,
Clemens Radermacher <=
- [elpa] externals/ivy-explorer 35ee473 13/29: Skip first line when parsing posframe buffer for avy, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer af08f55 03/29: Refactoring, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 5475145 01/29: Add Elpa badge, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 1da2e48 16/29: Increase default number of columns to 5, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4c19171 22/29: Add ivy-explorer-read function to read any colledtion with the grid, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer a30fc60 15/29: Actually respect the setting of `ivy-explorer-max-columns`, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4a48ec4 17/29: Add posframe screenshot, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer bc207da 10/29: Add basic posframe support for #7, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer f9e3b7a 07/29: Add auto-init-avy option, and improve avy exit behaviour, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 9af0805 27/29: Improve ivy-explorer-read function again, Clemens Radermacher, 2019/03/12