mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Supports setting the spell check language on desktop https://github.com/siyuan-note/siyuan/issues/16524
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
b8a937b3f1
commit
2e40a53802
2 changed files with 8 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ type Editor struct {
|
||||||
Justify bool `json:"justify"` // 是否两端对齐
|
Justify bool `json:"justify"` // 是否两端对齐
|
||||||
RTL bool `json:"rtl"` // 是否从右到左显示
|
RTL bool `json:"rtl"` // 是否从右到左显示
|
||||||
Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查
|
Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查
|
||||||
|
SpellcheckLanguage string `json:"spellcheckLanguage"` // 拼写检查语言
|
||||||
OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块
|
OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块
|
||||||
BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量
|
BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量
|
||||||
BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量
|
BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量
|
||||||
|
|
@ -88,6 +89,8 @@ func NewEditor() *Editor {
|
||||||
DynamicLoadBlocks: 192,
|
DynamicLoadBlocks: 192,
|
||||||
Justify: false,
|
Justify: false,
|
||||||
RTL: false,
|
RTL: false,
|
||||||
|
Spellcheck: false,
|
||||||
|
SpellcheckLanguage: "en-US",
|
||||||
BacklinkExpandCount: 8,
|
BacklinkExpandCount: 8,
|
||||||
BackmentionExpandCount: -1,
|
BackmentionExpandCount: -1,
|
||||||
BacklinkContainChildren: true,
|
BacklinkContainChildren: true,
|
||||||
|
|
|
||||||
|
|
@ -240,8 +240,8 @@ func InitConf() {
|
||||||
if nil == Conf.Editor {
|
if nil == Conf.Editor {
|
||||||
Conf.Editor = defaultEditor
|
Conf.Editor = defaultEditor
|
||||||
}
|
}
|
||||||
// 新增字段的默认值
|
|
||||||
// 使用指针类型来区分字段不存在(nil)和用户设置为 0(非 nil)
|
// 新增字段的默认值,使用指针类型来区分字段不存在(nil)和用户设置为 0(非 nil)
|
||||||
if nil == Conf.Editor.BacklinkSort {
|
if nil == Conf.Editor.BacklinkSort {
|
||||||
Conf.Editor.BacklinkSort = defaultEditor.BacklinkSort
|
Conf.Editor.BacklinkSort = defaultEditor.BacklinkSort
|
||||||
}
|
}
|
||||||
|
|
@ -282,6 +282,9 @@ func InitConf() {
|
||||||
if conf.MinDynamicLoadBlocks > Conf.Editor.DynamicLoadBlocks {
|
if conf.MinDynamicLoadBlocks > Conf.Editor.DynamicLoadBlocks {
|
||||||
Conf.Editor.DynamicLoadBlocks = conf.MinDynamicLoadBlocks
|
Conf.Editor.DynamicLoadBlocks = conf.MinDynamicLoadBlocks
|
||||||
}
|
}
|
||||||
|
if "" == Conf.Editor.SpellcheckLanguage {
|
||||||
|
Conf.Editor.SpellcheckLanguage = "en-US"
|
||||||
|
}
|
||||||
if 0 > Conf.Editor.BacklinkExpandCount {
|
if 0 > Conf.Editor.BacklinkExpandCount {
|
||||||
Conf.Editor.BacklinkExpandCount = 0
|
Conf.Editor.BacklinkExpandCount = 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue