mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
@@ -181,6 +181,13 @@ func OptionValueComplete(inputOpt, input string) (string, []string) {
|
|||||||
if strings.HasPrefix("dos", input) {
|
if strings.HasPrefix("dos", input) {
|
||||||
suggestions = append(suggestions, "dos")
|
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
|
screen = nil
|
||||||
|
|
||||||
// Set up everything for the command
|
// 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"))
|
cmd.Stdin = bytes.NewBufferString(b.SaveString(b.Settings["fileformat"] == "dos"))
|
||||||
|
|
||||||
// This is a trap for Ctrl-C so that it doesn't kill micro
|
// 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,
|
"splitRight": true,
|
||||||
"splitBottom": true,
|
"splitBottom": true,
|
||||||
"statusline": true,
|
"statusline": true,
|
||||||
|
"sucmd": "sudo",
|
||||||
"syntax": true,
|
"syntax": true,
|
||||||
"tabmovement": false,
|
"tabmovement": false,
|
||||||
"tabsize": float64(4),
|
"tabsize": float64(4),
|
||||||
|
|||||||
@@ -177,6 +177,11 @@ Here are the options that you can set:
|
|||||||
|
|
||||||
default value: `on`
|
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:
|
Default plugin options:
|
||||||
|
|||||||
Reference in New Issue
Block a user