branch: externals/matlab-mode
commit f739612f29f54866963745df79b1bfbc810ea55b
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>

    matlab-ts-mode: fix typing inden to cell, indent_cont_cell_issue75.m
---
 matlab-ts-mode.el                                                   | 6 +++++-
 .../indent_cont_cell_issue75.skip.txt                               | 3 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index 97487c8b3d..7973982998 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -1803,12 +1803,16 @@ Prev-siblings:
               ;; (source_file (ERROR function) (line_continuation) (ERROR [) 
(line_continuation))
               (save-excursion
                 (while (and prev-sibling
-                            (string= prev-sibling-type "line_continuation"))
+                            (string= prev-sibling-type "line_continuation")
+                            (let ((prev-sibling2 (treesit-node-prev-sibling 
prev-sibling)))
+                              (or (not prev-sibling2)
+                                  (string= (treesit-node-type prev-sibling2) 
"ERROR"))))
                   (goto-char (treesit-node-start prev-sibling))
                   (when (re-search-backward "[^ \t\n\r]" nil t)
                     (setq prev-sibling (treesit-node-at (point))
                           prev-sibling-type (when prev-sibling
                                               (treesit-node-type 
prev-sibling))))))
+
               (when prev-sibling
                 (cond
                  ((string= prev-sibling-type "ERROR")
diff --git 
a/tests/test-matlab-ts-mode-indent-files/indent_cont_cell_issue75.skip.txt 
b/tests/test-matlab-ts-mode-indent-files/indent_cont_cell_issue75.skip.txt
deleted file mode 100644
index 3826be481d..0000000000
--- a/tests/test-matlab-ts-mode-indent-files/indent_cont_cell_issue75.skip.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-See https://github.com/acristoffers/tree-sitter-matlab/issues/75
-The matlab tree-sitter issue is fixed.
-Need to update matlab-ts-mode to support thios case.

Reply via email to