diff --git a/addons/gdLinter/UI/Dock.tscn b/addons/gdLinter/UI/Dock.tscn index 9dd1d49..96bd960 100644 --- a/addons/gdLinter/UI/Dock.tscn +++ b/addons/gdLinter/UI/Dock.tscn @@ -26,7 +26,7 @@ layout_mode = 2 [node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/Header"] layout_mode = 2 bbcode_enabled = true -text = "[center]GDLint Plugin 2.0.0[/center]" +text = "[center]GDLint Plugin 2.0.1[/center]" fit_content = true [node name="LintedFile" type="PanelContainer" parent="VBoxContainer"] diff --git a/addons/gdLinter/gdLinter.gd b/addons/gdLinter/gdLinter.gd index 5b1e5f0..f7c0048 100644 --- a/addons/gdLinter/gdLinter.gd +++ b/addons/gdLinter/gdLinter.gd @@ -118,12 +118,14 @@ func on_resource_saved(resource: Resource) -> void: var regex := RegEx.new() regex.compile("\\d+") var result := regex.search(output_array[i]) - var current_line := int(result.strings[0])-1 - var error := output_array[i].rsplit(":", true, 1) - _dock_ui.create_item(current_line+1, error[1]) - if _dock_ui.is_error_ignored(error[1]): - continue - highlight_lines.append(current_line) + if result: + var current_line := int(result.strings[0])-1 + var error := output_array[i].rsplit(":", true, 1) + if len(error) > 1: + _dock_ui.create_item(current_line+1, error[1]) + if _dock_ui.is_error_ignored(error[1]): + continue + highlight_lines.append(current_line) _dock_ui.set_problems_label(_dock_ui.num_problems) _dock_ui.set_ignored_problems_label(_dock_ui.num_ignored_problems) @@ -168,9 +170,11 @@ func get_current_editor() -> CodeEdit: func get_gdlint_path() -> String: + if OS.get_name() == "Windows": + return "gdlint" + + # macOS & Linux var output := [] - OS.execute("python3", ["-m", "site", "--user-base"], output) var python_bin_folder := (output[0] as String).strip_edges().path_join("bin") - return python_bin_folder.path_join("gdlint") diff --git a/addons/gdLinter/plugin.cfg b/addons/gdLinter/plugin.cfg index 586b78c..42c1f50 100644 --- a/addons/gdLinter/plugin.cfg +++ b/addons/gdLinter/plugin.cfg @@ -3,5 +3,5 @@ name="gdLinter" description="Runs `gdlint` on save to automatically lint your GDScript as you code." author="Falli" -version="2.0.0" +version="2.0.1" script="gdLinter.gd"