summaryrefslogtreecommitdiffstats
path: root/pkg/gui/views.go
AgeCommit message (Collapse)Author
2024-03-09Add config for soft-wrapping the commit message bodyStefan Haller
2024-01-28Show mode-specific keybinding suggestionsJesse Duffield
As part of making lazygit more discoverable, there are certain keys which you almost certainly need to press when you're in a given mode e.g. 'v' to paste commits when cherry-picking. This commit prominently shows these keybinding suggestions alongside the others in the option view. I'm using the same colours for these keybindings as is associated with the mode elsewhere e.g. yellow for rebasing and cyan for cherry-picking. The cherry-picking one is a bit weird because we also use cyan text to show loaders and app status at the bottom left so it may be confusing, but I haven't personally found it awkward from having tested it out myself. Previously we would render these options whenever a new context was activated, but now that we need to re-render options whenever a mode changes, I'm instead rendering them on each screen re-render (i.e. in the layout function). Given how cheap it is to render this text, I think it's fine performance-wise.
2024-01-19Standardise display of range selection across viewsJesse Duffield
We're not fully standardising here: different contexts can store their range state however they like. What we are standardising on is that now the view is always responsible for highlighting the selected lines, meaning the context/controller needs to tell the view where the range start is. Two convenient benefits from this change: 1) we no longer need bespoke code in integration tests for asserting on selected lines because we can just ask the view 2) line selection in staging/patch-building/merge-conflicts views now look the same as in list views i.e. the highlight applies to the whole line (including trailing space) I also noticed a bug with merge conflicts not rendering the selection on focus though I suspect it wasn't a bug with any real consequences when the view wasn't displaying the selection. I'm going to scrap the selectedRangeBgColor config and just let it use the single line background color. Hopefully nobody cares, but there's really no need for an extra config.
2023-12-09Layout the bottom line view using spacer viewsJesse Duffield
We are also removing the single-character padding on the left/right edges of the bottom line because it's unnecessary Unfortunately we need to create views for each spacer: it's not enough to just layout the existing views with padding inbetween because gocui only renders views meaning if there is no view in a given position, that position will just render whatever was there previously (at least that's what I recall from talking this through with Stefan: I could be way off). Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
2023-12-09Fix an incorrect commentStefan Haller
It sounds like at some point we only showed a slash as the search prompt, but I dug a bit through the history and couldn't find a state of the code where that was the case. (shrug)
2023-09-09feat: add jump-to-panel label settingMaria José Solano
2023-08-21Mention ctrl+o binding in commit message sub titleStefan Haller
Only do this when an onSwitchToEditor function is actually provided. For the "Move patch into new commit" command we don't, because it isn't totally straightforward in that case.
2023-08-02Fix focus issueJesse Duffield
When opening lazygit with `lazygit log` the worktrees view was appearing in front of the files view. This is because it had higher precedence than the files view in the ordered view mapping, and that was because it originally was in the branches window so it was further down the list. The reason this didn't cause issues on typical startup is that the files context is activated at the start so it is brought to the front.
2023-07-30Standardise on using lo for slice functionsJesse Duffield
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
2023-07-30Initial addition of support for worktreesJoel Baranick
2023-07-15Fix potentially wrong help text in commit message panelStefan Haller
It said "Press tab to toggle focus", which is wrong for people who remapped their togglePanel key binding to something else. Print the actual key binding instead.
2023-07-03Color view frame differently when searching/filteringJesse Duffield
Given that we now persist search/filter states even after a side context loses focus, we need to make it really clear to the user that the context is currently being searched/filtered
2023-07-03Introduce filtered list view modelJesse Duffield
We're going to start supporting filtering of list views
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-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-30move window arrangement helperJesse Duffield
2023-04-30lots more refactoringJesse Duffield
2023-04-30Begin refactoring guiJesse Duffield
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the gui package purely for the sake of better encapsulation
2023-03-26fix reflog text colour by defaulting every view to the same foreground colourJesse Duffield
2023-03-18Add border config (#2344)yk-kd
Co-authored-by: yk-kd <yosuke.komada@gmail.com>
2023-02-15Turn highlighting off in staging/stagingSecondary viewsstk
There are two reasons for doing this: 1. The view cursor position is often out of sync with the selected line; see first commit of this branch. 2. The highlighting is already turned off when the view loses focus, and never turned back on thereafter. So just turn it off from the start then.
2023-02-10chore: remove `UNKNOWN_VIEW_ERROR_MSG`Ryooooooga
2022-12-30integrate snake game into lazygitJesse Duffield
2022-08-06rename merging context to mergeConflictsJesse Duffield
2022-08-06refactor to only have one context per viewJesse Duffield
2022-05-08add tooltip view for showing menu item descriptionsJesse Duffield
2022-05-08refactor view definitionsJesse Duffield