marktext / marktext/marktext

Cursor behaviour when navigating around blank lines

Open
#3,203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:beetle: pri/low 🐛 bug 🔭 area/editor
Dominant language
TypeScript
Stars
61.6k
Forks
4.6k
Avg merge
23h 49m
Merged PRs (30d)
89

Description

Description

Blank lines (as opposed to paragraph breaks) can be inserted with shift-enter. However, the cursor behaves very erratically when blank lines are present. The behaviour is quite weird in general, and the reproducible steps below are just an example.

  • Can you reproduce the issue?
Steps to reproduce
  1. In a new file, press enter (without shift) a few times to create a few blank paragraphs
  2. Type some arbitrary text such as "test"
  3. Press shift-enter a few times to create some blank lines
  4. Press the up arrow key

Expected behavior:

On pressing the up arrow key, the cursor moves up one line, to the previous blank line.

Actual behavior:

The cursor jumps all the way up to the previous paragraph, above the "test" text that was inserted. If there is no previous paragraph (e.g. if you skip step 1 above) then the cursor does not move at all.

In addition to this, the second time you press shift-enter, nothing seems to happen, so you have to press shift-enter n+1 times if you want to insert n blank lines, unless n=1.

Link to an example: [optional]

Versions
  • MarkText version: 0.17.1
  • Operating system: Macos 10.15.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Reproduce the arrow-key and Shift-Enter cases in MarkText 0.17.1 on macOS, then trace the editor's cursor handling; done when blank-line navigation moves one line at a time and inserting n blank lines requires n Shift-Enter presses.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop-dev, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.