summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--snakemake-mode.el6
-rw-r--r--snakemake-test.el15
2 files changed, 19 insertions, 2 deletions
diff --git a/snakemake-mode.el b/snakemake-mode.el
index e89d25b..5b4fb28 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -280,11 +280,13 @@ returned."
(looking-at-p "^\\s-*$")))
(forward-line -1)))
(and (looking-at
- (concat snakemake-field-key-indented-re "\\s-*"))
+ (concat snakemake-field-key-indented-re "\\s-*\\(.*\\)"))
(not (equal (match-string-no-properties 1)
"run"))
(cond (goto-first-p
- (- (match-end 0) (line-beginning-position)))
+ (if (equal (match-string-no-properties 2) "")
+ above-indent
+ (- (match-beginning 2) (line-beginning-position))))
((< field-indent initial-indent)
field-indent)))))))))))))
diff --git a/snakemake-test.el b/snakemake-test.el
index fd4daac..80850d7 100644
--- a/snakemake-test.el
+++ b/snakemake-test.el
@@ -487,6 +487,21 @@ rule abc:
(string=
"
rule abc:
+ output:
+ 'file'
+ 'text'"
+ (snakemake-with-temp-text
+ "
+rule abc:
+ output:
+ 'file'
+<point> 'text'"
+ (snakemake-indent-line)
+ (buffer-string))))
+ (should
+ (string=
+ "
+rule abc:
run:
with this:
"