Skip to content

Commit

Permalink
Update autocomplete details
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Dec 31, 2024
1 parent 38074e1 commit 53b34ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/note-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ function useNoteCompletion() {
}

const options = searchResults.slice(0, 5).map((note): Completion => {
const linkText = note.linkAlias || note.displayName
return {
label: note.displayName,
detail: linkText !== note.displayName ? linkText : undefined,
apply: (view, completion, from, to) => {
console.log(note)
// Insert link to note
const linkText = note.linkAlias || note.displayName
const text = `[[${note.id}|${linkText}]]`

const hasClosingBrackets = view.state.sliceDoc(to, to + 2) === "]]"
Expand Down
2 changes: 1 addition & 1 deletion src/styles/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}

.cm-editor .cm-tooltip.cm-tooltip-autocomplete > ul > li .cm-completionDetail {
@apply ml-2 not-italic text-text-secondary;
@apply ml-3 italic text-text-secondary;
}

.cm-editor .cm-completionMatchedText {
Expand Down

0 comments on commit 53b34ae

Please sign in to comment.