summaryrefslogtreecommitdiffstats
path: root/pkg/gui
AgeCommit message (Collapse)Author
2023-06-15Turn remoteIcons into a mapStefan Haller
We don't actually use it to do map lookups; we still iterate over it in the same way as before. However, using a map makes it easier to patch elements; see the next commit.
2023-06-07Allow discarding changes only from local commitsStefan Haller
We use CommitFilesController also for the files of commits that we show elsewhere, e.g. for branch commits, tags, or stashes. It doesn't make sense to discard changes from those (for stashes it might be possible to implement it somehow, but that would be a new feature), so we disallow it unless we are in the local commits panel.
2023-06-07Better prompt for discarding old file changesStefan Haller
Lazygit knows what kind of file change this is, so there doesn't have to be any "if" in the prompt text.
2023-06-07Disallow discarding file changes while a directory is selectedStefan Haller
Discarding changes to an entire directory doesn't quite work correctly in all cases; for example, if the current commit added files to the directory (but the directory existed before) then those files won't be removed. It might be possible to fix the command so that these cases always work for directories, but I don't think it's worth the effort (you can always use a custom patch for that), so let's display an error for now.
2023-06-07Fix focus issue when opening recent-repos menu at launchJesse Duffield
I don't know why we were setting the initial context to CurrentSideContext and not just CurrentContext in the first place. If there is no current context in either case it'll default to the files context. So the only issue is if we anticipated that some random context would be focused and we didn't want to activate that. But I can't think of any situation where that would happen.
2023-06-07Support authors and tags in custom command suggestions presetJesse Duffield
2023-06-03Appease linterJesse Duffield
2023-06-01Merge pull request #2699 from jesseduffield/revert-hide-underscoresJesse Duffield
2023-06-01Apply correct styling to root commit in graphJesse Duffield
The root commit is special in that it has no parents. So we need to add a pipe that's headed for a commit that doesn't actually exist i.e. the mythical empty tree commit. We're using the actual hash of that pseudo-commit, but it's not being read anywhere.
2023-06-01Refresh commits viewport on focus lostJesse Duffield
We don't want the highlighted selection sticking around after the context loses focus.
2023-06-01Stop hiding underscores for VSCodeJesse Duffield
VSCode had an issue in their terminal where underscores were printed all over the place. That has now been fixed. See https://github.com/jesseduffield/lazygit/issues/2294 and https://github.com/xtermjs/xterm.js/issues/4238
2023-06-01show commits against branchesJesse Duffield
2023-06-01Show menu instead of prompt when there are conflicts in a rebase or mergeStefan Haller
This solves the issue that previously you could too easily abort a rebase accidentally by hitting escape.
2023-05-29Support using command output directly in menuFromCommand custom command promptJesse Duffield
The menuFromCommand option is a little complicated, so I'm adding an easy way to just use the command output directly, where each line becomes a suggestion, as-is. Now that we support suggestions in the input prompt, there's less of a need for menuFromCommand, but it probably still serves some purpose. In future I want to support this filter/valueFormat/labelFormat thing for suggestions too. I would like to think a little more about the interface though: is using a regex like we currently do really the simplest approach?
2023-05-29Support suggestions generated from command in custom commandsJesse Duffield
This changes the interface a bit but it was only added earlier today so I doubt anybody is dependent on it yet. I'm also updating the docs.
2023-05-29Add suggestionsPreset to custom commands systemJesse Duffield
2023-05-26More compact and flexible date formatJesse Duffield
You can now configure both a time format and a short time format, where the short format kicks in when the time is within the last day
2023-05-26Merge pull request #2672 from jesseduffield/sentence-caseJesse Duffield
2023-05-25Use sentence case everywhereJesse Duffield
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE. Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything is in 'Sentence case' there's no need for the distinction. I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25Use boolean field to control whether viewport is refreshed on line focusJesse Duffield
Go really doesn't like us doing anything inheritance-y: it does not support open recursion meaning it's really hard to re-use code. As such, here we're falling back to conditional logic. This fixes an issue where our ListContextTrait was calling FocusLine which was intended to be overridden by ViewportListContextTrait, but the subclassed function wasn't being called. I'm not actually sure how this went wrong given that it was working fine in the past, but at any rate, the new code is easy to follow.
2023-05-23Construct arg vector manually rather than parse stringJesse Duffield
By constructing an arg vector manually, we no longer need to quote arguments Mandate that args must be passed when building a command Now you need to provide an args array when building a command. There are a handful of places where we need to deal with a string, such as with user-defined custom commands, and for those we now require that at the callsite they use str.ToArgv to do that. I don't want to provide a method out of the box for it because I want to discourage its use. For some reason we were invoking a command through a shell when amending a commit, and I don't believe we needed to do that as there was nothing user- supplied about the command. So I've switched to using a regular command out- side the shell there
2023-05-21Right-align key labels in menuJesse Duffield
I find this makes it look a little nicer
2023-05-21Apply strikethrough style to reserved keybindings in menusJesse Duffield
If a given menu item has an associated keybinding of 'enter', hitting enter won't actually execute that item unless your cursor is on it. This creates confusion, and so we're going to use a strikethrough style to communicate that the keybinding is reserved for something else.
2023-05-21Stop displaying navigation keybinding at bottom of screenJesse Duffield
The reason for this is that now our labels for navigation keybindings are larger so they take up more realestate. It's not the kind of thing a user needs to be told anyway, anybody is going to try out hjkl and the arrow keys when a TUI opens up. We could map from <up> to the single character up unicode rune but given you can rebind this stuff I'd rather keep it simple
2023-05-21Use same labels for keys that we use in the configJesse Duffield
Previously we were displaying keys in a different format than we expected them in the config. This was certain to cause confusion.
2023-05-21Support strikethrough text styleJesse Duffield
2023-05-20Show correct keybinding in tipJesse Duffield
2023-05-20Refactor interface for ApplyPatchJesse Duffield
2023-05-20Remove the toast when toggling "ignore whitespace"Stefan Haller
Now that we visualize the state, the toast is no longer needed.
2023-05-20Visualize the "ignore whitespace" state in the subtitle of the diff viewStefan Haller
2023-05-20Don't toggle "ignore whitespace" in the staging and patch building panelsStefan Haller
The option doesn't have any affect in these views, so we don't need to toggle it here. But the problem was the HandleFocus call at the end: this would activate the wrong view, so we need to avoid it here. Show an error if the user tries to turn the option on, to let them know that it doesn't work here.
2023-05-19Disregard the "ignore whitespace" option in the patch building panelStefan Haller
It's not possible to reliably stage things into a custom patch when "ignore whitespace" is on, so always treat it as off here (like we do in the staging panel). It looks like this is a regression that was introduced in 8edad826ca.
2023-05-19Support ignoring whitespace on stashJesse Duffield
2023-05-17Merge pull request #2612 from ↵Jesse Duffield
longlhh90/fix-commit-prefixes-with-empty-commit-message
2023-05-17remove empty message check as message of commit can be emptyLukas
2023-05-16Fix race conditionJesse Duffield
Our refresh code may try to push a context. It does this in two places: 1) when all merge conflicts are resolved, we push a 'continue merge?' confirmation context 2) when all conflicts of a given file are resolved and we're in the merge conflicts context, we push the files context. Sometimes we push the confirmation context and then push the files context over it, so the user never sees the confirmation context. This commit fixes the race condition by adding a check to ensure that we're still in the merge conflicts panel before we try escaping from it
2023-05-16Don't deactivate context that you're about to activateJesse Duffield
2023-05-16Compare contexts with keysJesse Duffield
We don't want to compare contexts directly given they are interfaces and not pointers to structs
2023-05-16Rename CmdLog -> GuiLogJesse Duffield
We want to log both actions and commands for the sake of integration tests
2023-05-11Allow the selected line of a list view to be outside the visible areaStefan Haller
I don't see a reason why this restriction to have the selection be always visible was necessary. Removing it has two benefits: 1. Scrolling a list view doesn't change the selection. A common scenario: you look at one of the commits of your current branch; you want to see the how many'th commit this is, but the beginning of the branch is scrolled off the bottom of the commits panel. You scroll down to find the beginning of your branch, but this changes the selection and shows a different commit now - not what you want. 2. It is possible to scroll a panel that is not the current one without changing the focus to it. That's how windows in other GUIs usually behave.
2023-05-11remove duplicate methodJesse Duffield
2023-05-11Merge branch 'master' into refactor-better-encapsulationJesse Duffield
2023-05-02merge master into refactor-better-encapsulationJesse Duffield
2023-05-02Add config gui.experimentalShowBranchHeadsStefan Haller
People find the new (*) display for branch heads in the commits list confusing, so make it opt-in for now.
2023-05-01Merge pull request #2551 from stefanhaller/fix-initial-context-activationv0.38.0Jesse Duffield
2023-05-01Merge pull request #2552 from stefanhaller/support-stacked-branchesJesse Duffield
2023-04-30Refresh staging panel when committingJesse Duffield
We now refresh the staging panel when doing an unscoped refresh, so that if we commit from the staging panel we escape back to the files panel if need be. But that causes flickering when doing an unscoped refresh from other contexts, because the refreshStagingPanel function assumes that the staging panel has focus. So we're adding a guard at the top of that function to early exit if we don't have focus.
2023-04-30Retain commit message when cycling historyJesse Duffield
When cycling history, we want to make it so that upon returning to the original prompt, you get your text back. Importantly, we don't want to use the existing preservedMessage field for that because that's only for preserving a NEW commit message, and we don't want the history stuff of the commit reword flow to overwrite that.
2023-04-30Split commit message panel into commit summary and commit description panelSean
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting. By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel, and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel and then 'enter' to submit the message. We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept, so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30ensure initial context is set when entering submoduleJesse Duffield