mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-20 23:58:08 +03:00
Rename .encodingInNew key with .encoding
This commit is contained in:
parent
621c92ad61
commit
36f41052df
@ -105,7 +105,7 @@ extension DefaultKeys {
|
||||
// Format
|
||||
static let lineEndCharCode = DefaultKey<Int>("defaultLineEndCharCode")
|
||||
static let encodingList = DefaultKey<[CFStringEncoding]>("encodingList")
|
||||
static let encodingInNew = DefaultKey<UInt>("encodingInNew")
|
||||
static let encoding = DefaultKey<UInt>("encodingInNew")
|
||||
static let saveUTF8BOM = DefaultKey<Bool>("saveUTF8BOM")
|
||||
static let referToEncodingTag = DefaultKey<Bool>("referToEncodingTag")
|
||||
static let syntax = DefaultKey<String>("defaultColoringStyleName")
|
||||
|
@ -9,7 +9,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// © 2004-2007 nakamuxu
|
||||
// © 2014-2023 1024jp
|
||||
// © 2014-2024 1024jp
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -99,7 +99,7 @@ struct DefaultSettings {
|
||||
|
||||
.lineEndCharCode: 0,
|
||||
.encodingList: DefaultSettings.encodings.map(UInt.init),
|
||||
.encodingInNew: String.Encoding.utf8.rawValue,
|
||||
.encoding: String.Encoding.utf8.rawValue,
|
||||
.saveUTF8BOM: false,
|
||||
.referToEncodingTag: true,
|
||||
.syntax: "Plain Text",
|
||||
|
@ -69,7 +69,7 @@ final class EncodingManager {
|
||||
var defaultEncoding: FileEncoding {
|
||||
|
||||
get {
|
||||
let encoding = String.Encoding(rawValue: UserDefaults.standard[.encodingInNew])
|
||||
let encoding = String.Encoding(rawValue: UserDefaults.standard[.encoding])
|
||||
let availableEncoding = String.availableStringEncodings.contains(encoding) ? encoding : .utf8
|
||||
let withBOM = (availableEncoding == .utf8) && UserDefaults.standard[.saveUTF8BOM]
|
||||
|
||||
@ -77,7 +77,7 @@ final class EncodingManager {
|
||||
}
|
||||
|
||||
set {
|
||||
UserDefaults.standard[.encodingInNew] = newValue.encoding.rawValue
|
||||
UserDefaults.standard[.encoding] = newValue.encoding.rawValue
|
||||
UserDefaults.standard[.saveUTF8BOM] = newValue.withUTF8BOM
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user