MCPcopy
hub / github.com/jesseduffield/lazygit / GetEditCmdStr

Method GetEditCmdStr

pkg/commands/git_commands/file.go:32–42  ·  view source on GitHub ↗
(filenames []string)

Source from the content-addressed store, hash-verified

30}
31
32func (self *FileCommands) GetEditCmdStr(filenames []string) (string, bool) {
33 template, suspend := config.GetEditTemplate(self.os.Platform.Shell, &self.UserConfig().OS, self.guessDefaultEditor)
34 quotedFilenames := lo.Map(filenames, func(filename string, _ int) string { return self.cmd.Quote(filename) })
35
36 templateValues := map[string]string{
37 "filename": strings.Join(quotedFilenames, " "),
38 }
39
40 cmdStr := utils.ResolvePlaceholderString(template, templateValues)
41 return cmdStr, suspend
42}
43
44func (self *FileCommands) GetEditAtLineCmdStr(filename string, lineNumber int) (string, bool) {
45 template, suspend := config.GetEditAtLineTemplate(self.os.Platform.Shell, &self.UserConfig().OS, self.guessDefaultEditor)

Callers 2

TestEditFilesCmdFunction · 0.80
EditFilesMethod · 0.80

Calls 4

GetEditTemplateFunction · 0.92
ResolvePlaceholderStringFunction · 0.92
UserConfigMethod · 0.80
QuoteMethod · 0.65

Tested by 1

TestEditFilesCmdFunction · 0.64