From 7ca0e78ebc3b2a67212baa8e44c309363a50458b Mon Sep 17 00:00:00 2001 From: Aly Thobani Date: Sat, 27 Apr 2024 10:39:16 -0700 Subject: [PATCH] refactor: renamed file and removed unneeded exports --- motions/jumpToHeading.ts | 2 +- motions/jumpToLink.ts | 2 +- .../utils/{getNthInstanceOfPattern.ts => jumpToPattern.ts} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename motions/utils/{getNthInstanceOfPattern.ts => jumpToPattern.ts} (96%) diff --git a/motions/jumpToHeading.ts b/motions/jumpToHeading.ts index c29d6f2..020c967 100644 --- a/motions/jumpToHeading.ts +++ b/motions/jumpToHeading.ts @@ -1,5 +1,5 @@ import { MotionFn } from "./utils/defineObsidianVimMotion"; -import { jumpToPattern } from "./utils/getNthInstanceOfPattern"; +import { jumpToPattern } from "./utils/jumpToPattern"; const HEADING_REGEX = /^#+ /gm; diff --git a/motions/jumpToLink.ts b/motions/jumpToLink.ts index 712ede4..7745abe 100644 --- a/motions/jumpToLink.ts +++ b/motions/jumpToLink.ts @@ -1,5 +1,5 @@ import { MotionFn } from "./utils/defineObsidianVimMotion"; -import { jumpToPattern } from "./utils/getNthInstanceOfPattern"; +import { jumpToPattern } from "./utils/jumpToPattern"; const LINK_REGEX = /\[\[[^\]\]]+?\]\]/g; diff --git a/motions/utils/getNthInstanceOfPattern.ts b/motions/utils/jumpToPattern.ts similarity index 96% rename from motions/utils/getNthInstanceOfPattern.ts rename to motions/utils/jumpToPattern.ts index 7488f03..ebaff9f 100644 --- a/motions/utils/getNthInstanceOfPattern.ts +++ b/motions/utils/jumpToPattern.ts @@ -34,7 +34,7 @@ export function jumpToPattern({ * Returns the index of (up to) the n-th instance of a pattern in a string after a given starting * index. If the pattern is not found at all, returns undefined. */ -export function getNthNextInstanceOfPattern({ +function getNthNextInstanceOfPattern({ content, regex, startingIdx, @@ -59,7 +59,7 @@ export function getNthNextInstanceOfPattern({ * Returns the index of (up to) the nth-last instance of a pattern in a string before a given * starting index. If the pattern is not found at all, returns undefined. */ -export function getNthPreviousInstanceOfPattern({ +function getNthPreviousInstanceOfPattern({ content, regex, startingIdx,