浏览代码

use bounded value

rickard 2 月之前
父节点
当前提交
79a9233719
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/editor/GlslIndentTask.java

+ 1 - 1
jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/editor/GlslIndentTask.java

@@ -60,7 +60,7 @@ public class GlslIndentTask implements IndentTask {
         int startOffsetBounded = Math.max(startOffset - 1, 0);
         int startOffsetBounded = Math.max(startOffset - 1, 0);
 
 
         //Check if previous line ends with a {
         //Check if previous line ends with a {
-        int previousLineLength = Math.max(startOffset - 1 - context.lineStartOffset(startOffsetBounded), 0);
+        int previousLineLength = Math.max(startOffsetBounded - context.lineStartOffset(startOffsetBounded), 0);
         String previousLine = doc.getText(context.lineStartOffset(startOffsetBounded), previousLineLength);
         String previousLine = doc.getText(context.lineStartOffset(startOffsetBounded), previousLineLength);
 
 
         //Hook other reasons for changes in indentation into this for loop
         //Hook other reasons for changes in indentation into this for loop