branch: externals/phps-mode
commit 738adb2eca2b35b01ab929c246ddc3e5fa0f51a8
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Work on indentation errors Emacs 29.1
---
test/phps-mode-test-indent.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index 4af199d2db..f20ea2f876 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -23,12 +23,15 @@
(execute-kbd-macro (kbd "TAB"))
(while (search-forward "\n" nil t nil)
;; Go to random point on line
- (let ((line-min-position (line-beginning-position))
- (line-max-position (line-end-position)))
- (goto-char
- (+
- line-min-position
- (random (- line-max-position line-min-position)))))
+ (let* ((line-min-position (line-beginning-position))
+ (line-max-position (line-end-position))
+ (line-diff (- line-max-position line-min-position)))
+ (if (> line-diff 0)
+ (goto-char
+ (+
+ line-min-position
+ (random line-diff)))
+ (goto-char line-min-position)))
(execute-kbd-macro (kbd "TAB"))))
(defun phps-mode-test-indent--should-equal (string name &optional new-string)