Skip to content

Fix: Windows scene path handling and SceneTree window state - #48

Merged
Mathijs-Bakker merged 5 commits into
masterfrom
fix/windows-scenetree-bug
Aug 31, 2026
Merged

Mathijs-Bakker merged 5 commits into
masterfrom
fix/windows-scenetree-bug

Conversation

@Mathijs-Bakker

Copy link
Copy Markdown
Owner

📝 Summary

Fixes two SceneTree-related bugs:

  • Fix Windows absolute path handling when resolving .tscn, .gd, and .cs files to res:// paths.
  • Fix SceneTree window state after pressing g on a node with an attached script.

🔍 Details/Changes

  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

  • Tested in Godot version:
  • Tested in Neovim version: 0.13.0
  • Tested on OS / Terminal app: ___
  • Code follows plugin style guidelines
  • Documentation updated (if needed)

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.
@Mathijs-Bakker Mathijs-Bakker self-assigned this Aug 31, 2026
@Mathijs-Bakker Mathijs-Bakker added the bug Something isn't working label Aug 31, 2026
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.
@Mathijs-Bakker
Mathijs-Bakker merged commit ccac07c into master Aug 31, 2026
1 check passed
@Mathijs-Bakker
Mathijs-Bakker deleted the fix/windows-scenetree-bug branch September 14, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant