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

20 Commits

Author SHA1 Message Date
Jesse Duffield
a5f3515ad8 Set groundwork for better disabled reasons with range select
Something dumb that we're currently doing is expecting list items
to define an ID method which returns a string. We use that when copying
items to clipboard with ctrl+o and when getting a ref name for diffing.

This commit gets us a little deeper into that hole by explicitly requiring
list items to implement that method so that we can easily use the new
helper functions in list_controller_trait.go.

In future we need to just remove the whole ID thing entirely but I'm too
lazy to do that right now.
2024-01-23 13:03:37 +11:00
Stefan Haller
d5b4f7bb3e Rerender certain views when their width changes
Situations where a view's width changes:
- changing screen modes
- enter staging or patch building
- resizing the terminal window

For the first of these we currently have special code to force a rerender, since
some views render different content depending on whether they are in full-screen
mode. We'll be able to remove that code now, since this new generic mechanism
takes care of that too.

But we will need this more general mechanism for cases where views truncate
their content to the view width; we'll add one example for that later in this
branch.
2023-10-16 09:03:07 +02:00
Stefan Haller
198ead7c14 Extract a ListRenderer struct
I'm doing this not so much because it's a great abstraction, but just because it
will make it much easier to write tests for it.
2023-08-28 14:21:06 +02:00
Stefan Haller
061bfce835 Change length parameter of getDisplayStrings to endIdx
It's more natural to work with this way, as we will see later in this branch.
2023-08-28 14:21:06 +02:00
Stefan Haller
f5c9764dd2 Don't show branch heads in reflog subcommits
It's tricky to get this right for reflog commits wrt what's the current branch
for each one; so just disable it entirely here, it's probably not something
anybody needs here.
2023-07-31 08:34:01 +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
43251e7275 split context common from helper common 2023-04-30 13:19:53 +10:00
Jesse Duffield
f081358943 move getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
0e5a4c7a36 move getModel functions into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
47b91f1ef5 move views into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
e2db6a1732 remove context callback opts 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
524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
Ryooooooga
2eb866fc62
fix: fix a crash when pressing enter in empty commits, reflog, or stash panel 2022-05-05 21:41:44 +09:00
Ryooooooga
4835fc00b8 introduce Ref interface 2022-04-02 17:04:42 +11:00
Jesse Duffield
ad7703df65 show namesake for child views 2022-03-26 18:00:46 +11:00
Jesse Duffield
d93fef4c61 use generics to DRY up context code 2022-03-19 12:12:57 +11:00
Jesse Duffield
722410aded refactor controllers 2022-03-17 19:13:40 +11:00
Jesse Duffield
b93b8cc00a controller for viewing sub commits 2022-03-17 19:13:40 +11:00
Jesse Duffield
d82f175e79 refactor contexts 2022-03-17 19:13:40 +11:00