make undothresthold a setting (part 2)

This commit is contained in:
Camille Scholtz
2016-05-24 21:40:05 +02:00
parent 3da2a870b6
commit e553815501
2 changed files with 5 additions and 8 deletions

View File

@@ -115,6 +115,7 @@ func (eh *EventHandler) Undo() {
te = t.(*TextEvent)
undoThreshold := int64(settings["undothreshold"].(float64))
if startTime-(te.time.UnixNano()/int64(time.Millisecond)) > undoThreshold {
return
}
@@ -166,6 +167,7 @@ func (eh *EventHandler) Redo() {
te = t.(*TextEvent)
undoThreshold := int64(settings["undothreshold"].(float64))
if (te.time.UnixNano()/int64(time.Millisecond))-startTime > undoThreshold {
return
}