mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 05:47:06 +09:00
Add stackundo option
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user