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 ( const (
synLinesUp = 75 // How many lines up to look to do syntax highlighting // How many lines up to look to do syntax highlighting
synLinesDown = 75 // How many lines down to look to do syntax highlighting synLinesUp = 75
doubleClickThreshold = 400 // How many milliseconds to wait before a second click is not a double click // How many lines down to look to do syntax highlighting
undoThreshold = 500 // If two events are less than n milliseconds apart, undo both of them 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 ( var (

View File

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

View File

@@ -203,6 +203,10 @@ Here are the options that you can set:
default value: `on` 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 * `statusline`: display the status line at the bottom of the screen
default value: `on` default value: `on`