Skip to content

Commit

Permalink
🐛 排序和删除线
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Jun 29, 2022
1 parent 171fc05 commit 1ed5487
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Mac/Helpers/NotesTextProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -731,16 +731,16 @@ public class NotesTextProcessor {
}
}

// Todo
NotesTextProcessor.todoInlineRegex.matches(string, range: paragraphRange) { result in
guard let range = result?.range else { return }
let substring = attributedString.mutableString.substring(with: range)

if substring.contains("- [x]") {
let strikeRange = attributedString.mutableString.paragraphRange(for: range)
attributedString.addAttribute(.strikethroughStyle, value: 1, range: strikeRange)
}
}
// // Todo
// NotesTextProcessor.todoInlineRegex.matches(string, range: paragraphRange) { result in
// guard let range = result?.range else { return }
// let substring = attributedString.mutableString.substring(with: range)
//
// if substring.contains("- [x]") {
// let strikeRange = attributedString.mutableString.paragraphRange(for: range)
// attributedString.addAttribute(.strikethroughStyle, value: 1, range: strikeRange)
// }
// }

if !UserDefaultsManagement.liveImagesPreview {
// We detect and process inline images
Expand Down
7 changes: 3 additions & 4 deletions Mac/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1187,10 +1187,9 @@ class ViewController: NSViewController,

note.save(attributed: editArea.attributedString())

// 编辑内容,标题排序的时候有bug,先关掉
// if !updateViews.contains(note), UserDefaultsManagement.sort != .title {
// updateViews.append(note)
// }
if !updateViews.contains(note) {
updateViews.append(note)
}

rowUpdaterTimer.invalidate()
rowUpdaterTimer = Timer.scheduledTimer(timeInterval: 1.2, target: self, selector: #selector(updateTableViews), userInfo: nil, repeats: false)
Expand Down
6 changes: 3 additions & 3 deletions zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Archive" = "存档";

/* No comment provided by engineer. */
"Are you sure you want to irretrievably delete %d note(s)?" = "确定要永久删除%d个笔记?此操作无法恢复!";
"Are you sure you want to irretrievably delete %d note(s)?" = "确定要永久删除%d个笔记?";

/* No comment provided by engineer. */
"Are you sure you want to remove project \"%@\" and all files inside?" = "您确定要删除项目\"%@\"和它下面的所有文件吗?";
Expand Down Expand Up @@ -95,7 +95,7 @@
"Remove" = "移除";

/* No comment provided by engineer. */
"Remove note(s)" = "移除笔记";
"Remove note(s)" = "确定删除";

/* No comment provided by engineer. */
"Rename folder" = "重命名文件夹";
Expand All @@ -113,7 +113,7 @@
"Strikethrough" = "删除线";

/* Delete menu */
"This action cannot be undone." = "此操作无法撤消。";
"This action cannot be undone." = "此操作无法恢复。";

/* No comment provided by engineer. */
"Toggle preview" = "切换预览";
Expand Down

0 comments on commit 1ed5487

Please sign in to comment.