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

Horizonal scroll bar jumps back when typing in a code block #14

Open
jkwnki opened this issue Jul 11, 2023 · 2 comments
Open

Horizonal scroll bar jumps back when typing in a code block #14

jkwnki opened this issue Jul 11, 2023 · 2 comments
Labels
bug 🪲 Something isn't working

Comments

@jkwnki
Copy link

jkwnki commented Jul 11, 2023

Hi,

there's a weird behavior with code blocks.

Reproduction:

create code block.
Add a line:

echo "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore" > file

append extension to file e.g. file.txt

The cursor disappears und the horizontal scroll bar jumps to beginning of code block.

Also the copy icon inside the code block is totally misplaced, particularly when working on end of line.
Lets place it outside the code box:

copy

Or, if possible, it could pop up when cursor inside the code block.

What is "fence" for?

Greetings
jkwnki

@jacobwhall
Copy link
Owner

Hey @jkwnki, I was able to reproduce this bug. Here is a specific set of steps:

  1. In File > Preferences > Editor > Misc disable "wrap text inside code blocks" in order for horizontal scroll bars to appear in code blocks
  2. Create a new file in MarkText
  3. Insert a code block at the beginning of the file using the @ shortcut
  4. Type a long line of text into the code block, until a horizontal scroll bar appears
  5. Observe that each time a character is typed, the horizontal jumps back to the beginning of the line, so that the user cannot read what they just typed

Indeed, this is no good! We shall fix. In the meantime, I recommend you enable code block wrapping in Preferences as described in step 1 above.

Also the copy icon inside the code block is totally misplaced.

To be honest, I like it where it is! It doesn't not overlap any text, and its purpose is unambiguous. Why do you feel that it should be moved to outside of the code block?

What is "fence" for?

The backtick characters used to delineate code blocks in Markdown are often called fences, e.g. in the CommonMark spec. I suppose literally writing "fence" in the bottom right corner of a code block isn't strictly necessary...

@jacobwhall jacobwhall added the bug 🪲 Something isn't working label Jul 11, 2023
@jacobwhall jacobwhall changed the title code block bug Horizonal scroll bar jumps back when typing in a code block Jul 11, 2023
@jkwnki
Copy link
Author

jkwnki commented Jul 11, 2023

To be honest, I like it where it is! It doesn't not overlap any text, and its purpose is unambiguous. Why do you feel that it should be moved to outside of the code block?

Cause its overlapping :) :
overlap

Edit: Oh i see, its only when "wrap text inside code blocks" is disabled.

My personal preference now is to have it turned of, so decide yourself whether to go for that or not :)

Bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants