From c44f74a155d27cb558e488513dbf21fccce5a6a3 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 28 Feb 2016 12:28:05 -0500 Subject: Fix rule recognition at beginning of buffer --- snakemake-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'snakemake-mode.el') diff --git a/snakemake-mode.el b/snakemake-mode.el index 2e40b7b..368c4c3 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -229,9 +229,11 @@ Indent according the the first case below that is true. (when (funcall blank-p) (forward-line -1)) (catch 'in-block - (while (not (or (bobp) (funcall blank-p))) - (when (looking-at-p snakemake-rule-or-subworkflow-re) - (throw 'in-block t)) + (while (not (funcall blank-p)) + (cond ((looking-at-p snakemake-rule-or-subworkflow-re) + (throw 'in-block t)) + ((bobp) + (throw 'in-block nil))) (forward-line -1)))))) (defun snakemake-below-naked-field-p () -- cgit v1.2.3