diff --git a/cmd/micro/eventhandler.go b/cmd/micro/eventhandler.go index f4d816af..2e182c4c 100644 --- a/cmd/micro/eventhandler.go +++ b/cmd/micro/eventhandler.go @@ -115,13 +115,10 @@ func (eh *EventHandler) Undo() { te = t.(*TextEvent) - undoThreshold := int64(settings["undothreshold"].(float64)) if startTime-(te.time.UnixNano()/int64(time.Millisecond)) > undoThreshold { return } else { - if settings["stackundo"] == true { - startTime = t.(*TextEvent).time.UnixNano() / int64(time.Millisecond) - } + startTime = t.(*TextEvent).time.UnixNano() / int64(time.Millisecond) } eh.UndoOneEvent() @@ -171,7 +168,6 @@ func (eh *EventHandler) Redo() { te = t.(*TextEvent) - undoThreshold := int64(settings["undothreshold"].(float64)) if (te.time.UnixNano()/int64(time.Millisecond))-startTime > undoThreshold { return } diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index cb24bf98..d3661170 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -20,6 +20,7 @@ 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 i not a double click + undoThreshold = 500 // If two events are less than n milliseconds apart, undo both of them ) var ( diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index 98f65d88..4784da79 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -72,19 +72,17 @@ func GetOption(name string) interface{} { // DefaultSettings returns the default settings for micro func DefaultSettings() map[string]interface{} { return map[string]interface{}{ - "autoindent": true, - "colorscheme": "default", - "ignorecase": false, - "indentchar": " ", - "ruler": true, - "scrollspeed": float64(2), - "scrollmargin": float64(3), - "stackundo": false, - "statusline": true, - "syntax": true, - "tabsize": float64(4), - "tabstospaces": false, - "undothreshold": float64(500), + "autoindent": true, + "colorscheme": "default", + "ignorecase": false, + "indentchar": " ", + "ruler": true, + "scrollspeed": float64(2), + "scrollmargin": float64(3), + "statusline": true, + "syntax": true, + "tabsize": float64(4), + "tabstospaces": false, } } diff --git a/runtime/help/help.md b/runtime/help/help.md index 19c5bf14..3458f3ed 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -203,18 +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` -* `stackundo`: reset undothreshold timer to zero if an action is taken before the timer runs out - - default value: `off` - * `scrollmargin`: amount of lines you would like to see above and below the cursor default value: `3`