mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-23 17:27:14 +09:00
make undothresthold a setting (part 2)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -17,14 +17,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// How many lines up to look to do syntax highlighting
|
||||
synLinesUp = 75
|
||||
// How many lines down to look to do syntax highlighting
|
||||
synLinesDown = 75
|
||||
// How many milliseconds to wait before a second click is not a double click
|
||||
doubleClickThreshold = 400
|
||||
// If two events are less than n milliseconds apart, undo both of them
|
||||
undoThreshold = int(settings["undothreshold"].(float64))
|
||||
synLinesUp = 75 // How many lines up to look to do syntax highlighting
|
||||
synLinesDown = 75 // How many lines down to look to do syntax highlighting
|
||||
doubleClickThreshold = 400 // How many milliseconds to wait before a second click i not a double click
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user