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
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2026-11-06 Mats Lidell <matsl@gnu.org>

* test/kotl-mode-tests.el (kotl-mode--insert-initial-tab-in-cell-row): New
test.

2026-11-04 Mats Lidell <matsl@gnu.org>

* Makefile (verify-clean-test-run): Target that runs checks for left over
Expand Down
26 changes: 25 additions & 1 deletion test/kotl-mode-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 18-May-21 at 22:14:10
;; Last-Mod: 17-Oct-26 at 02:56:46 by Bob Weiner
;; Last-Mod: 7-Nov-26 at 00:19:59 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1528,6 +1528,30 @@ marked with :ignore t")
"(kotl-mode:kill-region): Bad region or not within a single Koutline cell"
(cadr err))))))))))

(ert-deftest kotl-mode--insert-initial-tab-in-cell-row ()
"Verify that a TAB can be inserted first in a cell row and also deleted."
(with-temp-buffer
(let ((kotl-mode:emulate-tab t)
(kotl-mode:indent-tabs-mode t))
(save-window-excursion
(with-selected-window (display-buffer (current-buffer))
(kotl-mode)
(insert "1")
(kotl-mode:newline 1)
(insert "2")
(kotl-mode:beginning-of-line)
(execute-kbd-macro (kbd "TAB"))
(kotl-mode:beginning-of-line)
(should (looking-at-p "\t2"))

;; Delete the tab. Verify it deletes to the left column in
;; the cell
(let ((p (point)))
(kotl-mode:forward-char 1)
(execute-kbd-macro (kbd "<backspace>"))
(should (= p (point)))
(should (looking-at-p "2"))))))))

(provide 'kotl-mode-tests)

;; This file can't be byte-compiled without the `el-mock' package
Expand Down
Loading