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

1799 Commits

Author SHA1 Message Date
Jesse Duffield
0e0458f355 More compact and flexible date format
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-26 17:31:39 +10:00
Jesse Duffield
05bfa96936
Merge pull request #2672 from jesseduffield/sentence-case 2023-05-26 17:21:33 +10:00
Jesse Duffield
d772c9f1d4 Use sentence case everywhere
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-25 23:52:19 +10:00
Jesse Duffield
add1de4138 Use boolean field to control whether viewport is refreshed on line focus
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-25 17:09:18 +10:00
Jesse Duffield
63dc07fded Construct arg vector manually rather than parse string
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-23 19:49:19 +10:00
Jesse Duffield
ec3a28df43 Right-align key labels in menu
I find this makes it look a little nicer
2023-05-21 12:09:43 +10:00
Jesse Duffield
e1fc90615d Apply strikethrough style to reserved keybindings in menus
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-21 11:31:29 +10:00
Jesse Duffield
460a166e16 Stop displaying navigation keybinding at bottom of screen
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-21 11:01:15 +10:00
Jesse Duffield
2e66d87b94 Use same labels for keys that we use in the config
Previously we were displaying keys in a different format than we expected them in the config.
This was certain to cause confusion.
2023-05-21 10:59:16 +10:00
Jesse Duffield
820f7b9404 Support strikethrough text style 2023-05-21 10:46:13 +10:00
Jesse Duffield
ed857d1e07 Show correct keybinding in tip 2023-05-20 23:36:34 +10:00
Jesse Duffield
ee11046d35 Refactor interface for ApplyPatch 2023-05-20 20:54:39 +10:00
Stefan Haller
401610c0ef Remove the toast when toggling "ignore whitespace"
Now that we visualize the state, the toast is no longer needed.
2023-05-20 12:58:32 +10:00
Stefan Haller
64b2685c2d Visualize the "ignore whitespace" state in the subtitle of the diff view 2023-05-20 12:58:32 +10:00
Stefan Haller
7d4bfb6621 Don't toggle "ignore whitespace" in the staging and patch building panels
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-20 12:58:32 +10: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
d161afe37f Support ignoring whitespace on stash 2023-05-19 17:49:22 +02:00
Jesse Duffield
681a9bf20d
Merge pull request #2612 from longlhh90/fix-commit-prefixes-with-empty-commit-message 2023-05-17 17:12:05 +10:00
Lukas
0606b7a43b remove empty message check as message of commit can be empty 2023-05-17 17:07:50 +10:00
Jesse Duffield
a82134f41c Fix race condition
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-16 21:01:38 +10:00
Jesse Duffield
00b03079d8 Don't deactivate context that you're about to activate 2023-05-16 21:01:38 +10:00
Jesse Duffield
9592686629 Compare contexts with keys
We don't want to compare contexts directly given they are interfaces and not
pointers to structs
2023-05-16 21:01:38 +10:00
Jesse Duffield
114ad52ff6 Rename CmdLog -> GuiLog
We want to log both actions and commands for the sake of integration tests
2023-05-16 21:01:38 +10:00
Stefan Haller
e5dd4d3110 Allow the selected line of a list view to be outside the visible area
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-11 13:23:58 +02:00
Jesse Duffield
007b406b14 remove duplicate method 2023-05-11 19:00:41 +10:00
Jesse Duffield
2b30085dba Merge branch 'master' into refactor-better-encapsulation 2023-05-11 19:00:01 +10:00
Jesse Duffield
5dacbb6293 merge master into refactor-better-encapsulation 2023-05-02 19:05:42 +10:00
Stefan Haller
fba1a2b5ac Add config gui.experimentalShowBranchHeads
People find the new (*) display for branch heads in the commits list confusing,
so make it opt-in for now.
2023-05-02 18:58:54 +10:00
Jesse Duffield
c6c4346d48
Merge pull request #2551 from stefanhaller/fix-initial-context-activation 2023-05-01 21:22:43 +10:00
Jesse Duffield
ee9ae8f07f
Merge pull request #2552 from stefanhaller/support-stacked-branches 2023-05-01 21:07:19 +10:00
Jesse Duffield
af97bf484c Refresh staging panel when committing
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-30 13:19:54 +10:00
Jesse Duffield
a57310df24 Retain commit message when cycling history
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-30 13:19:54 +10:00
Sean
9d68b287db Split commit message panel into commit summary and commit description panel
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-30 13:19:53 +10:00
Jesse Duffield
a5c72d056d ensure initial context is set when entering submodule 2023-04-30 13:19:53 +10:00
Jesse Duffield
dd31f8ecea update cheatsheets 2023-04-30 13:19:53 +10:00
Jesse Duffield
5a7b2ab6d0 fix rendering of commit files view 2023-04-30 13:19:53 +10:00
Jesse Duffield
68a9d7fd77 appease linter 2023-04-30 13:19:53 +10:00
Jesse Duffield
19cbafcdfc remove unused file 2023-04-30 13:19:53 +10:00
Jesse Duffield
f2c85c5b19 move side window actions to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
0faa41e6f8 move toggle whitespace action to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
037cd99138 move quit actions to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
d3e9bc2185 remove unused file 2023-04-30 13:19:53 +10:00
Jesse Duffield
ea4587a3b8 move some methods 2023-04-30 13:19:53 +10:00
Jesse Duffield
2da300f2fb move diffing menu action to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
7848958326 move filtering menu action to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
2cba98e3fe move another action into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
f8c9ce33c2 move more actions into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
71753770ad move custom patch options menu action to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
820b1e811d move custom command action into its own file 2023-04-30 13:19:53 +10:00
Jesse Duffield
4a33fede7b move window arrangement helper 2023-04-30 13:19:53 +10:00