diff --git a/cmd/micro/eventhandler.go b/cmd/micro/eventhandler.go index de718731..f4d816af 100644 --- a/cmd/micro/eventhandler.go +++ b/cmd/micro/eventhandler.go @@ -118,6 +118,10 @@ func (eh *EventHandler) Undo() { 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) + } } eh.UndoOneEvent() diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index 8124a801..98f65d88 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -79,6 +79,7 @@ func DefaultSettings() map[string]interface{} { "ruler": true, "scrollspeed": float64(2), "scrollmargin": float64(3), + "stackundo": false, "statusline": true, "syntax": true, "tabsize": float64(4), diff --git a/runtime/help/help.md b/runtime/help/help.md index 7961b5e4..19c5bf14 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -211,6 +211,10 @@ Here are the options that you can set: 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`