test-org-src.el: Work around `current-column' bug in older emacs
* testing/lisp/test-org-src.el (test-org-src/indented-blocks): Work around `current-column' not working in the presence of display strings in older emacs.
This commit is contained in:
parent
8fa7f0279e
commit
67e819d6ee
|
@ -416,7 +416,13 @@ This is a tab:\t.
|
|||
(let ((org-edit-src-content-indentation 2)
|
||||
(org-src-preserve-indentation nil))
|
||||
(font-lock-ensure)
|
||||
(current-column)))))
|
||||
;; `current-column' will not work with older versions of emacs
|
||||
;; before commit 4243747b1b8: Fix 'current-column' in the
|
||||
;; presence of display strings
|
||||
(if (<= emacs-major-version 28)
|
||||
(+ (progn (backward-char) (length (get-text-property (point) 'display)))
|
||||
(current-column))
|
||||
(current-column))))))
|
||||
;; The initial tab characters respect org's `tab-width'.
|
||||
(should
|
||||
(equal
|
||||
|
@ -432,7 +438,10 @@ This is a tab:\t.
|
|||
(let ((org-edit-src-content-indentation 2)
|
||||
(org-src-preserve-indentation nil))
|
||||
(font-lock-ensure)
|
||||
(current-column))))))
|
||||
(if (<= emacs-major-version 28)
|
||||
(+ (progn (backward-char) (length (get-text-property (point) 'display)))
|
||||
(current-column))
|
||||
(current-column)))))))
|
||||
|
||||
(ert-deftest test-org-src/indented-latex-fragments ()
|
||||
"Test editing multiline indented LaTeX fragment."
|
||||
|
|
Loading…
Reference in New Issue