mirror of
https://github.com/esm7/obsidian-vimrc-support.git
synced 2026-07-22 05:00:25 +00:00
Update JsSnippets.md
This commit is contained in:
parent
dd1838a175
commit
0895ca4d07
1 changed files with 2 additions and 2 deletions
|
|
@ -39,7 +39,7 @@ function regexLastIndexOf(string, regex, startpos) {
|
|||
function jumpHeading(isForward) {
|
||||
const editor = view.editor;
|
||||
let posToSearchFrom = editor.getCursor();
|
||||
posToSearchFrom.line += isForward ? 0 : -1;
|
||||
posToSearchFrom.line += isForward ? 1 : -1;
|
||||
const cursorOffset = editor.posToOffset(posToSearchFrom);
|
||||
const lookupToUse = isForward ? regexIndexOf : regexLastIndexOf;
|
||||
let headingOffset = lookupToUse(editor.getValue(), /^#(#*) /gm, cursorOffset);
|
||||
|
|
@ -72,7 +72,7 @@ Append this function to the file mentioned above (after jumpHeading).
|
|||
function jumpNextLink(isForward) {
|
||||
const editor = view.editor;
|
||||
let posToSearchFrom = editor.getCursor();
|
||||
posToSearchFrom.line += isForward ? 1 : -1;
|
||||
posToSearchFrom.line += isForward ? 0 : -1;
|
||||
const cursorOffset = editor.posToOffset(posToSearchFrom);
|
||||
const lookupToUse = isForward ? regexIndexOf : regexLastIndexOf;
|
||||
let headingOffset = lookupToUse(editor.getValue(), /\[\[/g, cursorOffset);
|
||||
|
|
|
|||
Loading…
Reference in a new issue