mirror of
https://github.com/idanlib/ObsidianFastForwardLinkPlugin.git
synced 2026-07-22 11:30:28 +00:00
add set cursor upon paste
This commit is contained in:
parent
c306f13dc8
commit
aaab6790d8
2 changed files with 9 additions and 2 deletions
|
|
@ -52,11 +52,11 @@ export default class RedirectSettingsTab extends PluginSettingTab {
|
|||
new Setting(containerEl)
|
||||
.setName("Delete Redirects Folder")
|
||||
.setDesc(
|
||||
"Before uninstalling the plugin, manually delete the `_redirects` folder to remove unnecessary files."
|
||||
"Before uninstalling the plugin, manually delete the `_redirects` folder to remove unnecessary files. This cannot be undone."
|
||||
)
|
||||
.addButton((button) => {
|
||||
button.setButtonText("Delete");
|
||||
button.setTooltip("Delete the Redirects folder.");
|
||||
button.setTooltip("Delete the Redirects folder.", { delay: 0 });
|
||||
button.setWarning();
|
||||
button.onClick((evt) => {
|
||||
const redirectsFolder =
|
||||
|
|
|
|||
7
main.ts
7
main.ts
|
|
@ -200,6 +200,13 @@ export default class RedirectPlugin extends Plugin {
|
|||
editorCallback: (editor, view) => {
|
||||
const selection = editor.getSelection();
|
||||
editor.replaceSelection(`::>[[${selection}]]`);
|
||||
const { ch, line } = editor.getCursor();
|
||||
if (!selection) {
|
||||
editor.setCursor({
|
||||
ch: ch - 2,
|
||||
line: line,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue