make undothresthold a setting

This commit is contained in:
Camille Scholtz
2016-05-24 21:38:46 +02:00
parent 55a6b6701d
commit 3da2a870b6
3 changed files with 24 additions and 15 deletions

View File

@@ -17,10 +17,14 @@ import (
)
const (
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 is not a double click
undoThreshold = 500 // If two events are less than n milliseconds apart, undo both of them
// 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))
)
var (

View File

@@ -72,17 +72,18 @@ func GetOption(name string) interface{} {
// DefaultSettings returns the default settings for micro
func DefaultSettings() map[string]interface{} {
return map[string]interface{}{
"colorscheme": "default",
"tabsize": float64(4),
"indentchar": " ",
"ignorecase": false,
"autoindent": true,
"syntax": true,
"tabstospaces": false,
"ruler": true,
"statusline": true,
"scrollmargin": float64(3),
"scrollspeed": float64(2),
"autoindent": true,
"colorscheme": "default",
"ignorecase": false,
"indentchar": " ",
"ruler": true,
"scrollspeed": float64(2),
"scrollmargin": float64(3),
"statusline": true,
"syntax": true,
"tabsize": float64(4),
"tabstospaces": false,
"undothreshold": float64(500),
}
}

View File

@@ -203,6 +203,10 @@ Here are the options that you can set:
default value: `on`
* `undothreshold`: maximum time in milliseconds events can be apart to be counted as a single undo
default value: `500`
* `statusline`: display the status line at the bottom of the screen
default value: `on`