Skip to content

Conversation

@Falconil4
Copy link

Currently, when working with multiple project folders opened in a single vscode window (multi-root workspace), the extension always executes lazygit command with working directory set to the first project workspace root, with no way of opening lazygit for other workspaces.

Proposed change tries to address that by checking currently opened document uri and matching it with window workspaces, falling back to the current logic (first workspace/os homedir) when no document is opened or when document doesn't match any workspace root.

While testing, I've noticed a single potentially unwanted behaviour - since we keep the reference to the opened lazygit terminal window, in a scenario where we open lazygit for workspace X, then open a document from workspace Y without closing the lazygit window, command will focus already opened lazygit window for "incorrect" workspace, instead of opening second window with lazygit for the active workspace.

This could be further improved but I think it may be a pretty opinionated behaviour and changing it will require some pretty heavier modifications to the code (we would need to keep track of all opened windows with their working directories) - that's why I didn't want to make that change without your opinion.

Thanks for the extension, works really nicely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant