summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/vtable.el
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2022-11-21 12:54:35 -0800
committerYuan Fu <casouri@gmail.com>2022-11-21 12:54:35 -0800
commitaaeaa310f0391f5a5193e1a3d6e026986c4f2c0c (patch)
tree67765b95359bfc462e95606043e6b0cea3bb7c49 /lisp/emacs-lisp/vtable.el
parentb2ea38ab03e801859163b74a292aa75008e36541 (diff)
parentf176a36f4629b56c9fd9e3fc15aebd04a168c4f5 (diff)
downloademacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.tar.gz
emacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.tar.bz2
emacs-aaeaa310f0391f5a5193e1a3d6e026986c4f2c0c.zip
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter
Diffstat (limited to 'lisp/emacs-lisp/vtable.el')
-rw-r--r--lisp/emacs-lisp/vtable.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index 9bdf90bf1d6..de8503a1cb1 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -353,6 +353,11 @@ This also updates the displayed table."
(let* ((cache (vtable--cache table))
(inhibit-read-only t)
(keymap (get-text-property (point) 'keymap))
+ (ellipsis (if (vtable-ellipsis table)
+ (propertize (truncate-string-ellipsis)
+ 'face (vtable-face table))
+ ""))
+ (ellipsis-width (string-pixel-width ellipsis))
(elem (and after-object
(assq after-object (car cache))))
(line (cons object (vtable--compute-cached-line table object))))
@@ -370,7 +375,8 @@ This also updates the displayed table."
;; FIXME: We have to adjust colors in lines below this if we
;; have :row-colors.
(vtable--insert-line table line 0
- (nth 1 cache) (vtable--spacer table))
+ (nth 1 cache) (vtable--spacer table)
+ ellipsis ellipsis-width)
(add-text-properties start (point) (list 'keymap keymap
'vtable table)))
;; We may have inserted a non-numerical value into a previously
@@ -516,7 +522,8 @@ This also updates the displayed table."
(if (> (nth 1 elem) (elt widths index))
(concat
(vtable--limit-string
- pre-computed (- (elt widths index) ellipsis-width))
+ pre-computed (- (elt widths index)
+ (or ellipsis-width 0)))
ellipsis)
pre-computed))
;; Recompute widths.
@@ -524,7 +531,8 @@ This also updates the displayed table."
(if (> (string-pixel-width value) (elt widths index))
(concat
(vtable--limit-string
- value (- (elt widths index) ellipsis-width))
+ value (- (elt widths index)
+ (or ellipsis-width 0)))
ellipsis)
value))))
(start (point))