Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unintended content when <> exists #1336

Closed
1 task done
EULIR opened this issue Sep 11, 2019 · 1 comment · Fixed by #1365
Closed
1 task done

Delete unintended content when <> exists #1336

EULIR opened this issue Sep 11, 2019 · 1 comment · Fixed by #1365
Labels
🔭 area/muya 🐛 bug Something isn't working

Comments

@EULIR
Copy link

EULIR commented Sep 11, 2019

Description

When I have a passage like this

<><>
This is a paragraph.
This is another parapraph.

And I tried to delete content from the very beginning by pressing the delete key when the cursor is at the front. However, instead of deleting content word by word as intended, it deleted the first <> and the skip the first parapragh and started to delete the second paragraph.

  • Can you reproduce the issue?

Steps to reproduce

  1. [First step]
    Having a passage that includes at least three paragraphs which the first paragraph being <><>
  2. [Second step]
    Move the cursor before the first <>
  3. [Third step]
    Start pressing DELETE

Expected behavior:
It first deletes <><>, and then deletes the first paragraphs, and then deletes the second paragraphs.

Actual behavior:
It deletes the first <> and then skips the first paragraph and deletes the second paragraphs.

img

Versions

  • Mark Text: 0.14.0
  • Operating system: Windows 10.0.17134
@EULIR EULIR changed the title Delete unintened content when <> exists Delete unintended content when <> exists Sep 11, 2019
@fxha
Copy link
Contributor

fxha commented Sep 23, 2019

@EULIR Thanks for reporting this issue.

Stack Trace:

Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset 4294967295 is larger than the node's length (2).
    at Object.setStart [as select] (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/selection/index.js:346:11)
    at Object.select [as setCursorRange] (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/selection/index.js:483:10)
    at Ps.setCursorRange [as setCursor] (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/contentState/index.js:159:15)
    at Ps.setCursor [as partialRender] (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/contentState/index.js:208:12)
    at Ps.partialRender [as inputHandler] (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/contentState/inputCtrl.js:261:51)
    at HTMLDivElement.inputHandler (file:///app/marktext/resources/app.asar/dist/electron/webpack:/src/muya/lib/eventHandler/keyboard.js:204:22)

@fxha fxha added 🐛 bug Something isn't working 🔭 area/muya labels Sep 23, 2019
Jocs pushed a commit that referenced this issue Sep 24, 2019
@Jocs Jocs mentioned this issue Sep 24, 2019
Jocs added a commit that referenced this issue Sep 25, 2019
* fix: #1336

* fix: #1366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔭 area/muya 🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants