1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
Commit Graph

178 Commits

Author SHA1 Message Date
b3215a750c Cleanup: get rid of the variadic parameter of ContextMgr.Push
Apparently this was an attempt at working around go's lack of default arguments,
but it's very unidiomatic and a bit confusing. Make it a normal parameter
instead, so all clients have to pass it explicitly.
2025-04-08 16:08:25 +02:00
f6f2a52dee Bump gocui and adapt lazygit code
Original commit message of the gocui change:

This fixes View.Size, Width and Height to be the correct (outer) size of a view
including its frame, and InnerSize/InnerWidth/InnerHeight to be the usable
client area exluding the frame. Previously, Size was actually the InnerSize (and
a lot of client code used it as such, so these need to be changed to InnerSize).
InnerSize, on the other hand, was *one* less than Size (not two, as you would
have expected), and in many cases this was made up for at call sites by adding 1
(e.g. in calcRealScrollbarStartEnd, parseInput, and many other places in the
lazygit code).

There are still some weird things left that I didn't address here:
- a view's lower-right coordinates (x1/y1) are one less than you would expect.
  For example, a view with a 2x2 client area like this:
    ╭──╮
    │ab│
    │cd│
    ╰──╯
  in the top-left corner of the screen (x0 and y0 both zero) has x1/xy at 3, not
  4 as would be more natural.
- a view without a frame has its coordinates extended by 1 on all sides; to
  illustrate, the same 2x2 view as before but without a frame, sitting in the
  top-left corder of the screen, has coordinates x0=-1, y0=-1, x1=2, y1=2. This
  is highly confusing and unexpected.

I left these as they are because they would be even more of a breaking change,
and also because they don't have quite as much of an impact on general app code.
2024-12-01 10:40:08 +01:00
59a937ee7a Get rid of error return value of PostRefreshUpdate and a few related ones
I missed these in https://github.com/jesseduffield/lazygit/pull/3890.
2024-10-13 16:55:54 +02:00
371998e635 Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
8302575078 Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
b91beb68e1 Remove return value of HandleRender 2024-09-06 08:45:48 +02:00
5659f1f3e9 Bump gocui
And adapt client code.
2024-09-06 08:45:48 +02:00
fb97c30080 Remove now unused function handleGenericClick 2024-08-24 10:36:01 +02:00
7f935c1ea8 Replace CurrentStaticContext() with Context().CurrentStatic() 2024-08-17 11:14:51 +02:00
bd36b8a95e Replace PushContext() with Context().Push() 2024-08-17 11:14:50 +02:00
d102f12304 Make HandleGenericClick a little smarter
Make it recognize URLs wrapped in angle brackets, and followed by punktuation.
We don't need this for the status panel, but we will need it for confirmation
panels.
2024-03-29 10:55:33 +01:00
6396d1ce03 Extract a function HandleGenericClick 2024-03-29 10:55:33 +01:00
2b9cb3a640 Fix number of lines to read from a task initially for the right scroll bar size
After #3283 we need to read more lines initially so that the scrollbar goes to
its minimal height of 1 for long diffs. Without this, it would start with a
height of 2 and then become smaller after you scroll down half the window
height.
2024-02-16 13:48:27 +01:00
5f30ccfbc3 Log duration of post-refresh-update call
Notably, the reflog view is taking ages here because it's got a
few thousand lines to write to the view.

In future we should only populate the view's viewport.
2023-07-29 09:39:22 +10:00
509e3efa70 lots more refactoring 2023-04-30 13:19:53 +10:00
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
4adca84d68 Make sure scrollbars have the right size initially
We refresh the view after reading just enough to fill it, so that we see the
initial content as quickly as possible, but then we continue reading enough
lines so that we can tell how long the scrollbar needs to be, and then we
refresh again. This can result in slight flicker of the scrollbar when it is
first drawn with a bigger size and then jumps to a smaller size; however, that's
a good tradeoff for a solution that provides both good speed and accuracy.
2023-03-21 18:26:18 +01:00
56424eb1aa remove x keybinding for opening menu so we now only use '?' 2023-02-20 19:28:45 +11:00
eb9fbb0a33 fix(confirmation_panel.go): fix initial origin of editor box 2022-09-01 19:44:17 +09:00
3ada4dde12 fix: fix initial scroll position of edit box 2022-08-18 23:39:15 +09:00
7410acd1aa move merge conflicts code into controller 2022-08-07 11:16:03 +10:00
524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
22d98249fe better popup resizing logic 2022-05-08 13:24:36 +10:00
f257740ea7 add tooltip view for showing menu item descriptions 2022-05-08 13:24:36 +10:00
102c33433b remove dead code 2022-03-26 18:00:46 +11:00
46e9946854 refactor credential handling 2022-03-17 19:13:40 +11:00
41527270ed appease linter 2022-03-17 19:13:40 +11:00
51547e3822 move all refresh code into the one file 2022-03-17 19:13:40 +11:00
138be04e65 refactor contexts code 2022-03-17 19:13:40 +11:00
1dd7307fde start moving commit panel handlers into controller
more

and more

move rebase commit refreshing into existing abstraction

and more

and more

WIP

and more

handling clicks

properly fix merge conflicts

update cheatsheet

lots more preparation to start moving things into controllers

WIP

better typing

expand on remotes controller

moving more code into controllers
2022-03-17 19:13:40 +11:00
a90b6efded start refactoring gui 2022-03-17 19:13:40 +11:00
4ab5e54139 add support for git bisect 2022-01-22 10:48:51 +11:00
cdcfeb396f stop refreshing the screen so much 2022-01-15 14:15:41 +11:00
18f48a43d5 add some more linters 2022-01-09 14:09:53 +11:00
01ea5813a8 align Gui struct with GitCommand 2022-01-04 09:07:15 +11:00
37be9dbea1 support scrolling left and right 2021-11-05 07:58:21 +11:00
802cfb1a04 render commit graph 2021-11-05 07:58:21 +11:00
2fc1498517 some refactoring in anticipation of the graph feature 2021-11-01 10:03:49 +11:00
f6e316dfe5 Improve JumpToBlock keybinding functionality
Improve experience when yaml file has != 5 keybindings and change view
helper to use the length of the array instead of hardcoded value.
2021-10-22 22:38:26 +11:00
91e8765d9c Add JumpToBlock keybinding
This should allow users to decide their own keybinding for jumping
between blocks/panels.
E.g. A user could choose 5-9 instead of 1-5.
2021-10-22 22:38:26 +11:00
e7c27b6f4a small fixes 2021-10-17 06:41:21 +00:00
345c90ac05 fix editor 2021-10-17 04:17:59 +00:00
39c8577074 Use static context 2021-06-16 15:00:17 +10:00
0c2d90a444 Add comment 2021-06-16 15:00:17 +10:00
0c135515a5 Use parent view for tab navigation 2021-06-16 15:00:17 +10:00
a9fbc9eda1 fix merge conflict panel not rendering 2021-04-11 10:21:53 +10:00
39ae122304 more refactoring 2021-04-06 19:34:32 +10:00
4fe512ff3a test
type safe view access
2021-04-06 19:34:32 +10:00
f3a0058eb9 WIP 2021-04-06 19:34:32 +10:00
fafd5234bd refactor to get view tab context map into gui state 2021-04-06 19:34:32 +10:00