Browse Source

Ignore trailing spaces with indent block checking
Fix #24

geequlim 8 years ago
parent
commit
39c642ae82
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/gdscript/diagnostic.ts

+ 1 - 1
src/gdscript/diagnostic.ts

@@ -129,7 +129,7 @@ class GDScriptDiagnosticSeverity {
             let next = i + 1;
             let next = i + 1;
             let nextline = lines[next];
             let nextline = lines[next];
             // changes nextline until finds a line containg text or comes to the last line
             // changes nextline until finds a line containg text or comes to the last line
-            while (((!nextline || nextline.match(/\s+$/)) || nextline.match(/\s*#/)) && next < lines.length - 1) {
+            while (((!nextline || !nextline.trim().length) || nextline.match(/\s*#/)) && next < lines.length - 1) {
               ++next;
               ++next;
               nextline = lines[next];
               nextline = lines[next];
             }
             }