瀏覽代碼

Merge pull request #9307 from nunodonato/shadererrorline

highlight the correct error line in shader editor
Thomas Herzog 8 年之前
父節點
當前提交
c5e0c6a336
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/plugins/shader_editor_plugin.cpp

+ 1 - 1
editor/plugins/shader_editor_plugin.cpp

@@ -188,7 +188,7 @@ void ShaderTextEditor::_validate_script() {
 	if (err != OK) {
 		String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text();
 		set_error(error_text);
-		get_text_edit()->set_line_as_marked(sl.get_error_line(), true);
+		get_text_edit()->set_line_as_marked(sl.get_error_line() - 1, true);
 
 	} else {
 		for (int i = 0; i < get_text_edit()->get_line_count(); i++)