mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Support range select for staging/discarding files
As part of this, you must now press enter on a merge conflict file to focus the merge view; you can no longer press space and if you do it will raise an error.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
@ -182,3 +183,12 @@ func ShortSha(sha string) string {
|
||||
}
|
||||
return sha[:COMMIT_HASH_SHORT_SIZE]
|
||||
}
|
||||
|
||||
// Returns comma-separated list of paths, with ellipsis if there are more than 3
|
||||
// e.g. "foo, bar, baz, [...3 more]"
|
||||
func FormatPaths(paths []string) string {
|
||||
if len(paths) <= 3 {
|
||||
return strings.Join(paths, ", ")
|
||||
}
|
||||
return fmt.Sprintf("%s, %s, %s, [...%d more]", paths[0], paths[1], paths[2], len(paths)-3)
|
||||
}
|
||||
|
Reference in New Issue
Block a user