Skip to content

Commit

Permalink
fix: #39
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyloong committed Feb 21, 2024
1 parent f98e2a5 commit ddd068b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"author": "lazyloong",

"minAppVersion": "1.0.0",
"version": "2.18.1"
"version": "2.18.2"
}
6 changes: 3 additions & 3 deletions src/editorSuggest/fileEditorSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class FileEditorSuggest extends EditorSuggest<MatchData> {
const openBracketIndex = lineText.lastIndexOf("[[");
const closeBracketIndex = lineText.lastIndexOf("]]");

if (lineText.slice(-1) == "^") return;
if (this.findLastSymbol(lineText.slice(openBracketIndex)) == "^") return;
if (openBracketIndex !== -1 && closeBracketIndex < openBracketIndex) {
return {
start: {
Expand All @@ -95,7 +95,7 @@ export default class FileEditorSuggest extends EditorSuggest<MatchData> {
let e = this.originEditorSuggest;
let query = context.query,
matchData: MatchData[];
switch (this.findLastChar(query)) {
switch (this.findLastSymbol(query)) {
case "|": {
matchData = this.getFileAliases(query);
break;
Expand Down Expand Up @@ -147,7 +147,7 @@ export default class FileEditorSuggest extends EditorSuggest<MatchData> {
matchData = matchData.sort((a, b) => b.score - a.score);
return matchData;
}
findLastChar(str: string): "" | "#" | "|" | "^" {
findLastSymbol(str: string): "" | "#" | "|" | "^" {
let index1 = str.lastIndexOf("#");
let index2 = str.lastIndexOf("|");
let index3 = str.lastIndexOf("^");
Expand Down

0 comments on commit ddd068b

Please sign in to comment.