Skip to content

Commit

Permalink
Fix #176 - highlight when hovering search result
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeby committed Aug 22, 2023
1 parent a8ee48d commit 8399d45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-hover-editor",
"name": "Hover Editor",
"version": "0.11.13",
"version": "0.11.14",
"minAppVersion": "1.3.5",
"description": "Transform the Page Preview hover popover into a fully working editor instance",
"author": "NothingIsLost",
Expand Down
5 changes: 5 additions & 0 deletions src/onLinkHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export function onLinkHover(
if (targetEl && targetEl.matches('.workspace-leaf-content[data-type="calendar"] table.calendar td > div'))
targetEl = targetEl.parentElement!;

if (oldState && "scroll" in oldState && !("line" in oldState) && targetEl && targetEl.matches(".search-result-file-match")) {
oldState.line = oldState.scroll;
delete oldState.scroll;
}

// Workaround for bookmarks through 1.3.0
if (targetEl && targetEl.matches(".bookmark .tree-item-inner")) {
if (parent && (parent as any).innerEl === targetEl) {
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"0.11.13": "1.3.5",
"0.11.14": "1.3.5",
"0.11.12": "0.15.9",
"0.11.4": "0.14.5",
"0.10.7": "0.14.5",
Expand Down

0 comments on commit 8399d45

Please sign in to comment.