branch: externals/matlab-mode
commit ebf4a4e241ebaec782cc2dd213e62310e6a88595
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
matlab-ts-mode--ei: correct location of comma in struct alignment
---
doc/matlab-code-indent.org | 4 ++--
matlab-ts-mode--ei.el | 9 +++++----
...lectric_indent_struct_and_matrix_in_prop_expected.m | 2 +-
...ic_indent_struct_and_matrix_in_prop_expected_msgs.m | 2 +-
.../electric_indent_struct_expected.m | 18 +++++++++---------
.../electric_indent_struct_expected_msgs.m | 18 +++++++++---------
.../electric_indent_struct_in_prop2_expected.m | 2 +-
.../electric_indent_struct_in_prop2_expected_msgs.m | 2 +-
.../electric_indent_struct_in_prop_expected.m | 2 +-
.../electric_indent_struct_in_prop_expected_msgs.m | 2 +-
.../electric_indent_struct_no_cont_expected.m | 2 +-
.../electric_indent_struct_no_cont_expected_msgs.m | 2 +-
...ndent_struct_with_multiline_field_values_expected.m | 6 +++---
..._struct_with_multiline_field_values_expected_msgs.m | 6 +++---
.../electric_indent_xr_struct_expected.org | 16 ++++++++--------
15 files changed, 47 insertions(+), 46 deletions(-)
diff --git a/doc/matlab-code-indent.org b/doc/matlab-code-indent.org
index 4745420bb1..7619e9bc40 100644
--- a/doc/matlab-code-indent.org
+++ b/doc/matlab-code-indent.org
@@ -563,9 +563,9 @@ directives.
#+begin_src matlab
myStruct = struct( ...
- 'field1' , (2 + 3) * 4, ...
+ 'field1', (2 + 3) * 4, ...
'longField2', "foo", ...
- 'f3' , 2);
+ 'f3', 2);
#+end_src
17. *Function/classdef doc help should be aligned with the function/classdef
keyword*
diff --git a/matlab-ts-mode--ei.el b/matlab-ts-mode--ei.el
index 31d86a4f79..4f724b46fc 100644
--- a/matlab-ts-mode--ei.el
+++ b/matlab-ts-mode--ei.el
@@ -1164,23 +1164,24 @@ See `matlab-ts-mode--ei-get-new-line' for EI-INFO."
(match-string 0 ei-line))))
(when (or (not arg) (string-match-p (rx bos "...") arg)) ;; skip
continuations
(cl-return-from matlab-ts-mode--ei-align-line-in-m-struct ei-info))
- (setq comma-offset (string-match-p "," ei-line open-paren-offset)
+ (setq comma-offset (1+ (string-match-p "," ei-line
open-paren-offset))
new-comma-offset (+ 1 open-paren-offset max-field-width)))
;; Else on later line
(when (string-match-p (rx bos (0+ (or " " "\t")) "...") ei-line) ;; skip
continuations
(cl-return-from matlab-ts-mode--ei-align-line-in-m-struct ei-info))
- (setq comma-offset (string-match-p "," ei-line)
- new-comma-offset (+ (string-match-p "[^ \t]" ei-line)
max-field-width))
+ (setq comma-offset (string-match-p "," ei-line))
(when (not comma-offset) ;; Ending ");" by itself on a line
;; TopTester: electric_indent_struct_in_prop2.m
(cl-return-from matlab-ts-mode--ei-align-line-in-m-struct ei-info))
+ (setq comma-offset (1+ comma-offset) ;; point after the ","
+ new-comma-offset (+ (string-match-p "[^ \t]" ei-line)
max-field-width))
(let ((first-node-in-line (nth 3 ei-info))
(arguments-node (nth 2 tuple)))
(when (not (equal (treesit-node-parent first-node-in-line)
arguments-node))
;; TopTester: electric_indent_struct_with_multiline_field_values.m
(cl-return-from matlab-ts-mode--ei-align-line-in-m-struct ei-info))))
- (let ((n-spaces-to-add (- new-comma-offset comma-offset)))
+ (let ((n-spaces-to-add (1+ (- new-comma-offset comma-offset))))
(when (not (= n-spaces-to-add 0))
(setq ei-line (concat (substring ei-line 0 comma-offset)
(make-string n-spaces-to-add ? )
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected.m
index 3b3a1651fc..49666f7984 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_and_matrix_in_prop
properties
s = struct( ...
- 'field1' , 1, ...
+ 'field1', 1, ...
'otherField2', 2);
m = [100, 2
3, 400];
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected_msgs.m
index a2919fddf3..f00d07c29a 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_and_matrix_in_prop_expected_msgs.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_and_matrix_in_prop % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
properties % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
s = struct( ... % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
- 'field1' , 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
+ 'field1', 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
'otherField2', 2); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
m = [100, 2 % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
3, 400]; % <{Matched rule: (matlab-ts-mode--i-row-matcher
matlab-ts-mode--i-row-matcher-anchor matlab-ts-mode--i-row-matcher-offset)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected.m
index 0d72160c04..a308c15bb9 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected.m
@@ -3,34 +3,34 @@
% t-utils-test-indent: no-line-by-line-indent - line-by-line typing results in
error nodes
if 1
- s1 = struct('field1' , value1 + 10, ...
+ s1 = struct('field1', value1 + 10, ...
...
'otherfield2', value2);
end
-s2 = struct('field1' , value1, ...
+s2 = struct('field1', value1, ...
'otherfield2', value2)
-a(1, 1) = struct('field1' , value1, ...
+a(1, 1) = struct('field1', value1, ...
'otherfield2', value2)
a(1, 2) = struct( ...
- 'field1' , value1, ...
+ 'field1', value1, ...
'otherfield2', value2, ...
- 'foo' , 1 + 2 * 3)
+ 'foo', 1 + 2 * 3)
s3 = struct( ...
- 'field1' , value1, ...
+ 'field1', value1, ...
'otherfield2', value2);
s4 = struct( ...
'longField1', value1, ...
- 'field2' , value2)
+ 'field2', value2)
-s5 = struct("a" , 1, ...
+s5 = struct("a", 1, ...
...
"foobar", (2 + 3) * 4 + 5, ...
- "g" , 3);
+ "g", 3);
not1 = struct('one', value1, 'two', value2, ...
'three', value3);
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected_msgs.m
index d2817f20cf..9dbb5411a6 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_expected_msgs.m
@@ -3,34 +3,34 @@
% t-utils-test-indent: no-line-by-line-indent - line-by-line typing results in
error nodes % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
if 1 % <{Matched rule: (matlab-ts-mode--i-top-level matlab-ts-mode--column-0
0)}>
- s1 = struct('field1' , value1 + 10, ... % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
+ s1 = struct('field1', value1 + 10, ... % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
... % <{Matched rule: ((parent-is "\\`arguments\\'") parent
0)}>
'otherfield2', value2); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
end % <{Matched rule: ((node-is
"\\`\\(?:catch_clause\\|e\\(?:lse\\(?:\\(?:if\\)?_clause\\)\\|nd\\)\\)\\'")
parent 0)}>
-s2 = struct('field1' , value1, ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
+s2 = struct('field1', value1, ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
'otherfield2', value2) % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
-a(1, 1) = struct('field1' , value1, ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
+a(1, 1) = struct('field1', value1, ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
'otherfield2', value2) % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
a(1, 2) = struct( ... % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
- 'field1' , value1, ... % <{Matched rule:
(matlab-ts-mode--i-assign-cont-matcher matlab-ts-mode--i-assign-cont-anchor
matlab-ts-mode--i-assign-cont-offset)}>
+ 'field1', value1, ... % <{Matched rule:
(matlab-ts-mode--i-assign-cont-matcher matlab-ts-mode--i-assign-cont-anchor
matlab-ts-mode--i-assign-cont-offset)}>
'otherfield2', value2, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
- 'foo' , 1 + 2 * 3) % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
+ 'foo', 1 + 2 * 3) % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
s3 = struct( ... % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
- 'field1' , value1, ... % <{Matched rule:
(matlab-ts-mode--i-assign-cont-matcher matlab-ts-mode--i-assign-cont-anchor
matlab-ts-mode--i-assign-cont-offset)}>
+ 'field1', value1, ... % <{Matched rule:
(matlab-ts-mode--i-assign-cont-matcher matlab-ts-mode--i-assign-cont-anchor
matlab-ts-mode--i-assign-cont-offset)}>
'otherfield2', value2); % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
s4 = struct( ... % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
'longField1', value1, ... % <{Matched rule:
(matlab-ts-mode--i-assign-cont-matcher matlab-ts-mode--i-assign-cont-anchor
matlab-ts-mode--i-assign-cont-offset)}>
- 'field2' , value2) % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
+ 'field2', value2) % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
-s5 = struct("a" , 1, ... % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
+s5 = struct("a", 1, ... % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
... % <{Matched rule: ((parent-is "\\`arguments\\'") parent 0)}>
"foobar", (2 + 3) * 4 + 5, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
- "g" , 3); % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
+ "g", 3); % <{Matched rule: ((parent-is "\\`arguments\\'")
parent 0)}>
not1 = struct('one', value1, 'two', value2, ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
'three', value3); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected.m
index 40b9fab954..e9b717d7c7 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_in_prop2
properties
s (1,1) struct {mustBeNonempty} = struct( ...
- 'field1' , 1, ...
+ 'field1', 1, ...
'otherField2', 2 ...
);
m = [
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected_msgs.m
index c55b3105e2..b941529d1c 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop2_expected_msgs.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_in_prop2 % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
properties % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
s (1,1) struct {mustBeNonempty} = struct( ... % <{Matched rule:
((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
- 'field1' , 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
+ 'field1', 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
'otherField2', 2 ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
); % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
m = [ % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected.m
index 9f6bcd28ee..fbdc62fda6 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_in_prop
properties
s (1,1) struct {mustBeNonempty} = struct( ...
- 'field1' , 1, ...
+ 'field1', 1, ...
'otherField2', 2);
m = [100, 2
3, 400];
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected_msgs.m
index a4a6a656ac..ba07e236df 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_in_prop_expected_msgs.m
@@ -5,7 +5,7 @@
classdef electric_indent_struct_in_prop % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
properties % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
s (1,1) struct {mustBeNonempty} = struct( ... % <{Matched rule:
((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
- 'field1' , 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
+ 'field1', 1, ... % <{Matched rule: ((n-p-gp
"\\`\\(?:)\\|arguments\\|line_continuation\\)\\'" "\\`function_call\\'"
"\\`default_value\\'") great-grand-parent 4)}>
'otherField2', 2); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
m = [100, 2 % <{Matched rule: ((node-is
"\\`\\(?:arguments_statement\\|block\\|e\\(?:num\\(?:eration\\)?\\|vents\\)\\|function_definition\\|methods\\|propert\\(?:ies\\|y\\)\\)\\'")
parent 4)}>
3, 400]; % <{Matched rule: (matlab-ts-mode--i-row-matcher
matlab-ts-mode--i-row-matcher-anchor matlab-ts-mode--i-row-matcher-offset)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected.m
index f9a3f5ea2e..05105a15ff 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected.m
@@ -6,5 +6,5 @@
myStruct.stateInfo(end + 1) = struct(
- 'fieldOne' , someThing || otherThing,
+ 'fieldOne', someThing || otherThing,
'otherFieldTwo', 'something');
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected_msgs.m
index 96d8ab485d..4309b7ccab 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_no_cont_expected_msgs.m
@@ -6,5 +6,5 @@
myStruct.stateInfo(end + 1) = struct( % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
- 'fieldOne' , someThing || otherThing, % <{Matched rule: ((n-p-gp nil
nil "\\`assignment\\'") grand-parent 4)}>
+ 'fieldOne', someThing || otherThing, % <{Matched rule: ((n-p-gp nil
nil "\\`assignment\\'") grand-parent 4)}>
'otherFieldTwo', 'something'); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected.m
index 7d11eec04e..8a9003bb0e 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected.m
@@ -2,9 +2,9 @@
% t-utils-test-indent: no-line-by-line-indent - line-by-line typing results in
error nodes
-foobar = struct('type' , {'one', 'two', ...
+foobar = struct('type', {'one', 'two', ...
'three', 'four'}, ...
'fooport', {1, 2, 3, 4, 4, 4, 4, 4, 4, 1, 2}, ...
- 't' , 1, ...
- 'x' , struct('a', 1, ...
+ 't', 1, ...
+ 'x', struct('a', 1, ...
'foo', 10));
diff --git
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected_msgs.m
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected_msgs.m
index 425d78f48c..017d4466a5 100644
---
a/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected_msgs.m
+++
b/tests/test-matlab-ts-mode-electric-indent-files/electric_indent_struct_with_multiline_field_values_expected_msgs.m
@@ -2,9 +2,9 @@
% t-utils-test-indent: no-line-by-line-indent - line-by-line typing results in
error nodes % <{Matched rule: (matlab-ts-mode--i-top-level
matlab-ts-mode--column-0 0)}>
-foobar = struct('type' , {'one', 'two', ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
+foobar = struct('type', {'one', 'two', ... % <{Matched rule:
(matlab-ts-mode--i-top-level matlab-ts-mode--column-0 0)}>
'three', 'four'}, ... % <{Matched rule:
((parent-is "\\`\\(?:function_output\\|row\\)\\'") parent 0)}>
'fooport', {1, 2, 3, 4, 4, 4, 4, 4, 4, 1, 2}, ... % <{Matched
rule: ((parent-is "\\`arguments\\'") parent 0)}>
- 't' , 1, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
- 'x' , struct('a', 1, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
+ 't', 1, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
+ 'x', struct('a', 1, ... % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
'foo', 10)); % <{Matched rule: ((parent-is
"\\`arguments\\'") parent 0)}>
diff --git
a/tests/test-matlab-ts-mode-electric-indent-xr-files/electric_indent_xr_struct_expected.org
b/tests/test-matlab-ts-mode-electric-indent-xr-files/electric_indent_xr_struct_expected.org
index cb0b06dab2..9eac9574fa 100644
---
a/tests/test-matlab-ts-mode-electric-indent-xr-files/electric_indent_xr_struct_expected.org
+++
b/tests/test-matlab-ts-mode-electric-indent-xr-files/electric_indent_xr_struct_expected.org
@@ -20,7 +20,7 @@
- Invoking : "C-i" = indent-for-tab-command
Start point : 202
Moved to point: 194
- : 16:21: s1 = struct('field1' , value1 + 10, ...
+ : 16:21: s1 = struct('field1', value1 + 10, ...
: ^
Buffer modified:
#+begin_src diff
@@ -31,7 +31,7 @@
if 1
- s1 = struct( 'field1', value1 + 10, ...
-+ s1 = struct('field1' , value1 + 10, ...
++ s1 = struct('field1', value1 + 10, ...
...
'otherfield2', value2);
end
@@ -67,7 +67,7 @@
+++ end_contents
@@ -15,7 +15,7 @@
if 1
- s1 = struct('field1' , value1 + 10, ...
+ s1 = struct('field1', value1 + 10, ...
...
- 'otherfield2', value2);
+ 'otherfield2', value2);
@@ -96,7 +96,7 @@
- Invoking : "C-i" = indent-for-tab-command
Start point : 474
Moved to point: 471
- : 34:36: s2 = struct('field1' , value9 + 10, ...
+ : 34:36: s2 = struct('field1', value9 + 10, ...
: ^
Buffer modified:
#+begin_src diff
@@ -107,7 +107,7 @@
if 1
- s2 = struct( 'field1', value9 + 10, ...
-+ s2 = struct('field1' , value9 + 10, ...
++ s2 = struct('field1', value9 + 10, ...
...
'otherfield2', value2);
end
@@ -143,7 +143,7 @@
+++ end_contents
@@ -33,7 +33,7 @@
if 1
- s2 = struct('field1' , value9 + 10, ...
+ s2 = struct('field1', value9 + 10, ...
...
- 'otherfield2', value2);
+ 'otherfield2', value2);
@@ -176,7 +176,7 @@
%}
if 1
- s1 = struct('field1' , value1 + 10, ...
+ s1 = struct('field1', value1 + 10, ...
...
'otherfield2', value2);
end
@@ -194,7 +194,7 @@ end
%}
if 1
- s2 = struct('field1' , value9 + 10, ...
+ s2 = struct('field1', value9 + 10, ...
...
'otherfield2', value2);
end