Commit Graph
228 Commits
Author SHA1 Message Date
Stefan Haller 196e0a3c17 Copy gocui files into lazygit repo under pkg/gocui
I copied all files except dot files (.github and .gitignore), the _examples
folder, and go.mod/go.sum.

At some point we may want to copy the files back to the gocui repo when other
clients (e.g. lazydocker) want to use the newer versions of them.
2026-04-30 14:29:08 +02:00
Stefan Haller 3eb5841b83 Fix searching commits or main view after switching repos
When switching to a different repo, and then back to the original one, searching
would no longer work. The reason is that our contexts set callbacks on their
views; when switching to a different repo we instantiate a new set of contexts,
so they will overwrite the views' callbacks with their new ones, but when
switching back to the original repo, we reuse the old contexts because they are
still in memory, but they won't set their callbacks again since they only do
this on construction.

To fix this, replace the view-local callbacks with a global one on the gui that
takes the view as an argument, so that the callback can look up the associated
context dynamically.
2026-03-27 14:26:20 +01:00
Stefan Haller 9d6064408c Remove go-git dependency 2026-03-27 14:08:08 +01:00
Stefan Haller ab86b42eec Bump gocui 2026-03-08 17:31:57 +01:00
Stefan Haller 06a9ff12ab Bump gocui
This brings in https://github.com/jesseduffield/gocui/pull/98 with the following
fix:

Fix rendering of CRLF sequence ('\r\n')

The FirstGraphemeCluster call returns this as a single character; we want to
treat it the same way as a single \n.

This would be a problem if e.g. a progress bar used \r repeatedly to paint over
the same line, and then printed a \n to move on to the next line; the last pair
of \r and \n was swallowed.

Another scenario where this was a problem was if you stream output of a command
to the log, and the command used \r\n as line feeds. This happens for example
for a background fetch that fails with an error; in that case we print the
combined output (stdout plus stderr) to the log after the command finished, and
for some reason it uses \r\n in that case (I can't actually explain why; when I
do `git fetch --all | xxd` I see only bare \n characters). All output would
appear on one line then.

Also, filter out escape sequences for character set designation; there's nothing
useful we can do with them. In practice, the only one that you are likely to see
is `ESC ( B`, which is sent as part of tput sgr0, which is sometimes used in
scripts to reset all graphics attributes to defaults.
2026-01-28 20:57:09 +01:00
Stefan Haller 39477172b8 Bump gocui
This brings in https://github.com/jesseduffield/gocui/pull/97 ("Exclude commit
trailers from line wrapping").
2026-01-25 11:23:05 +01:00
Stefan Haller ee60102fdc Bump gocui
This fixes pasting multi-line text into the commit message editor; see
https://github.com/jesseduffield/gocui/pull/96.
2026-01-11 18:07:30 +01:00
Stefan Haller 98bf8f86d1 Bump gocui and adapt code accordingly 2026-01-04 18:48:47 +01:00
Stefan Haller c0b6f4adb9 Bump gocui 2026-01-03 14:39:03 +01:00
Stefan Haller fec7e9ce61 Bump gocui (and tcell)
and adapt lazygit's client code accordingly.
2025-12-23 16:49:16 +01:00
Stefan Haller b4b21f9c65 Fix race condition in HandleRender
Move SetContentLineCount into OverwriteLinesAndClearEverythingElse. Calling it
separately beforehand is not concurrency safe; we need both to happen
when the view's writeMutex is locked.
2025-12-23 16:20:32 +01:00
Stefan Haller efd4298b5e Avoid scrolling the selection into view on refresh
It is possible to scroll the selection out of view using the mouse wheel; after
doing this, it would sometimes scroll into view by itself again, for example
when a background fetch occurred. In the files panel this would even happen
every 10s with every regular files refresh.

Fix this by adding a scrollIntoView parameter to HandleFocus, which is false by
default, and is only set to true from controllers that change the selection.
2025-12-23 15:34:38 +01:00
Stefan HallerandChris McDonnell 2189c3b43a Bump gocui
This brings in the fix "Prevent many hyperlinks from launching while mouse
moving".

Co-authored-by: Chris McDonnell <c.a.mcdonn@gmail.com>
2025-12-22 16:22:36 +01:00
Stefan Haller b06c2bb025 Remove the 'minimal' dependency which we no longer need 2025-11-21 07:57:56 +01:00
Stefan Haller ef92e30315 Bump gocui
The main change here is https://github.com/jesseduffield/gocui/pull/85, which
avoids breaking lines after footnote symbols in commit messages (e.g. [1]).

[1]: https://www.example.com/this-is-a-really-long-url-that-lazy-git-automatically-wraps-and-is-an-issue
2025-10-02 17:28:13 +02:00
Stefan Haller 1a72561b15 Remove the kill package dependency 2025-08-01 10:32:47 +02:00
Stefan Haller 0245d663c0 Bump gocui 2025-07-11 10:26:09 +02:00
Stefan Haller 9e64f7dd66 Bump gocui and adapt lazygit code
Adaptions are for this gocui commit:

Cleanup: remove Is* error functions

- Use errors.Is instead of quality comparisons. This is better because it
  matches wrapped errors as well, which we will need later in this branch.
- Inline the errors.Is calls at the call sites. This is idiomatic go, we don't
  need helper functions for this.

See https://go.dev/blog/go1.13-errors for more about this.
2025-06-05 13:20:38 +02:00
Stefan Haller 5dbd91038a Bump gocui
See https://github.com/jesseduffield/gocui/pull/80.

This fixes selecting hunks in the staging view that are longer than the screen.
2025-05-29 14:33:17 +02:00
Stefan Haller c80b0e1910 Bump gocui 2025-05-22 08:48:14 +02:00
Stefan Haller 5686e63af3 Bump generics dependency 2025-05-21 08:51:24 +02:00
Stefan Haller 6c0ee7df2b Bump gocui 2025-04-21 18:03:11 +02:00
Stefan Haller 4cf49ff449 Bump go-git 2025-04-09 11:23:55 +02:00
Stefan Haller 7322cf1a9e Bump gocui
This includes a fix to render hyperlinks in the last line of a view if it
doesn't end with a line feed; see
https://github.com/jesseduffield/gocui/pull/77.
2025-04-08 16:05:34 +02:00
Brandon c488e22abc Bump generics dependency 2025-04-06 22:18:20 -07:00
Stefan Haller ac3824bd7c Bump gocui 2025-02-20 09:13:54 +01:00
Stefan Haller 46ebfbbe87 Bump gocui 2025-02-10 13:40:22 +01:00
Stefan Haller 050a91b7d1 Bump gocui
This improves the contrast of highlighted search results by setting the
foreground color to black.
2025-02-07 14:20:49 +01:00
Stefan Haller fe429c6184 Bump gocui 2025-01-20 17:52:51 +01:00
Stefan Haller 49ca7f6a84 Bump gocui 2025-01-07 17:39:01 +01:00
Stefan Haller ae53059ed2 Bump gocui
This updates gocui to include https://github.com/jesseduffield/gocui/pull/68 and
https://github.com/jesseduffield/gocui/pull/69, which changes views to not have
an extra blank line at the end when content ending in a newline character is
written to them. This makes text views more consistent with list views, which
don't have a blank line after the last list entry either.
2025-01-07 17:34:30 +01:00
Jesse Duffield fdf1643f63 Bump kill package
This should reduce the instances of killing random processes on windows.

See https://github.com/jesseduffield/kill/pull/1
2025-01-01 23:45:53 +11:00
Stefan Haller 2417b70acd Bump gocui 2024-12-23 12:24:09 +01:00
Stefan Haller 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
Stefan Haller 65b731f484 Bump gocui 2024-09-28 12:04:51 +02:00
Stefan Haller 5659f1f3e9 Bump gocui
And adapt client code.
2024-09-06 08:45:48 +02:00
Stefan Haller 8d37f48744 Bump gocui 2024-08-24 17:45:51 +02:00
Stefan Haller 5380fe2483 Fix rendering regression introduced in #3839 2024-08-24 11:46:53 +02:00
Stefan Haller 0aa351443f Bump gocui 2024-08-24 10:47:25 +02:00
Stefan Haller 250eb14de1 Bump gocui 2024-08-24 10:35:59 +02:00
Stefan Haller 59450c7d12 Bump gocui 2024-08-24 10:21:25 +02:00
Stefan Haller 07dd8a2b07 Bump gocui 2024-08-18 10:24:52 +02:00
Stefan Haller da8e4e44b7 Bump gocui 2024-08-17 10:50:32 +02:00
Stefan Haller 62ca873ddd Bump gocui 2024-08-17 10:25:16 +02:00
Stefan Haller 32cfe7a5c3 Bump gocui 2024-06-28 08:14:05 +02:00
Stefan Haller db0a1586d9 Highlight inactive selection in bold
An inactive selection is one where the view is part of the context stack, but
not the active view. For example, the files view when you enter the staging
panel, or any view when you open a panel.
2024-06-23 14:43:13 +02:00
Stefan Haller 9eb9b369ff Bump gocui 2024-06-23 11:54:01 +02:00
Stefan Haller 6a6316cfb6 Use model searching in commits (and sub-commits) view 2024-06-23 11:43:12 +02:00
Stefan Haller 9f8ae76189 Bump gocui
In Gui.onWorker we only make the minimum possible change to get things to
compile after the API-breaking change of the gocui update; we'll make this
cleaner later in this branch.
2024-04-18 10:10:30 +02:00
Stefan Haller 8487bc397d Remove our yaml fork
Switch back to the official go-yaml package.
2024-03-29 17:55:06 +01:00