From 001665ef0bbf03b7459e552c1a41edccd699a711 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 13 Jan 2016 12:51:03 +0000 Subject: [PATCH] Fixed End command indents when not matched with an If #308 --- Assets/Fungus/Flowchart/Editor/BlockEditor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs index e1cb01f8..9bffe4f0 100644 --- a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs @@ -418,7 +418,11 @@ namespace Fungus { indentLevel--; } - command.indentLevel = Math.Max(indentLevel, 0); + + // Negative indent level is not permitted + indentLevel = Math.Max(indentLevel, 0); + + command.indentLevel = indentLevel; if (command.OpenBlock()) {