summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-08-24Don't return model search results for commits when we don't have columnPositionsStefan Haller
We fixed one specific scenario where this happened ealier in this branch, but in case there are more that we don't know about yet, at least make sure we don't crash.
2024-08-24Return nil columnPositions when not rendering anythingStefan Haller
... instead of returning a slice with a single [0] element. This makes it easier to check whether we have columnPositions.
2024-08-24Fix early exit conditionStefan Haller
I don't know what this condition is supposed to guard against, or whether we really need it (it was added in 06ca71e955, and the commit message of that commit only says "fix bug"). But if we do need it, then it seems that `>=` is more correct than `>`.
2024-08-24Call ReApplySearch after layoutStefan Haller
This fixes a possible crash when exiting filter mode in the commits panel.
2024-08-24Make searching available in the filtered commits listStefan Haller
It is already possible to search a filtered list by searching first, and then enabling a filter, so I found it inconsistent to not allow searching when you are already filtering. One reason for not allowing this might be that the search status (on the left) hides the filter status (on the right), but if we think that's enough reason to not allow both at the same time, then we should cancel a search when we enter filtering.
2024-08-24Scroll views up if needed to show all their content (#3839)Stefan Haller
- **PR Description** There are many situations where this can arise. Some examples are: - the terminal window is small, and you are showing a view that shows more content than fits into the view port, and the view is scrolled all the way down; now you resize the terminal window to a taller size. Previously, the scroll position of the view would stay the same, so it would add blank space at the bottom; now it will scroll to fill that blank space with content - expandFocusedSidePanel is on, you go to the bottom of a list view, now switch to a different panel, then scroll that (now unfocused) panel all the way down with the scroll wheel; now you focus that panel again. It becomes larger because of the accordion behavior, but would show blank space at the bottom. And probably others that I can't remember right now. I only remember that I always found it confusing to look at a view that had blank space at the bottom even though it had more content to scroll into view.
2024-08-24Scroll views up if needed to show all their contentStefan Haller
There are many situations where this can arise. Some examples are: - the terminal window is small, and you are showing a view that shows more content than fits into the view port, and the view is scrolled all the way down; now you resize the terminal window to a taller size. Previously, the scroll position of the view would stay the same, so it would add blank space at the bottom; now it will scroll to fill that blank space with content - expandFocusedSidePanel is on, you go to the bottom of a list view, now switch to a different panel, then scroll that (now unfocused) panel all the way down with the scroll wheel; now you focus that panel again. It becomes larger because of the accordion behavior, but would show blank space at the bottom. And probably others that I can't remember right now. I only remember that I always found it confusing to look at a view that had blank space at the bottom even though it had more content to scroll into view.
2024-08-24Bump gocuiStefan Haller
2024-08-24Support hyperlinks from pagers (#3825)Stefan Haller
- **PR Description** Allows to use `delta --hyperlinks` as a pager, which turns line numbers in the diff into clickable links that take you to the respective file. For VS Code users, I recommend to combine this with `--hyperlinks-file-link-format="vscode://file/{path}:{line}"` so that it jumps to the right line. In addition, I added a few commits that replaces our old, manual ad-hoc handling of links in various places (status view, confirmation panels, information view) with the new hyperlinks feature, which cleans up the code a bit. Fixes #3817.
2024-08-24Use our new hyperlink support in the information viewStefan Haller
2024-08-24Fix Decolorise to also strip hyperlinksStefan Haller
This is needed so that the information view is correctly aligned when we add hyperlinks to it.
2024-08-24Remove now unused function handleGenericClickStefan Haller
2024-08-24Use our new hyperlink support in confirmationsStefan Haller
2024-08-24Use our new hyperlink support in the status panelStefan Haller
2024-08-24Add function to render a hyperlinkStefan Haller
It might seem cleaner to integrate this into the text style system, so that you could say `ts := ts.Url("some link")` and then `ts.Sprint("my text")`. However, this would require adding a new field to TextStyle, which I didn't want to do.
2024-08-24Add documentation about delta --hyperlinksStefan Haller
2024-08-24Set an openHyperlink function on gocuiStefan Haller
2024-08-24Bump gocuiStefan Haller
2024-08-24Improve mouse support for commit message panel (#3836)Stefan Haller
#### PR Description * Fix some minor problems related to cursor movement in an auto-wrapped commit message * Allow clicking in an editable view to set the cursor (most useful in longer commit descriptions) * Allow switching between commit message and description by clicking
2024-08-24Make it possible to scroll the commit description with the mouse wheelStefan Haller
It is just unexpected and confusing when it isn't. There's something weird about the cursor position when scrolling it out of view; it will be shown clamped to the visible area of the view (as if it had moved in the opposite direction than the scroll direction), but then when you type something again, or just move the cursor with the arrow keys, the view will jump back to where the cursor really was. This looks confusing, and it might be reason enough not to allow scrolling the view at all.
2024-08-24Allow switching between commit message and description by clickingStefan Haller
It is annoying to have to tab to the description first before you can set the cursor there by clicking.
2024-08-24Cleanup: use the right context for CommitDescriptionController.Context()Stefan Haller
It doesn't seem to be used by anything, it looks like we only need to implement the method so that the IController interface is satisfied. But still, it doesn't hurt to be correct here, and might avoid confusion in the future when somebody does try to use the method.
2024-08-24Bump gocuiStefan Haller
2024-08-24Fix range select -> stage failure when deleted file is already staged (#3631)Jesse Duffield
- **PR Description** Fix range select -> stage failure when deleted file is already staged. Fixes https://github.com/jesseduffield/lazygit/issues/3603 - **Please check if the PR fulfills these requirements** * [ ] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2024-08-24Don't stage already staged deleted itemsBrandon
2024-08-24Improve fixup commits script (#3853)Jesse Duffield
This script is failing currently on https://github.com/jesseduffield/lazygit/pull/3631 because that fork's master branch is 300 commits behind our own, but the feature branch is up to date. The thing is, we don't actually need to involve the master branch. All we care about is the feature branch's own commits, so this commit simply fetches those commits and checks them. - **PR Description** - **Please check if the PR fulfills these requirements** * [ ] Cheatsheets are up-to-date (run `go generate ./...`) * [ ] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [ ] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [ ] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2024-08-24Improve fixup commits scriptJesse Duffield
This script is failing currently on https://github.com/jesseduffield/lazygit/pull/3631 because that fork's master branch is 300 commits behind our own, but the feature branch is up to date. The thing is, we don't actually need to involve the master branch. All we care about is the feature branch's own commits, so this commit simply fetches those commits and checks them.
2024-08-18Specifying branch name source from refs/heads for fast forwarding (#3807)Stefan Haller
- **PR Description** This fixes #2625
2024-08-18Specifying branch name source from refs/heads for fast forwardingNeko Box Coder
2024-08-18Per-repo config files (and reloading of edited config files) (#3787)Stefan Haller
- **PR Description** Support per-repo user config files. For now we only support `.git/lazygit.yml`; in the future we would also like to support `./.lazygit.yml`, but that one will need a trust prompt as it could be versioned, which adds quite a bit of complexity, so we leave that for later. We do, however, support config files in parent directories (all the way up to the root directory). This makes it possible to add a config file that applies to multiple repos at once. Useful if you want to set different options for all your work repos vs. all your open-source repos, for instance. In addition, we support re-loading edited config files. This makes it much easier to experiment with config settings, especially the ones that affect the layout or color scheme, because you see the effect immediately without having to restart lazygit.
2024-08-18Add checkbox to PR template to make sure UserConfig entries can be hot-reloadedStefan Haller
2024-08-18Add dev documentation about using UserConfigStefan Haller
2024-08-18Add information about per-repo config files to Config.mdStefan Haller
2024-08-18Show a confirmation when changing a config that can't be auto-reloadedStefan Haller
2024-08-18Reload changed user config files on terminal focusStefan Haller
2024-08-18Make custom commands reload when switching reposStefan Haller
Since onNewRepo calls resetKeybindings, which reinitializes the keybindings for custom commands, all we have to do for this is store a pointer to a config instead of storing the customCommands, so we get the up-to-date ones every time.
2024-08-18Re-determine existing main branches if mainBranches config changedStefan Haller
2024-08-18Store Common instead of just the list of configured main branches in ↵Stefan Haller
MainBranches This will make it possible to change the configured main branches at runtime. We'll support this in the next commit.
2024-08-18Make gui.commitLength hot-reloadableStefan Haller
2024-08-18Make gui.statusPanelView config hot-reloadableStefan Haller
It still doesn't update the view immediately when reloading the config, only the next time the status panel is focused. But at least it does it then; writing the code to update the panel when reloading the config is probably not justifiable.
2024-08-18Move initialization of global gocui properties to onUserConfigLoadedStefan Haller
2024-08-18Set custom author and branch colors and nerd font version after loading user ↵Stefan Haller
config
2024-08-18Reinitialize gui.ShowExtrasWindow after loading user configStefan Haller
2024-08-18Initialize translation set after reading user configStefan Haller
This allows having per-repo config files with different languages per repo. Now granted, this is not an important use case that we need to support; however, the goal is to eventually make all configs hot-reloadable (as opposed to loading them only once at startup), so this is one step in that direction.
2024-08-18Support per-repo config filesStefan Haller
For now we only support .git/lazygit.yml; in the future we would also like to support ./.lazygit.yml, but that one will need a trust prompt as it could be versioned, which adds quite a bit of complexity, so we leave that for later. We do, however, support config files in parent directories (all the way up to the root directory). This makes it possible to add a config file that applies to multiple repos at once. Useful if you want to set different options for all your work repos vs. all your open-source repos, for instance.
2024-08-18Make common.UserConfig an atomic.Pointer for safe concurrent accessStefan Haller
Currently, userConfig is only read once at startup and then never changes. Later in this branch, we will add the possibility to reload the user config; this can happen either when switching repositories, or when the user has edited the config file. In both cases, reloading happens on the main thread, but the user config could be accessed concurrently from background threads, so we need to make this safe.
2024-08-18Change direct access to Common.UserConfig to a getterStefan Haller
This will allow us to turn the field into an atomic.Value for safe concurrent access.
2024-08-18Save changed user config back to disk in integration testsStefan Haller
At the moment, the user config is only read once at startup, so there's no point in writing it back to disk. However, later in this branch we will add code that reloads the user config when switching repos, which does happen quite a bit in integration tests; this would undo the changes that a test made in its SetupConfig function, so write those changes to disk to prevent that from happening.
2024-08-18Introduce ConfigFile structStefan Haller
This makes it more explicit how to deal with the different types of config files: a user-supplied config file (via the LG_CONFIG_FILE env var) is required to exist, whereas the default config file will be created if it is missing. We will later extend this with repo-specific config files, which will be skipped if missing.
2024-08-18Split createAllViewsStefan Haller
Split it so createAllViews instanciates the views, and sets those properties that are independent of the user config, and configureViewProperties which sets those things that do depend on the user config. For now we call the second right after the first, but later we'll call configureViewProperties after reloading the user config.