ttscoff / mdless

MIT License
871 stars 39 forks source link

In contrast to less: mdless doesn't adapt to changing view port of terminal #88

Closed leder11011 closed 10 months ago

leder11011 commented 1 year ago

As seen in the two screenshots less uses the full width of the terminal when the viewport is switched from portrait to landscape and mdless keeps the portrait formatting.

Thanks for a great app!

Unfortunately I cannot attach screenshots in GitHub mobile app.

leder11011 commented 1 year ago

Could you please fix this issue for gem package? It's annoying and doesn't offer "a replacement for less".

ttscoff commented 1 year ago

mdless calculates its line wrapping and code formatting based on the width of the screen at the time the command is run. There is no way to output what it does in a way that will wrap if the screen width is changed.

leder11011 commented 1 year ago

Hello Brett,

Thank you for your answer and your commitment!

It's exactly what less does: it respects view port changes of the terminal on the fly.

Please reconsider!

Bye Gerrit P. S. Screenshots attached

Brett Terpstra @.***> schrieb am Fr., 15. Sept. 2023, 14:39:

mdless calculates its line wrapping and code formatting based on the width of the screen at the time the command is run. There is no way to output what it does in a way that will wrap if the screen width is changed.

— Reply to this email directly, view it on GitHub https://github.com/ttscoff/mdless/issues/88#issuecomment-1721211948, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZNARBO524YFJODCOTALU3X2REAFANCNFSM6AAAAAA3KDRVKI . You are receiving this because you authored the thread.Message ID: @.***>

leder11011 commented 1 year ago

Screenshot_2023-08-09-16-32-42-68_84d3000e3f4017145260f7618db1d683.jpg

Screenshot_2023-08-10-10-21-10-48_84d3000e3f4017145260f7618db1d683.jpg

Screenshot_2023-08-09-16-33-42-23_84d3000e3f4017145260f7618db1d683.jpg

leder11011 commented 1 year ago

Bump @ttscoff

leder11011 commented 1 year ago

thank you for version 2.1.13!

Unfortunately I get a runtime error on Android termux, which was working fine on the previous version 1.0.37

Error is as follows: console.rb:778:in '*': negative argument (Argument Error)

Please let me know if you need a stacktrace - I can send a screenshot, copy&pasta is a bit difficult on Android smartphone...

leder11011 commented 1 year ago

https://photos.app.goo.gl/82WxiKzHutq3KQdcA

ttscoff commented 1 year ago

I believe this is fixed (current version 2.1.17).

On 4 Dec 2023, at 9:20, leder11011 wrote:

thank you for version 2.1.13!

Unfortunately I get a runtime error on Android termux, which was working fine on the previous version 1.0.37

Error is as follows: console.rb:778:in '*': negative argument (Argument Error)

Please let me know if you need a stacktrace - I can send a screenshot, copy&pasta is a bit difficult on Android smartphone...

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/88#issuecomment-1838867947 You are receiving this because you were mentioned.

Message ID: @.***>

leder11011 commented 1 year ago

Thank you for version 2.1.23

I have a regression now:

Opening mdless already in landscape mode uses the landscape width only partly, cp. Screenshot

Screenshot_20231204-195932.png

ttscoff commented 1 year ago

Is there a width setting hardcoded in ~/.config/mdless/config.yml? It may have stored a current column width and then defaulted to it. If that’s the case I should remove that from automatic saving, so let me know.

Thanks, Brett On Dec 4, 2023 at 1:04 PM -0600, leder11011 @.***>, wrote:

Thank you for version 2.1.23 I have a regression now: Opening mdless already in landscape mode uses the landscape width only partly, cp. Screenshot Screenshot_20231204-195932.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

leder11011 commented 1 year ago

Hello Brett,

deleting the line :width: from config.yml did the trick! Please remove it from auto saving, too.

Best regards Gerrit

ttscoff commented 12 months ago

I will delete, but it will mean any time a user wants to set a permanent width setting they'll have to manually include the :width: key, and running --update-theme will delete it. I'll just document it well.

-Brett

On 5 Dec 2023, at 1:50, leder11011 wrote:

Hello Brett,

deleting the line :width: from config.yml did the trick! Please remove it from auto saving, too.

Best regards Gerrit

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/88#issuecomment-1840183896 You are receiving this because you were mentioned.

Message ID: @.***>

leder11011 commented 12 months ago

Thank you!

2.1.25 is breaking with runtime error

Screenshot_20231205-141907.png

ttscoff commented 12 months ago

Try 2.1.26. If that doesn't fix it, please attach a sample file that can replicate the error for you.

-Brett

On 5 Dec 2023, at 7:21, leder11011 wrote:

Thank you!

2.1.25 is breaking with runtime error

Screenshot_20231205-141907.png

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/88#issuecomment-1840781629 You are receiving this because you were mentioned.

Message ID: @.***>

leder11011 commented 12 months ago

Yes 2.1.26 fixed the error.

As you can see in the screenshot there are early line breaks:

Screenshot_20231205-150010.png

ttscoff commented 12 months ago

I’m going to put some more time into table formatting soon.

Thanks, Brett On Dec 5, 2023 at 8:04 AM -0600, leder11011 @.***>, wrote:

Yes 2.1.26 fixed the error. As you can see in the screenshot there are early line breaks:

• in the table header before "email" • in between "79" and "days" • width is set to: 116

Screenshot_20231205-150010.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

leder11011 commented 12 months ago

error2.md

leder11011 commented 12 months ago

Thank you for 2.1.28

The table headers and line break before "days" are fixed now.

But every line that had a line break before "days" has an extra empty line in the next row.

Can you please have a look?

ttscoff commented 12 months ago

Please provide the document containing the table you're working with. I haven't touched the wrapping functions at all yet, so any change you're seeing is unintentional.

leder11011 commented 12 months ago

error2.md

Please have a look...

leder11011 commented 10 months ago

Thank you @ttscoff !

the configuration of the screenwidth fixes this for me now! It is not calculated on the fly on my smartphone, but what the heck: I only use app Termux in landscape only! So I am more than satisfied with your app mdless! Keep up the good faith!

Gerrit