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

New line in code block not working correctly #3006

Open
maltebp opened this issue Feb 11, 2022 · 1 comment
Open

New line in code block not working correctly #3006

maltebp opened this issue Feb 11, 2022 · 1 comment
Labels
🔭 area/muya 🐛 bug Something isn't working :octocat: code block issues about code block

Comments

@maltebp
Copy link

maltebp commented Feb 11, 2022

Description

Inserting a new line (press Enter) on an empty line in a code block does not work correctly. To begin with it seem to do nothing, but if you start typing something afterwards it jumps to the new a line.

Steps to reproduce

  1. Open new document
  2. Insert code block
  3. Move into the code block (ignore language identifier)
  4. Press Enter
  5. Press d (or any other letter)

Expected behavior:
A new line should be added in step 4, but it's not added until step 5 (line is added first and then the letter is added)

Actual behavior:
New line should be added immediately in step 4 (when pressing enter)

Example:
mygif
Note: first part is repro, second part is some of the shenanigans mentioned below

Versions

  • MarkText version: 0.16.3 (and pre-release v0.17.0-rc.1)
  • Operating system: Windows 10 Home, 10.0.19042 Build 19042

Additional notes:

There seems to be a bunch of issues with the code block that may be related to this problem such as:

  • Deleting what you entered after step 5 will also delete the empty line.
  • Adding new lines and deleting existing ones (just in some random order) will cause it to behavior strangely (e.g. jump to beginning of code block)
  • Switching to source code mode and back will some times delete all empty lines.
  • Press the Up arrow key will move you directly the language identifier (and not to line above)

But I think they may fixed by extension of fixing this bug. Let me know if you want dedicated issues on those though.

@jekyllgrim
Copy link

jekyllgrim commented Feb 17, 2022

I think my issue may be related.
Pressing Enter at the end of a code block mysteriously moves some characters from the curernt line to the next line. The issue resolves itself if I put the cursor at the end of a line that isn't indented and press Enter there. But it can reappear, and I don't have definitive STR.
ezgif-7-532a016d3e

@maltebp maltebp mentioned this issue Mar 26, 2022
1 task
@fxha fxha added 🐛 bug Something isn't working :octocat: code block issues about code block 🔭 area/muya labels Mar 31, 2022
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 :octocat: code block issues about code block
Projects
None yet
Development

No branches or pull requests

3 participants