diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 718d220d..23818c67 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -17,10 +17,14 @@ import ( ) const ( - synLinesUp = 75 // How many lines up to look to do syntax highlighting - synLinesDown = 75 // How many lines down to look to do syntax highlighting - doubleClickThreshold = 400 // How many milliseconds to wait before a second click is not a double click - undoThreshold = 500 // If two events are less than n milliseconds apart, undo both of them + // How many lines up to look to do syntax highlighting + synLinesUp = 75 + // How many lines down to look to do syntax highlighting + synLinesDown = 75 + // How many milliseconds to wait before a second click is not a double click + doubleClickThreshold = 400 + // If two events are less than n milliseconds apart, undo both of them + undoThreshold = int(settings["undothreshold"].(float64)) ) var ( diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index a9b1d358..8124a801 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -72,17 +72,18 @@ func GetOption(name string) interface{} { // DefaultSettings returns the default settings for micro func DefaultSettings() map[string]interface{} { return map[string]interface{}{ - "colorscheme": "default", - "tabsize": float64(4), - "indentchar": " ", - "ignorecase": false, - "autoindent": true, - "syntax": true, - "tabstospaces": false, - "ruler": true, - "statusline": true, - "scrollmargin": float64(3), - "scrollspeed": float64(2), + "autoindent": true, + "colorscheme": "default", + "ignorecase": false, + "indentchar": " ", + "ruler": true, + "scrollspeed": float64(2), + "scrollmargin": float64(3), + "statusline": true, + "syntax": true, + "tabsize": float64(4), + "tabstospaces": false, + "undothreshold": float64(500), } } diff --git a/runtime/help/help.md b/runtime/help/help.md index 3458f3ed..7961b5e4 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -203,6 +203,10 @@ Here are the options that you can set: default value: `on` +* `undothreshold`: maximum time in milliseconds events can be apart to be counted as a single undo + + default value: `500` + * `statusline`: display the status line at the bottom of the screen default value: `on`