1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
Commit Graph

68 Commits

Author SHA1 Message Date
Jesse Duffield
2e05ac0c90 paging keybindings for line by line panel
support searching in line by line panel

move mutexes into their own struct

add line by line panel mutex

apply LBL panel mutex

bump gocui to prevent crashing when search item count decreases
2020-10-10 00:23:01 +11:00
Jesse Duffield
37bb89dac3 type i18n 2020-10-10 00:23:01 +11:00
Jesse Duffield
ce6f8ed1bc move models folder into commands folder 2020-09-29 20:48:49 +10:00
Jesse Duffield
f9643448a4 move commit files 2020-09-29 20:48:49 +10:00
Jesse Duffield
4fb52ce2ab better handling of there being no commit files 2020-08-23 15:11:06 +10:00
Jesse Duffield
3eb3de3edc allow explicitly managing focus 2020-08-23 14:29:18 +10:00
Jesse Duffield
94601b4dc9 use context to return to the correct view 2020-08-23 14:29:18 +10:00
Jesse Duffield
bd66162972 fix up patch manager 2020-08-23 14:29:18 +10:00
Jesse Duffield
0dd2c869a8 minor refactor 2020-08-23 14:29:18 +10:00
Jesse Duffield
148f601bcb cleanup now that we're always using the same diff command 2020-08-23 14:29:18 +10:00
Jesse Duffield
43d891b8d6 support creating patches from files in diff mode 2020-08-23 14:29:18 +10:00
Jesse Duffield
8be970e688 stop loading all the diffs at once now that we load them as we go 2020-08-23 14:29:18 +10:00
Jesse Duffield
12bf851c7d faster patch manager 2020-08-23 14:29:18 +10:00
Jesse Duffield
e290710f67 support drilling down into the files of a diff 2020-08-23 14:29:18 +10:00
Jesse Duffield
26f80087dd when toggling files reset patch manager if patch ends up empty 2020-08-23 14:29:18 +10:00
Jesse Duffield
50c9ae863a remove sdump 2020-08-23 14:29:18 +10:00
Jesse Duffield
59f5f5c1af refactor 2020-08-23 14:29:18 +10:00
Jesse Duffield
e6a1bd6566 generalise patch building stuff 2020-08-23 14:29:18 +10:00
Jesse Duffield
609f3f4bfa rename Sha to parent now that we're also considering stash entries 2020-08-23 14:29:18 +10:00
Jesse Duffield
9b42cd2214 slightly better 2020-08-23 14:29:18 +10:00
Jesse Duffield
2d90e1e8ee commit files kind of generalised 2020-08-23 14:29:18 +10:00
Jesse Duffield
ddf25e14af allowing commit files to be viewed in reflog as well 2020-08-23 14:29:18 +10:00
Jesse Duffield
146722beb8 rename to SelectedLineIdx 2020-08-23 14:29:18 +10:00
Jesse Duffield
2855b5b4d5 standardise diffmode 2020-08-23 14:29:18 +10:00
Jesse Duffield
419cb9feb8 more standardisation 2020-08-23 14:29:18 +10:00
Jesse Duffield
dbf6bb5f27 some more things 2020-08-23 14:29:18 +10:00
Jesse Duffield
2f5d5034db good progress 2020-08-23 14:29:18 +10:00
Jesse Duffield
f0c3d3fc4d centralise setting of main views context 2020-08-23 14:29:18 +10:00
Jesse Duffield
ae1c4536e6 WIP 2020-08-23 14:29:18 +10:00
Jesse Duffield
f5b22d94d9 WIP 2020-08-23 14:29:18 +10:00
Jesse Duffield
ac0eedda91 lots more stuff 2020-08-23 14:29:18 +10:00
Jesse Duffield
7f89113245 WIP 2020-08-23 14:29:18 +10:00
Jesse Duffield
cec4cb48cb centralise some list view code 2020-08-23 14:29:18 +10:00
Jesse Duffield
15229bbdab more removing of g and v 2020-08-15 18:01:43 +10:00
Jesse Duffield
0822a9296c rename 2020-08-15 18:01:43 +10:00
Jesse Duffield
d9fa02c53b clean up interface for popup panels 2020-08-15 18:01:43 +10:00
Jesse Duffield
f4718a9047 allow editing commit files 2020-07-21 18:24:39 +10:00
Jesse Duffield
40fbce91ce add new diff mode
WIP

WIP

WIP

WIP

WIP

WIP

WIP
2020-03-29 18:26:24 +11:00
Jesse Duffield
517b7d0283 fix up some things with the patch handling stuff 2020-03-28 13:19:35 +11:00
Jesse Duffield
814ee24c8d better error handling 2020-03-28 11:59:45 +11:00
Jesse Duffield
906a49049e smart refreshing files 2020-03-28 11:59:45 +11:00
Jesse Duffield
198d237679 more centralised handling of refreshing 2020-03-28 11:59:45 +11:00
Jesse Duffield
e47ad846c4 big golangci-lint cleanup 2020-03-09 12:23:13 +11:00
Jesse Duffield
355f1615ab supporing custom pagers step 1 2020-03-04 00:12:23 +11:00
Jesse Duffield
f94d0be2c9 refactor the way we render lists 2020-02-25 21:21:07 +11:00
Jesse Duffield
46be280c92 support searching in side panels
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-24 22:18:04 +11:00
Jesse Duffield
64782a433e fix segfault on line by line panel
The state object is sometimes undefined in the onclick method of the
line by line panel. Because we set it to nil in a bunch of places,
I've decided to just change the main context to 'normal' before setting
it to nil anywhere. That way the keybindings for the line by line panel
won't get executed and we won't get a segfault.
2020-01-31 08:27:49 +11:00
Jesse Duffield
23bcc19180 allow fast flicking through any list panel
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-12 11:17:20 +11:00
Jesse Duffield
986abc1e45 support viewing a remote branch 2019-11-21 22:07:14 +11:00
Jesse Duffield
8aa1062e06 extract out some logic for list views 2019-11-21 22:07:14 +11:00