mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-14 19:40:57 +00:00
Add stackundo option
This commit is contained in:
parent
e553815501
commit
007ece1e78
3 changed files with 9 additions and 0 deletions
|
|
@ -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`
|
||||
|
|
|
|||
Loading…
Reference in a new issue