lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Branch Whitespace Char Option

Open Zombiefleischer opened this issue 2 years ago • 8 comments

Is your feature request related to a problem? Please describe. At work we use branchnames with underline as whitespace replacement

Describe the solution you'd like An option to use your own char as an whitespace replacement like vscode has.

Describe alternatives you've considered Just typing it out yourself, which is kind of tedious.

Zombiefleischer avatar May 23 '23 12:05 Zombiefleischer

Sounds good to me: we currently replace spaces with hyphens in sanitizedBranchName in pkg\gui\controllers\helpers\refs_helper.go. We just need to add a new config key gui.branchWhitespaceChar and default it to a hyphen. The config stuff lives in pkg\config\user_config.go.

Do you wanna raise a PR for this @Zombiefleischer ?

jesseduffield avatar May 23 '23 12:05 jesseduffield

I can try after work :)

Zombiefleischer avatar May 23 '23 13:05 Zombiefleischer

Sounds good :) Reach out if you need any pointers

jesseduffield avatar May 23 '23 13:05 jesseduffield

Started working on #2665 , but have the following problem and can't quite wrap my head around it:

# github.com/jesseduffield/lazygit/pkg/gui
pkg/gui/controllers.go:22:3: not enough arguments in call to helpers.NewRefsHelper
        have (*"github.com/jesseduffield/lazygit/pkg/gui/types".HelperCommon, *commands.GitCommand, *"github.com/jesseduffield/lazygit/pkg/gui/context".ContextTree, *"github.com/jesseduffield/lazygit/pkg/gui/types".Model)
        want (*"github.com/jesseduffield/lazygit/pkg/gui/types".HelperCommon, *commands.GitCommand, *"github.com/jesseduffield/lazygit/pkg/gui/context".ContextTree, *"github.com/jesseduffield/lazygit/pkg/gui/types".Model, *"github.com/jesseduffield/lazygit/pkg/config".UserConfig)

If someone can help me with that would be nice :) I'm now heading to bed.

Zombiefleischer avatar May 23 '23 22:05 Zombiefleischer

Left a comment :)

jesseduffield avatar May 23 '23 22:05 jesseduffield

One thing I noticed the other day is that when you switch from a branch to one that doesn't exist and you create a new one, there is no character substitution on the new branch. image

Zombiefleischer avatar Jun 08 '23 12:06 Zombiefleischer

Looks like the PR for this is still open. Are there any plans to merge it? I'd like to give this a shot if there won't be any progress with the current PR.

skolj avatar Nov 29 '23 03:11 skolj

@jesseduffield @Zombiefleischer can we get this issue / the PR moving again? Would be interested in this as well :)

If I can help I would be open to add the missing tests to the PR.

raulhammerl avatar Oct 19 '24 09:10 raulhammerl