mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
Remove some unused code
This commit is contained in:
@ -5,34 +5,12 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/common"
|
"github.com/jesseduffield/lazygit/pkg/common"
|
||||||
"github.com/jesseduffield/lazygit/pkg/env"
|
"github.com/jesseduffield/lazygit/pkg/env"
|
||||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||||
"github.com/samber/lo"
|
|
||||||
"github.com/stefanhaller/git-todo-parser/todo"
|
"github.com/stefanhaller/git-todo-parser/todo"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TodoLine struct {
|
|
||||||
Action string
|
|
||||||
Commit *models.Commit
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *TodoLine) ToString() string {
|
|
||||||
if self.Action == "break" {
|
|
||||||
return self.Action + "\n"
|
|
||||||
}
|
|
||||||
return self.Action + " " + self.Commit.Hash() + " " + self.Commit.Name + "\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
func TodoLinesToString(todoLines []TodoLine) string {
|
|
||||||
lines := lo.Map(todoLines, func(todoLine TodoLine, _ int) string {
|
|
||||||
return todoLine.ToString()
|
|
||||||
})
|
|
||||||
|
|
||||||
return strings.Join(lo.Reverse(lines), "")
|
|
||||||
}
|
|
||||||
|
|
||||||
type ChangeTodoAction struct {
|
type ChangeTodoAction struct {
|
||||||
Hash string
|
Hash string
|
||||||
NewAction todo.TodoCommand
|
NewAction todo.TodoCommand
|
||||||
|
@ -79,9 +79,6 @@ func (self *CmdObjBuilder) CloneWithNewRunner(decorate func(ICmdObjRunner) ICmdO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const CHARS_REQUIRING_QUOTES = "\"\\$` "
|
|
||||||
|
|
||||||
// If you update this method, be sure to update CHARS_REQUIRING_QUOTES
|
|
||||||
func (self *CmdObjBuilder) Quote(message string) string {
|
func (self *CmdObjBuilder) Quote(message string) string {
|
||||||
var quote string
|
var quote string
|
||||||
if self.platform.OS == "windows" {
|
if self.platform.OS == "windows" {
|
||||||
|
@ -13,14 +13,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
|
|||||||
return context.NewContextTree(contextCommon)
|
return context.NewContextTree(contextCommon)
|
||||||
}
|
}
|
||||||
|
|
||||||
// using this wrapper for when an onFocus function doesn't care about any potential
|
|
||||||
// props that could be passed
|
|
||||||
func OnFocusWrapper(f func() error) func(opts types.OnFocusOpts) error {
|
|
||||||
return func(opts types.OnFocusOpts) error {
|
|
||||||
return f()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (gui *Gui) defaultSideContext() types.Context {
|
func (gui *Gui) defaultSideContext() types.Context {
|
||||||
if gui.State.Modes.Filtering.Active() {
|
if gui.State.Modes.Filtering.Active() {
|
||||||
return gui.State.Contexts.LocalCommits
|
return gui.State.Contexts.LocalCommits
|
||||||
|
Reference in New Issue
Block a user