Skip to content

Conversation

@rlkandela
Copy link

@rlkandela rlkandela commented Nov 5, 2025

PR Description

This PR allows the use of {{ SelectedSubmodule.Path }}, {{ SelectedSubmodule.Name }} and {{ SelectedSubmodule.Url }} in custom commands.

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@rlkandela rlkandela marked this pull request as ready for review November 5, 2025 09:45
Copy link
Collaborator

@stefanhaller stefanhaller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the contribution. The code looks good (with one minor nitpick in the test). However, the commit history is a mess, please clean it up; see https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#commit-history.

| status | The 'Status' tab |
| files | The 'Files' tab |
| worktrees | The 'Worktrees' tab |
| submodules | The 'Submodules' tab |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated to the rest of your changes, it should be a commit of its own (probably first). It is already possible to do this today, you just can't do much with it.

Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Submodules().
Focus().
NavigateToLine(Contains("submodule"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only line we have in that view, no need to navigate to it. We usually do

			Lines(
				Contains("submodule").IsSelected(),
			)

in cases like this.

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.

2 participants