[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/yaml-mode 85d5c63 050/124: allow dash-newline to start a s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/yaml-mode 85d5c63 050/124: allow dash-newline to start a sequence |
Date: |
Sun, 29 Aug 2021 11:36:11 -0400 (EDT) |
branch: elpa/yaml-mode
commit 85d5c630c1b1a2226d657ee01c4e60d039e04474
Author: Antal K <antalk2@gmail.com>
Commit: Antal K <antalk2@gmail.com>
allow dash-newline to start a sequence
---
test-files/test-dash-newline-starts-sequence.yaml | 35 +++++++++++++++++++++++
yaml-mode.el | 2 +-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/test-files/test-dash-newline-starts-sequence.yaml
b/test-files/test-dash-newline-starts-sequence.yaml
new file mode 100644
index 0000000..c8de74a
--- /dev/null
+++ b/test-files/test-dash-newline-starts-sequence.yaml
@@ -0,0 +1,35 @@
+#
+# Old behaviour (version 0.0.12)
+#
+# (1) Move to cursor to the beginning of the line containing 'aaa'
+# (2) Press TAB
+# (3) The line should be indented now.
+# Problem: the line is not indented.
+#
+# Note: in the line containing the dash ('-') there is no space character
+# after the dash, so it is not recognized as start of the sequence entry
+# by
+#
+# (defconst yaml-nested-sequence-re
+# (concat "^\\(?: *- +\\)+"
+# "\\(?:" yaml-bare-scalar-re " *:\\(?: +.*\\)?\\)?$")
+# "Regexp matching a line containing one or more nested YAML sequences.")
+#
+# Proposed change:
+#
+# Change yaml-bare-scalar-re to
+#
+# (defconst yaml-nested-sequence-re
+# (concat "^\\(?:\\(?: *- +\\)+\\|\\(:?-$\\)\\)"
+# "\\(?:" yaml-bare-scalar-re " *:\\(?: +.*\\)?\\)?$")
+# "Regexp matching a line containing one or more nested YAML sequences.")
+#
+# The added alternative \\(:?-$\\) now recognizes the dash-newline sequence.
+#
+# New behaviour:
+#
+# (1) Pressing TAB on the line containing 'aaa' now indents the line.
+# (2) Pressing TAB again unindents the line.
+#
+-
+aaa
diff --git a/yaml-mode.el b/yaml-mode.el
index 15f3872..c7c8966 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -162,7 +162,7 @@ that key is pressed to begin a block literal."
"Regexp matching a line beginning a YAML block literal.")
(defconst yaml-nested-sequence-re
- (concat "^\\(?: *- +\\)+"
+ (concat "^\\(?:\\(?: *- +\\)+\\|\\(:?-$\\)\\)"
"\\(?:" yaml-bare-scalar-re " *:\\(?: +.*\\)?\\)?$")
"Regexp matching a line containing one or more nested YAML sequences.")
- [nongnu] elpa/yaml-mode fea2fb0 114/124: Mention the bug report, (continued)
- [nongnu] elpa/yaml-mode fea2fb0 114/124: Mention the bug report, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 97a58b3 109/124: Make sure not to pre-fill ppss cache with wrong entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 68fecb5 118/124: Exclude newline from `yaml-nested-map-re`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode e142e65 008/124: added newline, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f68472b 024/124: automatically enable yaml-mode for *.yaml files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode cf171f4 026/124: `checkdoc' nits (including the `checkdoc-autoload' extension)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode e2befd8 027/124: Merge pull request #7 from SamB/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 6d40a1d 033/124: resolved conflict, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode d1b8be6 039/124: Merge pull request #23 from Wilfred/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 11df403 044/124: Merge pull request #30 from rhoml/enable-eyaml, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 85d5c63 050/124: allow dash-newline to start a sequence,
ELPA Syncer <=
- [nongnu] elpa/yaml-mode 6590b19 060/124: add copy of GPLv2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 4ae92a7 062/124: Define keymap and syntax table properly, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode c757396 066/124: Remove unnecessary refontification, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 44f73b6 017/124: Add autoload comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 4c1127c 037/124: Improve paragraph filling of block literals, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode d88c80a 053/124: allow spaces before dash-newline, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 4e69e6e 059/124: update address for FSF, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode a4794ea 070/124: Mark non-negative integer values for indent safe, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 28c3403 085/124: Merge pull request #54 from jfrederickson/whitespace-document-separator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 7f41037 087/124: Merge pull request #57 from Kaali/master, ELPA Syncer, 2021/08/29