Skip to content

Commit

Permalink
fixed:
Browse files Browse the repository at this point in the history
- No longer corrupted with an empty text field.
  • Loading branch information
vrtmrz committed Mar 1, 2023
1 parent 2e25300 commit 24c8a3b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class NinjaCursorForWindow {
textRange.setEndAfter(range.startContainer);
let textRect = textRange.getBoundingClientRect();
if (textRect.x == 0 && textRect.y == 0) {
textRange.setStart(range.endContainer, range.endOffset - 1);
const startEndOffset = range.endOffset - 1 < 0 ? 0 : range.endOffset - 1;
textRange.setStart(range.endContainer, startEndOffset);
textRange.setEnd(range.endContainer, range.endOffset);
const textRects = textRange.getClientRects();
const tempRect = textRects.item(textRects.length - 1);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "ninja-cursor",
"name": "Ninja Cursor",
"version": "0.0.9",
"version": "0.0.10",
"minAppVersion": "0.12.0",
"description": "The plugin which enhance cursor visibility.",
"author": "vorotamoroz",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ninja-cursor",
"version": "0.0.9",
"version": "0.0.10",
"description": "The plugin which enhance cursor visibility.",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 24c8a3b

Please sign in to comment.