1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-01 00:54:58 +02:00
Commit Graph

222 Commits

Author SHA1 Message Date
9dbde94952 fix: properly detect icon for BAZEL and WORKSPACE files 2025-02-11 11:26:18 -08:00
c64a7904b7 Add ability to configure branch color patterns 2025-01-12 13:44:26 +01:00
3e623cd1ce Remove the automatic coloring of certain branch names
We used to automatically color branches starting with "feature/", "bugfix/", or
"hotfix/". For those who don't want this, it's a bit non-obvious to turn off,
but it's actually pretty easy to configure manually for those who want this, so
we just remove this default coloring.
2025-01-11 22:13:33 +01:00
7f7d9b166f Tweak file icons
YML icon should be purple, and folder icon should be grey
2025-01-03 15:29:20 +11:00
8b90cca521 Use HEX colors on file icons instead of C256 colors 2025-01-02 15:36:27 +11:00
f455f99705 Add user config gui.showNumstatInFilesView
When enabled, it adds "+n -m" after each file in the Files panel to show how
many lines were added and deleted, as with `git diff --numstat` on the command
line.
2024-12-08 12:09:47 +01:00
f71274b601 Add test to ensure that file icons are one rune
This should prevent errors like that from happening again.
2024-10-13 16:51:27 +02:00
f2fd435c05 Fix many file icons
The string literal "\uf0868" does *not* create a single rune with the code point
f0868, as was intended; instead, it creates two runes, one with the code point
f086, followed by the character '8'.
2024-10-13 16:51:27 +02:00
c3d5798c6c Fix early exit condition
I don't know what this condition is supposed to guard against, or whether we
really need it (it was added in 06ca71e955, and the commit message of that
commit only says "fix bug"). But if we do need it, then it seems that `>=` is
more correct than `>`.
2024-08-24 10:51:25 +02:00
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
cb53e377a8 Fix lack of icon assignation when extension don't match capitalization 2024-08-08 15:18:02 -06:00
cd01e4e7c2 fixup! Add icons for some file names 2024-07-13 13:23:12 +10:00
c5de9cfd8e fixup! Add icons for some file extensions 2024-07-13 13:23:12 +10:00
1129e0e4a0 Add icons for some git remotes 2024-07-13 13:23:12 +10:00
981f1fa7aa Add icons for some file extensions 2024-07-13 13:23:12 +10:00
cad4581d05 Add icons for some file names 2024-07-13 13:23:12 +10:00
f0af42270e Update link from unmaintained exa to maintained eza 2024-07-13 13:23:12 +10:00
2317dac730 fix formatting 2024-07-06 20:27:03 +10:00
08bd36ea78 Add bicep & bicepparam icons 2024-07-06 20:27:03 +10:00
bd782f16dd Provide two config keys for configuring the author length in commits view
One is for the normal view, the other for the expanded view.
2024-06-29 11:28:44 +02:00
7be82d4713 Revert "Add user config gui.commitAuthorFormat (#3625)"
This reverts commit 3af545daf7, reversing
changes made to 629b7ba1b8.

We changed our mind about this and want to provide different options for
achieving the same thing, but with more flexibility.
2024-06-29 11:28:00 +02:00
26132cf5bd Use utils.StringWidth to optimize rendering performance
runewidth.StringWidth is an expensive call, even if the input string is pure
ASCII. Improve this by providing a wrapper that short-circuits the call to len
if the input is ASCII.

Benchmark results show that for non-ASCII strings it makes no noticable
difference, but for ASCII strings it provides a more than 200x speedup.

BenchmarkStringWidthAsciiOriginal-10            718135       1637 ns/op
BenchmarkStringWidthAsciiOptimized-10        159197538          7.545 ns/op
BenchmarkStringWidthNonAsciiOriginal-10         486290       2391 ns/op
BenchmarkStringWidthNonAsciiOptimized-10        502286       2383 ns/op
2024-06-23 13:10:48 +02:00
d406ec06af Fix truncation of long branch names containing non-ASCII characters 2024-06-23 12:25:28 +02:00
7ec784e2a0 Add test demonstrating wrong truncation of branch names containing non-ASCII characters 2024-06-23 12:25:28 +02:00
57f9493770 Add user config gui.commitAuthorFormat 2024-06-15 10:39:50 +04:00
373b1970ca Show divergence from base branch in branches list 2024-06-03 13:59:43 +02:00
5b613f5bc7 Remove ColoredBranchStatus and branchStatusColor
Previously the entire status was colored in a single color, so the API made
sense. This is going to change in the next commit, so now we must include the
color in the string returned from BranchStatus(), which means that callers who
need to do hit detection or measure the length need to decolorize it.

While we're at it, switch the order of ↑3↓7 to ↓7↑3. For some reason that I
can't really explain I find it more logical this way. The software out there is
pretty undecided about it, it seems: VS Code puts ↓7 first, and so does the
shell prompt that comes with git; git status and git branch -v put "ahead" first
though. Shrug.
2024-06-03 13:02:46 +02:00
19d0048cc4 More explicit test of status panel content
Use Equals instead of Contains for asserting the status view content. This
solves the problem that we might assert Contains("↓2 repo"), but what it really
shows is "↑1↓2 repo", and the test still succeeds. At best this is confusing.

Also, this way we don't have to use the awkward DoesNotContain to check that it
really doesn't show a checkmark.

To do this, we need to fix two whitespace problems:
- there was always a space at the end for no reason. Simply remove it. It was
  added in efb51eee96, but from looking at that diff it seems it was added
  accidentally.
- there was a space at the beginning if the branch status was empty. This is
  actually a cosmetic problem, for branches without a status the text was
  indented by once space. Change this so that the space is added conditionally.
  It's a bit awkward that we have to use Decolorise here, but this will go away
  again later in this branch.
2024-06-03 13:02:46 +02:00
0aba686f97 Rename Pushables/Pullables to AheadForPull/BehindForPull
In preparation for adding AheadForPush/BehindForPush in the next commit.
2024-05-19 09:44:38 +02:00
fdff2dec79 Remove redundant variable dedeclarations
In go 1.22, loop variables are redeclared with each iteration of the
loop, rather than simple updated on each iteration. This means that we
no longer need to manually redeclare variables when they're closed over
by a function.
2024-05-19 16:38:21 +10:00
b7673577a2 Enable the commit graph in the divergence view 2024-04-30 13:50:46 +02:00
b63321a302 Refactor pkg/gui/presentation/commits.go slightly to be consistent
Change `func displayCommit()` so all the individual strings are built first,
then the whole thing `cols` is put together. Before, most strings were built
prior to constructing `cols`, but a few were built inside the `cols`
construction.
2024-04-27 11:31:19 +02:00
a4354ccdfb Add config option for length of commit hash displayed in commits view
- Add config option `commitHashLength` to to pkg/config/user_config.go
- Changed the hash display in pkg/gui/presentation/commits.go
2024-04-27 11:30:49 +02:00
7270dea48d Switch git-todo-parser from fsmiamoto original repo to stefanhaller's fork
Sometimes it takes a while to get PRs accepted upstream, and this blocks our
progress. Since I'm pretty much the only one making changes there anyway, it
makes sense to point to my fork directly.
2024-04-22 20:59:15 +02:00
19bef17042 rename sha to hash 10, last remaining sha (hopefully) 2024-04-12 08:33:47 +02:00
170c4ecb8c rename sha to hash 9, case: Sha 2024-04-12 08:33:47 +02:00
05fb12b1d5 rename sha to hash 6, update short hash 2024-04-12 08:33:47 +02:00
9cf1ca10a2 rename sha to hash 5 2024-04-12 08:33:47 +02:00
dc6863b83d rename sha to hash 4 2024-04-12 08:33:47 +02:00
92aab21d3a rename sha to hash 2 2024-04-12 08:33:47 +02:00
e6ef1642fa rename sha to hash 2024-04-12 08:33:47 +02:00
84333eebc3 renaming variable to CommitHash 2024-04-12 08:33:47 +02:00
7f6eea2a55 standardize 'Commit Sha' to 'Commit Hash' 2024-04-12 08:31:40 +02:00
f933a2f7ec Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-04-07 23:24:10 +08:00
f3dba743f0 Add SpinnerConfig
This new config section allows to customize frames and rate of
thespinner
2024-04-06 13:46:15 +02:00
c59e6b6451 Cleanup: don't mess with globals in tests without resetting them
Changing globals in the init() function of a test file is a bad idea, as it
affects all other tests that run after it. Do it explicitly in each test
function that needs it, and take care of restoring the previous value
afterwards.
2024-03-29 10:55:33 +01:00
30db7234d9 Show inline waiting status when checking out a local branch 2024-03-17 07:53:38 +01:00
e5fa9e1c4a Store full ref in Name field of update-ref commits
Strip the prefix at presentation time instead. This makes it easier to find
update-ref todos in order to move them up/down, or delete them.
2024-03-16 15:48:34 +01:00
3b723282cb Show all submodules recursively 2024-03-07 20:16:28 +01:00
416a40b0e6 Don't show branch head on rebase todos if the rebase.updateRefs config is on
The additional branch head icon is more confusing than useful in this situation.
The update-ref entries show very clearly where the branch heads will go when
continuing the rebase; the information where the branch heads used to be before
the rebase is not really needed here, and just makes the display more confusing.

I'm not adding more tests here because the changes to the existing tests
demonstrate the change clearly enough.
2024-03-02 10:17:58 +01:00