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

386 Commits

Author SHA1 Message Date
Chris McDonnell
b766ff9c83 Disable global keybinds while popups are active 2025-02-23 08:44:48 +01:00
Bruno Jesus
4856c96521 Fix tag truncated when copying to clipboard
Copy the whole tag to clipboard instead of truncating to the value of
TruncateCopiedCommitHashesTo.
2025-02-03 21:25:34 +00:00
Bruno Jesus
333802fffc Copy Tags to clipboard
Add an option to copy tag(s) to the clipboard.

Works on both the Tags and Commits sections.
2025-01-27 21:53:13 +00:00
Stefan Haller
9de8d17d84 Don't show error toast for disabled keybindings if DisabledReason text is empty
This makes it possible to "silently" disable a keybinding. The effect is the
same as putting the check in the handler and returning nil from there, except
that doing it this way also hides it from the bottom line if DisplayOnScreen is
true.
2025-01-03 10:09:42 +01:00
Samuel Dominguez
4268701606 reorder keybinds to main/down, main/up, secondary/down, secondary/up 2024-12-17 16:57:23 +00:00
Samuel Dominguez
799827ee0e remove duplicate secondary MouseWheelUp keybind 2024-12-17 14:00:21 +00:00
Stefan Haller
d4ef8e53d5 Remove return value of Alert/Confirm/Prompt
This might seem controversial; in many cases the client code gets longer,
because it needs an extra line for an explicit `return nil`. I still prefer
this, because it makes it clearer which calls can return errors.
2024-09-06 08:45:48 +02:00
Stefan Haller
9ec77bba91 Don't allow opening a menu while the search or filter prompt is open
This solves several problems that arise from opening a menu while the prompt is
open. We might try to solve these in a different way, e.g. by dismissing the
search prompt before opening a menu, but restricting what you can do while the
prompt is open seems like the more robust fix.

To achieve this, we
- call resetKeyBindings both when opening and when closing the search/filter
  prompt
- change the keybindings to only contain the ones for the search prompt when
  that context is active.
2024-09-02 18:31:30 +02:00
Stefan Haller
61b59837bb Use our new hyperlink support in confirmations 2024-08-24 10:36:01 +02:00
Stefan Haller
7d486cabeb Allow switching between commit message and description by clicking
It is annoying to have to tab to the description first before you can set the
cursor there by clicking.
2024-08-24 10:21:30 +02:00
Stefan Haller
f98b57aa5e Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent
access.
2024-08-18 10:24:52 +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
pikomonde
84333eebc3 renaming variable to CommitHash 2024-04-12 08:33:47 +02:00
Stefan Haller
b9a75ee0ed Make links clickable in confirmation panels
This is not opt-in, we do it always. I can't imagine a situation where we
wouldn't want it.
2024-03-29 10:55:33 +01:00
Stefan Haller
3b29705a78 Add config to truncate commit hashes when copying them to the clipboard
I often copy hashes in the commits panel in order to paste them into Github
comments (or other places), and I can't stand it when they have the full length.

I picked a default of 12 for this; I find this to be a good middle ground
between being reliable in large repos (12 still works in the linux kernel repo
today, but it might not be enough in really huge repos) and not being too ugly
(many smaller repos can probably get away with less).

We deliberately don't change this for the "Copy to clipboard" menu, since this
gives users a way to copy the unabbreviated sha if they need this occasionally.
2024-03-22 09:58:54 +01:00
Stefan Haller
36fa25fa6d Handle mouse-wheel scrolling in confirmation panel
This can easily happen for the breaking changes panel when there are many.
2024-03-12 13:27:14 +01:00
Jesse Duffield
7bddf53223 Improve keybinding descriptions
This adds a bunch of tooltips to keybindings and updates some keybinding descriptions (i.e. labels).

It's in preparation for displaying more keybindings on-screen (in the bottom right of the screen),
and so due in part to laziness it shortens some descriptions so that we don't need to manage both
a short and long description (for on-screen vs in-menu). Nonetheless I've added a ShortDescription
field for when we do want to have both a short and long description.

You'll notice that some keybindings I deemed unworthy of the options view have longer descriptions,
because I could get away with it.
2024-01-28 08:12:01 +11:00
Jesse Duffield
51fb82d6bf Enforce single-item selection in various actions
We want to show an error when the user tries to invoke an action that expects only
a single item to be selected.

We're using the GetDisabledReason field to enforce this (as well as DisabledReason
on menu items).

I've created a ListControllerTrait to store some shared convenience functions for this.
2024-01-19 10:50:49 +11:00
Stefan Haller
83337d9fa8 Allow showing Disabled errors as error panel instead of toast 2024-01-14 17:45:35 +01:00
Stefan Haller
84e1d15079 Make DisabledReason a struct
This is a pure refactoring, no change in behavior yet. We'll add another field
to the struct in the next commit.
2024-01-14 17:45:35 +01:00
Stefan Haller
09a24ee97d Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
Stefan Haller
e592d81b60 Add Enabled func to Binding 2023-09-18 10:20:23 +02:00
Jesse Duffield
a9e2c8129f Introduce filtered list view model
We're going to start supporting filtering of list views
2023-07-03 12:54:13 +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
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
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
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
509e3efa70 lots more refactoring 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
Luka Markušić
f314cb3763 Remove alternative confirmation and return keymappings 2023-03-09 10:32:00 +01:00
Jesse Duffield
56424eb1aa remove x keybinding for opening menu so we now only use '?' 2023-02-20 19:28:45 +11:00
Ryooooooga
39c20bc634
chore: change to work return-alt1 on all views 2023-02-11 21:19:47 +09:00
Luka Markušić
8af59c3e6e Copy remote branch name to clipboard 2023-02-09 11:56:12 +01:00
stk
d838965a41 Make "Toggle whitespace in diff view" a global key binding
Since it is going to affect a number of views later in the branch, it's easier
to make it global than to find all views that are affected.
2023-02-07 09:25:38 +01:00
wakaka6
6386a03805 add return alt1 2022-12-11 15:44:25 +08:00
Jesse Duffield
7410acd1aa move merge conflicts code into controller 2022-08-07 11:16:03 +10:00
Jesse Duffield
445a625b56 rename merging context to mergeConflicts 2022-08-06 18:05:00 +10:00
Jesse Duffield
524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
Ryooooooga
bfefef92a6
chore(i18n): move InitialViewTabContextMap to gui package 2022-05-18 21:09:48 +09:00
Ryooooooga
5275161a88
chore(i18n): localize panel titles 2022-05-18 20:55:42 +09:00
Ryooooooga
b07e0ea032
fix: fix context of edit hunk 2022-05-06 21:58:40 +09:00
Ryooooooga
d458e78d95
feat: add ability to edit hunk 2022-05-06 21:53:00 +09:00
Mukhlis Akbarrudin
21336d3aa2 refactor: explicitly add alternative keybinding 2022-04-15 08:23:27 +10:00