Skip to content

Commit

Permalink
🔖v1.1.6 / 2024.11.19
Browse files Browse the repository at this point in the history
- 🐛 修复进行无样式格式刷后,选择区域不会自动清除
  • Loading branch information
Achuan-2 committed Nov 19, 2024
1 parent a0615a1 commit 182a413
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.1.6 / 2024.11.19

- 🐛 修复进行无样式格式刷后,选择区域不会自动清除

## v1.1.5 / 2024.11.19

- 🐛 修复格式刷之后,按esc键不退出的格式刷模式的问题:
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-plugin-formatPainter",
"author": "Achuan-2",
"url": "https://github.com/Achuan-2/siyuan-plugin-formatPainter",
"version": "1.1.5",
"version": "1.1.6",
"minAppVersion": "3.1.12",
"backends": [
"windows",
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ export default class PluginSample extends Plugin {
// Apply the stored format to the selected text
// 如果都为空
this.protyle.toolbar.setInlineMark(this.protyle, "clear", "range");
// this.protyle.toolbar.setInlineMark(this.protyle, "text", "range");
if (!this.formatData) {
// 移动光标到末尾
this.protyle.toolbar.range.collapse(false); // false表示折叠到末尾

// 工具栏关闭
this.protyle.toolbar.element.classList.add("fn__none");
return;
}
if (this.formatData.datatype) {
Expand Down Expand Up @@ -166,8 +170,7 @@ export default class PluginSample extends Plugin {
}
}

// console.log("Format applied to selected text");
// 修改这部分:删除之前的collapse代码,改用以下代码设置光标位置
// 移动光标到末尾
this.protyle.toolbar.range.collapse(false); // false表示折叠到末尾

// 工具栏关闭
Expand Down

0 comments on commit 182a413

Please sign in to comment.