1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00

17 Commits

Author SHA1 Message Date
Stefan Haller
ef7d1a8602 Use non-sticky range diff when entering commit files panel
We make the name of the GetSelectedRefRangeForDiffFiles very specific on purpose
to make it clear that this is only for switching to diff files, so the
implementations can make assumptions about that (unlike GetSelectedRef, which is
used for different purposes and needs to stay more generic).
2024-08-28 19:51:15 +02:00
Stefan Haller
7f935c1ea8 Replace CurrentStaticContext() with Context().CurrentStatic() 2024-08-17 11:14:51 +02:00
Stefan Haller
7ed94c0410 Replace CurrentContext() with Context().Current() 2024-08-17 11:14:51 +02:00
Stefan Haller
98335361fd Replace PopContext() with Context().Pop() 2024-08-17 11:14:50 +02:00
Stefan Haller
4cd15a36e3 Fix custom patch operations on added files
Several custom patch commands on parts of an added file would fail with the
confusing error message "error: new file XXX depends on old contents". These
were dropping the custom patch from the original commit, moving the patch to a
new commit, moving it to a later commit, or moving it to the index.

We fix this by converting the patch header from an added file to a diff against
an empty file. We do this not just for the purpose of applying the patch, but
also for rendering it and copying it to the clip board. I'm not sure it matters
much in these cases, but it does feel more correct for a filtered patch to be
presented this way.
2024-06-23 12:40:31 +02:00
Stefan Haller
13a35408e6 Introduce options struct for RenderPatchForFile
We're going to add another argument in the next commit, and that's getting a bit
much, especially when most of the arguments are bool and you only see true and
false at the call sites without knowing what they mean.
2024-06-23 12:40:31 +02:00
Stefan Haller
caad553502 Remove ErrorMsg
There is no reason any more for application code to show error messages in a
panel. Just return an error instead.
2024-04-18 10:10:30 +02:00
Stefan Haller
e3809f3111 Fix linter warnings
These started to pop up in my editor after I installed an update of gopls, I
think. It's unfortunate that we don't see them on CI.
2024-03-02 10:09:32 +01:00
Stefan Haller
1dac4158e9 Don't pass ignoreWhitespace to git commands
Now that AppState is available via common.Common, they can take it from there.
2023-09-04 17:50:49 +02:00
Stefan Haller
a2778f01c6 Disregard the "ignore whitespace" option in the patch building panel
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-19 18:22:28 +02:00
Jesse Duffield
fc91ef6a59 standardise helper args 2023-04-30 13:19:53 +10:00
Jesse Duffield
43251e7275 split context common from helper common 2023-04-30 13:19:53 +10:00
Jesse Duffield
8edad826ca Begin refactoring gui
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-04-30 13:19:52 +10:00
Jesse Duffield
60f902f026 rename patch manager to patch builder 2023-03-19 16:35:57 +11:00
Stefan Haller
723504a290 Keep side context in context stack when pushing a main context
This fixes accordion mode for the commit files panel. When entering a file, the
commit files panel should stay expanded.
2023-03-04 15:07:48 +01:00
Jesse Duffield
524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
Jesse Duffield
ecaff7fc6c add commit files controller 2022-03-17 19:13:40 +11:00