summaryrefslogtreecommitdiffstats
path: root/pkg/gui/branches_panel.go
AgeCommit message (Collapse)Author
2020-02-25refactor the way we render listsJesse Duffield
2020-02-24better handling of clearing the searchJesse Duffield
2020-02-24support searching in side panelsJesse Duffield
For now we're just doing side panels, because it will take more work to support this in the various main panel contexts
2020-02-18allow fastforwarding the current branchv0.14.4Jesse Duffield
2020-02-16allow resetting to branchJesse Duffield
2020-02-10refresh current branch graph when side panels refreshJesse Duffield
2020-01-12allow fast flicking through any list panelJesse Duffield
Up till now our approach to rendering things like file diffs, branch logs, and commit patches, has been to run a command on the command line, wait for it to complete, take its output as a string, and then write that string to the main view (or secondary view e.g. when showing both staged and unstaged changes of a file). This has caused various issues. For once, if you are flicking through a list of files and an untracked file is particularly large, not only will this require lazygit to load that whole file into memory (or more accurately it's equally large diff), it also will slow down the UI thread while loading that file, and if the user continued down the list, the original command might eventually resolve and replace whatever the diff is for the newly selected file. Following what we've done in lazydocker, I've added a tasks package for when you need something done but you want it to cancel as soon as something newer comes up. Given this typically involves running a command to display to a view, I've added a viewBufferManagerMap struct to the Gui struct which allows you to define these tasks on a per-view basis. viewBufferManagers can run files and directly write the output to their view, meaning we no longer need to use so much memory. In the tasks package there is a helper method called NewCmdTask which takes a command, an initial amount of lines to read, and then runs that command, reads that number of lines, and allows for a readLines channel to tell it to read more lines. We read more lines when we scroll or resize the window. There is an adapter for the tasks package in a file called tasks_adapter which wraps the functions from the tasks package in gui-specific stuff like clearing the main view before starting the next task that wants to write to the main view. I've removed some small features as part of this work, namely the little headers that were at the top of the main view for some situations. For example, we no longer show the upstream of a selected branch. I want to re-introduce this in the future, but I didn't want to make this tasks system too complicated, and in order to facilitate a header section in the main view we'd need to have a task that gets the upstream for the current branch, writes it to the header, then tells another task to write the branch log to the main view, but without clearing inbetween. So it would get messy. I'm thinking instead of having a separate 'header' view atop the main view to render that kind of thing (which can happen in another PR) I've also simplified the 'git show' to just call 'git show' and not do anything fancy when it comes to merge commits. I considered using this tasks approach whenever we write to a view. The only thing is that the renderString method currently resets the origin of a view and I don't want to lose that. So I've left some in there that I consider harmless, but we should probably be just using tasks now for all rendering, even if it's just strings we can instantly make.
2020-01-09add reflog tab in commits panelJesse Duffield
2020-01-07allow commits to be checked outJesse Duffield
2019-11-21add tags panelJesse Duffield
2019-11-21better handling of click events in list viewsJesse Duffield
2019-11-21support setting upstreamJesse Duffield
2019-11-21better fast forwardJesse Duffield
2019-11-21make upstream branch display more lenient on git errorsJesse Duffield
2019-11-21support rebasing onto remote branchJesse Duffield
2019-11-21ensure we switch tabs when switching contextJesse Duffield
2019-11-21support merging remote branches into checked out branchJesse Duffield
2019-11-21support adding/removing remotesJesse Duffield
2019-11-21support viewing a remote branchJesse Duffield
2019-11-21support navigating remotes viewJesse Duffield
2019-11-21allow changing tabs with [ and ]Jesse Duffield
2019-11-21extract out some logic for list viewsJesse Duffield
2019-11-21add remotes context to branches viewJesse Duffield
2019-11-13show upstream branch for branchJesse Duffield
2019-11-11specify upstream when pushing a branch for the first timev0.10.4Jesse Duffield
2019-11-10add mouse supportJesse Duffield
2019-11-05do not return focus to commitsFiles view after selecting to start a new patchJesse Duffield
2019-11-05handling when to show the split panelJesse Duffield
2019-11-05Support building and moving patchesJesse Duffield
WIP
2019-07-14show actual error when trying to check out a branch that doesn't existJesse Duffield
2019-03-23Rely on model rather than view to focus a pointJesse Duffield
Currently when we want to focus a point on a view (i.e. highlight a line and ensure it's within the bounds of a view's box, we use the LinesHeight method on the view to work out how many lines in total there are. This is bad because for example if we come back from editing a file, the view will have no contents so LinesHeight == 0, but we might be trying to select line 10 because there are actual ten things we expect to be rendered already. This causes a crash when e.g. 10 is greater than the height of the view. So we need to pass in to our FocusPoint method the actual number of items we want to render, rather than having the method rely on the LinesHeight, so that the method knows to scroll a bit before setting the cursor's y position. Unfortunately this makes for some awkward code with our current setup. We don't have a good interface type on these state objects so we now need to explicitly obtain the len() of whatever array we're rendering. In the case of the menu panel this is even more awkward because the items list is just an interface{} and it's not easy to get the list of that, so now when we instantiate a menu we need to pass in the count of items as well. The better solution would be to define an interface with a getItems and getLength method and have all these item arrays become structs implementing the interface, but I am too lazy to do this right now :)
2019-03-16allow autostashing changes when checking out a branchJesse Duffield
2019-03-02mouse supportJesse Duffield Duffield
2019-03-02appease golangciJesse Duffield
2019-02-16more work on rebasing featureJesse Duffield
2019-02-16introduce panel contexts and more work on rebasingJesse Duffield
2019-02-16add loading panelJesse Duffield
2019-02-11Merge branch 'master' into feature/rebasingJesse Duffield
2018-12-11only use subprocess for merging, not rebasingJesse Duffield
2018-12-11Make merge panel its own panelJesse Duffield
2018-12-11more work on rebasing including visual indicatorsJesse Duffield
2018-12-11Making ci happierGlenn Vriesman
2018-12-11Added check to invoke continue/refreshGlenn Vriesman
2018-12-11Error handlingGlenn Vriesman
2018-12-11Added error check to satisfy ciGlenn Vriesman
2018-12-11Added rebase handlerGlenn Vriesman
2018-12-10Removed a lot of duplicated codemjarkk
2018-12-10Changed pushPassUname name to credentialsmjarkk
2018-12-09Worked and fixed a view commentsmjarkk
2018-12-08Merge branch 'master' into https-ask-for-username-passwordMark Kopenga