Skip to content

Commit

Permalink
fix: GPT extension
Browse files Browse the repository at this point in the history
  • Loading branch information
areknawo committed Jun 14, 2024
1 parent f5a49a8 commit f4856a1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ const repositionMenu = (editor: SolidEditor): void => {

if (isTextSelection) {
try {
const p = findParentAtDepth(selection.$from, selection.$from.depth - 1);
const p = findParentAtDepth(selection.$from, selection.$from.depth);

rangeFrom = p.start - 1;
rangeTo = p.start + p.node.nodeSize - 1;
rangeFrom = Math.max(p.start - 1, 0);
rangeTo = Math.min(p.start + p.node.nodeSize - 1, editor.state.doc.nodeSize - 2);
} catch (error) {
box.style.display = "none";
}
Expand Down

0 comments on commit f4856a1

Please sign in to comment.