mirror of
https://github.com/zyedidia/micro.git
synced 2024-09-11 20:17:31 +03:00
Make default fileformat value suited to the OS (#3141)
Set fileformat by default to `dos` on Windows.
This commit is contained in:
parent
59dda01cb7
commit
af2ec9d540
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -284,7 +285,7 @@ var defaultCommonSettings = map[string]interface{}{
|
||||
"encoding": "utf-8",
|
||||
"eofnewline": true,
|
||||
"fastdirty": false,
|
||||
"fileformat": "unix",
|
||||
"fileformat": defaultFileFormat(),
|
||||
"filetype": "unknown",
|
||||
"hlsearch": false,
|
||||
"incsearch": true,
|
||||
@ -319,6 +320,13 @@ var defaultCommonSettings = map[string]interface{}{
|
||||
"wordwrap": false,
|
||||
}
|
||||
|
||||
func defaultFileFormat() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return "dos"
|
||||
}
|
||||
return "unix"
|
||||
}
|
||||
|
||||
func GetInfoBarOffset() int {
|
||||
offset := 0
|
||||
if GetGlobalOption("infobar").(bool) {
|
||||
|
@ -157,7 +157,7 @@ Here are the available options:
|
||||
an effect if the file is empty/newly created, because otherwise the fileformat
|
||||
will be automatically detected from the existing line endings.
|
||||
|
||||
default value: `unix`
|
||||
default value: `unix` on Unix systems, `dos` on Windows
|
||||
|
||||
* `filetype`: sets the filetype for the current buffer. Set this option to
|
||||
`off` to completely disable filetype detection.
|
||||
|
Loading…
Reference in New Issue
Block a user