mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-23 17:30:24 +00:00
parent
46ced988eb
commit
f4e94d6d34
5 changed files with 18 additions and 5 deletions
|
|
@ -181,6 +181,13 @@ func OptionValueComplete(inputOpt, input string) (string, []string) {
|
|||
if strings.HasPrefix("dos", input) {
|
||||
suggestions = append(suggestions, "dos")
|
||||
}
|
||||
case "sucmd":
|
||||
if strings.HasPrefix("sudo", input) {
|
||||
suggestions = append(suggestions, "sudo")
|
||||
}
|
||||
if strings.HasPrefix("doas", input) {
|
||||
suggestions = append(suggestions, "doas")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ func (b *Buffer) SaveAsWithSudo(filename string) error {
|
|||
screen = nil
|
||||
|
||||
// Set up everything for the command
|
||||
cmd := exec.Command("sudo", "tee", filename)
|
||||
cmd := exec.Command(b.Settings["sucmd"].(string), "tee", filename)
|
||||
cmd.Stdin = bytes.NewBufferString(b.SaveString(b.Settings["fileformat"] == "dos"))
|
||||
|
||||
// This is a trap for Ctrl-C so that it doesn't kill micro
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -215,6 +215,7 @@ func DefaultGlobalSettings() map[string]interface{} {
|
|||
"splitRight": true,
|
||||
"splitBottom": true,
|
||||
"statusline": true,
|
||||
"sucmd": "sudo",
|
||||
"syntax": true,
|
||||
"tabmovement": false,
|
||||
"tabsize": float64(4),
|
||||
|
|
|
|||
|
|
@ -177,6 +177,11 @@ Here are the options that you can set:
|
|||
|
||||
default value: `on`
|
||||
|
||||
* `sucmd`: specifies the super user command. On most systems this is "sudo" but on BSD it can be "doas." This
|
||||
option can be customized and is only used when saving with su.
|
||||
|
||||
default value: `sudo`
|
||||
|
||||
---
|
||||
|
||||
Default plugin options:
|
||||
|
|
|
|||
Loading…
Reference in a new issue