Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lisp/ghostel.el
Original file line number Diff line number Diff line change
Expand Up @@ -5018,6 +5018,10 @@ for both native and Emacs PTY paths."
(setq-local truncate-lines t)
(setq-local scroll-conservatively 101)
(setq-local line-spacing 0)
;; Shield row geometry from a global `default-text-properties':
;; `line-spacing'/`line-height' properties supplied through its fallback
;; inflate rendered rows invisibly to the `window-screen-lines' sizing math.
(setq-local default-text-properties nil)
(setq-local filter-buffer-substring-function #'ghostel--filter-buffer-substring)
;; expose cwd to buffer-menu/ibuffer
(setq-local list-buffers-directory (expand-file-name default-directory))
Expand Down
19 changes: 19 additions & 0 deletions test/ghostel-modes-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
(should (member 'ghostel-default
(cdr (assq 'default face-remapping-alist))))))

(ert-deftest ghostel-test-mode-shields-default-text-properties ()
"A global `default-text-properties' does not reach ghostel buffers.
Its `line-spacing'/`line-height' fallback would inflate rendered rows
invisibly to the grid sizing math (discussion #534)."
(let ((old (default-value 'default-text-properties)))
(unwind-protect
(progn
(setq-default default-text-properties
'(line-spacing 0.1 line-height 1.05))
(with-temp-buffer
(ghostel-mode)
(should (local-variable-p 'default-text-properties))
(should (null default-text-properties))
(let ((inhibit-read-only t))
(insert "x\n"))
(should (null (get-char-property (point-min) 'line-spacing)))
(should (null (get-char-property (point-min) 'line-height)))))
(setq-default default-text-properties old))))

(ert-deftest ghostel-test-emacs-mode-preserves-point ()
"In Emacs mode, point stays put while the terminal keeps running.
The delayed redraw path always preserves point in Emacs mode,
Expand Down
Loading