MarkEdit-app / MarkEdit

Just like TextEdit on Mac but dedicated to Markdown.
https://markedit.app
MIT License
1.11k stars 45 forks source link

[Feature Request] Indentation option #567

Closed RauschUndNot closed 1 month ago

RauschUndNot commented 3 months ago

Hello,

Thank you for your app. I really enjoy it.

Would you consider adding an option in Preferences that allows indentation with tabs to indent the entire paragraph/block? Here are some images to help show what I mean.

This:

Screenshot 2024-06-17 at 10 01 07 AM (3)

As opposed to this:

Screenshot 2024-06-17 at 9 59 37 AM

I've been using FoldingText for years but it is no longer maintained and is only available to Apple Silicon via Rosetta. I've been looking for a replacement, but many editors unfortunately don't have this feature.

Thank you,

RauschUndNot

cyanzhong commented 3 months ago

Thanks for the feedback.

MarkEdit has implemented indentation for lists, for paragraphs I think would it be relatively straightforward.

However, my concern is similar to what I've shared in https://github.com/MarkEdit-app/MarkEdit/issues/549, I think adding more and more options to the app is not a good idea, especially when some options are rarely used by most users.

I will still think about it, as long as we have a better way to config the app for pro users, I will revisit this issue.

CursiveHello commented 2 months ago

Thank you for avoiding adding settings.

Related but different: when indented bullets wrap, can you make each wrapped line start at the same indentation level?

In this screenshot, the left is easier to read than MarkEdit on the right:

Screenshot

I think this is always how indented bullets should work; no setting required. Am I missing anything?

cyanzhong commented 2 months ago

Thank you for avoiding adding settings.

Related but different: when indented bullets wrap, can you make each wrapped line start at the same indentation level?

In this screenshot, the left is easier to read than MarkEdit on the right:

Screenshot

I think this is always how indented bullets should work; no setting required. Am I missing anything?

This looks like a bug to me, I will take a look.

cyanzhong commented 2 months ago

@CursiveHello I've just tried and was not able to reproduce. It might be related to the font, what font are you using?

image

Also, what's your system version and app version?

CursiveHello commented 2 months ago

Hm. I use Verdana, but I can reproduce the issue with system fonts too. macOS 14.5, MarkEdit 1.18.0 (62).

Screenshot

cyanzhong commented 2 months ago

@CursiveHello Can you share all screenshots of your (app) settings? I am trying to perfectly mimic your environment. Thanks.

Probably share the content too? 😆 not sure if it's content specific.

CursiveHello commented 2 months ago

Sure. Here’s some minimal text that reproduces the issue:

- first
    - The quick brown fox jumps

I just noticed that the bug only happens when “Prefer Indent Using” is set to “1 tab”. The other 3 options seem fine.

1 2 3 4

cyanzhong commented 2 months ago

@CursiveHello seems settings screenshots are not needed (sorry for that), the problem is tabs.

cyanzhong commented 2 months ago

@CursiveHello seems settings screenshots are not needed (sorry for that), the problem is tabs.

Should be fixed with change #581.

CursiveHello commented 2 months ago

fixed with change #581.

Tested and confirmed, thanks!

cyanzhong commented 1 month ago

Infra change was done in #588, will be working on configuration support later.

cyanzhong commented 1 month ago

@RauschUndNot It has been implemented and will be released in the upcoming update. Please check the documentation to learn how to configure it: MarkEdit Wiki - Advanced Settings.

Thank you again for your feedback.

RauschUndNot commented 1 month ago

Thank you very much, I am looking forward to it.

RauschUndNot

RauschUndNot commented 3 days ago

Hello @cyanzhong,

After updating to version 1.19.1 (64), adding { "editor.indentParagraphs" : true } to ~/Library/Containers/app.cyan.markedit/Data/Documents/settings.json, and restarting MarkEdit so that it interprets the new settings, I do not believe that this new feature is functioning properly: Paragraphs are not fully indented, only the first lines are. I have included an image below.

Screenshot 2024-10-01 at 7 29 13 PM
cyanzhong commented 3 days ago

I think in CodeMirror, this is parsed as a paragraph:

image

So it indents properly because the first line has no spaces on the left. If you add a line break after the first line, the second line starts a new paragraph, this is also how Markdown works.

What do you expect here?

cyanzhong commented 3 days ago

This behavior is called "soft break" in Markdown, you need to insert two line breaks to start a new paragraph.

It is possible to change the indentation to each line though, I just don't know which one works the best.

Or maybe, change this setting to "editor.indentBehavior" which allows "paragraph" and "line"?

cyanzhong commented 3 days ago

I've decided to change it to this: https://github.com/MarkEdit-app/MarkEdit/wiki/Customization#editorindentbehavior.

RauschUndNot commented 3 days ago

Hello @cyanzhong ,

I may have been unclear when I posted yesterday. To clarify:

Please ignore the top line with 3 words. I was referring to the two paragraphs underneath it. They are not fully indented with the exception of each paragraphs' first line. Here is another image with labels.

Screenshot 2024-10-02 at 4 40 50 AM

I had hoped for something more like this:

cyanzhong commented 3 days ago

@RauschUndNot I don't think I didn't follow your explanation, it seems I didn't explain "soft breaks" well.

In standard Markdown:

image

This picture only has "one" paragraph (the "First Line" in your screenshot is not a new paragraph, is it actually the second line of the only paragraph) and we are talking about indentation for each paragraph, hence the current behavior is exactly what we want.

What you want, is indentation for every line. By the way I am seeing a broken image:

image

I know this is confusing but this is really how Markdown works, in terms of paragraphs.

RauschUndNot commented 3 days ago

Here is the broken image:

340354009-3302398d-29e7-442f-bc6a-fa06a1faa1ad
cyanzhong commented 3 days ago

thanks, are you getting my point now?

https://github.com/MarkEdit-app/MarkEdit/wiki/Customization#editorindentbehavior

I think the app you shared was not for Markdown or it didn't follow the spec, the newly added "line" mode should do what you want though.

RauschUndNot commented 2 days ago

I think I understand. Thank you.

cyanzhong commented 2 days ago

OK. I will be releasing a patch version next few days, you can change the setting to "indentBehavior" after that.