1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

Convert tabs to spaces in WrapViewLinesToWidth

We haven't needed this before since we were only using the function for text in
confirmations and menus, which is unlikely to contain tabs. We are going to use
it for patches in the staging view though, which often do.
This commit is contained in:
Stefan Haller
2024-11-11 20:04:47 +01:00
parent 1f2cb35cc9
commit 65a28c4c3b
2 changed files with 18 additions and 0 deletions

View File

@@ -334,6 +334,15 @@ func TestWrapViewLinesToWidth(t *testing.T) {
"drifting blah blah",
},
},
{
name: "Tabs",
wrap: true,
text: "\ta\tbb\tccc\tdddd\teeeee",
width: 50,
expectedWrappedLines: []string{
" a bb ccc dddd eeeee",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {