Add stackundo option

This commit is contained in:
Camille Scholtz
2016-05-26 19:36:59 +02:00
parent e553815501
commit 007ece1e78
3 changed files with 9 additions and 0 deletions

View File

@@ -118,6 +118,10 @@ func (eh *EventHandler) Undo() {
undoThreshold := int64(settings["undothreshold"].(float64)) undoThreshold := int64(settings["undothreshold"].(float64))
if startTime-(te.time.UnixNano()/int64(time.Millisecond)) > undoThreshold { if startTime-(te.time.UnixNano()/int64(time.Millisecond)) > undoThreshold {
return return
} else {
if settings["stackundo"] == true {
startTime = t.(*TextEvent).time.UnixNano() / int64(time.Millisecond)
}
} }
eh.UndoOneEvent() eh.UndoOneEvent()

View File

@@ -79,6 +79,7 @@ func DefaultSettings() map[string]interface{} {
"ruler": true, "ruler": true,
"scrollspeed": float64(2), "scrollspeed": float64(2),
"scrollmargin": float64(3), "scrollmargin": float64(3),
"stackundo": false,
"statusline": true, "statusline": true,
"syntax": true, "syntax": true,
"tabsize": float64(4), "tabsize": float64(4),

View File

@@ -211,6 +211,10 @@ Here are the options that you can set:
default value: `on` 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 * `scrollmargin`: amount of lines you would like to see above and below the cursor
default value: `3` default value: `3`