模仿浏览器的“在边栏中打开”的选项,使笔记在侧边栏中打开并固定。
QuickAdd Capture
```js quickadd
const activefile = app.workspace.getActiveFile();
const filePath = app.vault.getAbstractFileByPath(activefile.path)
app.workspace.getLeaf('split', 'vertical').openFile(filePath);
const comm = str => app.commands.executeCommandById(str);
const setPanel = percent => {
let right = document.querySelector('.workspace-split.mod-vertical.mod-root').lastElementChild;
right.previousSibling.style.flexGrow = percent;
right.style.flexGrow = 100 - percent;
};
setTimeout(() => {
setPanel(75); // 50、80
comm('editor:focus-right');
comm("workspace:toggle-pin");
}, 50);
```