diff --git a/ChangeLog b/ChangeLog index f2a07efe..cebf6540 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-11-06 Mats Lidell + +* test/kotl-mode-tests.el (kotl-mode--insert-initial-tab-in-cell-row): New + test. + 2026-11-04 Mats Lidell * Makefile (verify-clean-test-run): Target that runs checks for left over diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el index 5467735a..3700524d 100644 --- a/test/kotl-mode-tests.el +++ b/test/kotl-mode-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; 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 ;; @@ -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 "")) + (should (= p (point))) + (should (looking-at-p "2")))))))) + (provide 'kotl-mode-tests) ;; This file can't be byte-compiled without the `el-mock' package