Make default fileformat value suited to the OS (#3141)

Set fileformat by default to `dos` on Windows.
This commit is contained in:
Dmytro Maluka
2024-03-04 22:20:02 +01:00
committed by GitHub
parent 59dda01cb7
commit af2ec9d540
2 changed files with 10 additions and 2 deletions

View File

@@ -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) {