Repository navigation
Fix: Windows scene path handling and SceneTree window state - #48
Merged
Merged
Conversation
Add shared path normalization helpers that recognize Unix paths, Windows drive-letter paths, and UNC paths before converting project files to res:// paths. Use the shared conversion in both SceneTree and run scene resolution so Windows absolute paths are not treated as project-relative paths. Add regression coverage for Windows-style absolute paths and outside-project rejection.
Open attached scripts from the remembered source window instead of the SceneTree window so pressing `g` does not replace the tree buffer. Only reuse the tracked SceneTree window when it still contains the SceneTree buffer. If the tracked window is stale, open a fresh tree pane instead of overwriting a source buffer. Add regression coverage for script jumps and stale SceneTree window state.
Open attached scripts from the remembered source window so pressing `g` does not replace the SceneTree buffer. Only reuse the tracked SceneTree window when it still contains the SceneTree buffer. Clear stale window state before opening a fresh SceneTree pane to avoid overwriting source buffers. Add regression coverage for script jumps and stale SceneTree window reuse.
Move project.godot discovery into godotdev.utils so SceneTree and run commands use the same project root lookup behavior. Remove the duplicated local find_project_root implementations from both modules and reuse the shared helper alongside the existing res:// path normalization helpers. Add utility coverage for resolving the project root from the current buffer.
Clear tracked SceneTree and source window handles when their windows are closed, so manual pane closes do not leave stale state behind. Clear SceneTree buffer-backed state when the tree buffer is deleted or wiped out, including the active scene, source path, cached lines, node lookup table, and icon spans. Add regression coverage for closing the SceneTree pane and deleting the SceneTree buffer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Fixes two SceneTree-related bugs:
.tscn,.gd, and.csfiles tores://paths.gon a node with an attached script.🔍 Details/Changes
Add shared path normalization helpers for:
D:/project/...D:\project\...\\server\share\project\...Use the shared
res://conversion in both SceneTree and run-scene resolution.Open attached scripts from the remembered source window instead of replacing the SceneTree buffer.
Reuse the tracked SceneTree window only when it still contains the SceneTree buffer.
Open a fresh SceneTree pane when the tracked tree window is stale.
Add regression tests for both issues.
Fixes
Fixes [Bug]: SceneTree fails on Windows because absolute paths are treated as relative #46
Fixes [Bug]: Pressing
greplaces the SceneTree buffer and breaks its window state #47Verification
stylua lua/godotdev/utils.lua lua/godotdev/scene_tree.lua lua/godotdev/run.lua tests/spec_utils.lua tests/spec_scene_tree.lua nvim --headless -u NONE -i NONE -c "lua dofile('tests/run.lua')" -c qa git diff --check✅ Checklist