Coder Social home page Coder Social logo

Display of toots with line break about mastodon-alt HOT 17 OPEN

bmp avatar bmp commented on June 9, 2024
Display of toots with line break

from mastodon-alt.

Comments (17)

rougier avatar rougier commented on June 9, 2024 1

The reason is because I refill every toot by default. Obviously in this case it'll give a bad output. Maybe we could have a refill option. And if you ask, the reason for the refill is to be able to add box around retoot. Else, very long lines are weird. Maybe I can also have my own refill function only for this case.

from mastodon-alt.

csantosb avatar csantosb commented on June 9, 2024

Same here. I had to change 2 to 5, for some reason, in this line

(propertize " " 'display `(space :align-to (- right ,(+ (length status) 2))))

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

@csantosb But this does not fix the alignment issue, does it?

from mastodon-alt.

csantosb avatar csantosb commented on June 9, 2024

Yes, it does for me.

from mastodon-alt.

bmp avatar bmp commented on June 9, 2024

The alignment issue is not fixed but the status line is displayed in a single line when i use 6 or 5 instead of 2 as indicated in #10 (comment)

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

I think the alignment issue might be linked to the presence of a fringe on the left. I shoud align to the the right fringe (which is equal to right when no fringe I think)

from mastodon-alt.

deen1 avatar deen1 commented on June 9, 2024

I've noticed the same issue and find that it's most annoying when the
toot contains bullet-pointed/enumerated lists, which each item in the list separated by a single line-break.

@rougier you mentioned this is to do with refilling the toot body – is there not a way to parse the text before refilling and add an extra line-break where the original text had one? I.e. \n -> \n\n first, and then after refilling, long-lines are truncated by a single-line break.

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

I suspect Emacs has certainly a function to do that but I don't know the name. For example, visual mode might be an option but I do not know the exact algorithm. Any suggestions welcome.

from mastodon-alt.

deen1 avatar deen1 commented on June 9, 2024

I tried a few things, but I actually find that simply replacing

(string-fill content (min (- (window-width) 2) fill-column))

with just

content

seems to fix this, with few ill effects compared to the prior situation. Of course, it persists inside boosted toots, but that seems reasonable enough for me at the moment.

from mastodon-alt.

bmp avatar bmp commented on June 9, 2024

I tried a few things, but I actually find that simply replacing

(string-fill content (min (- (window-width) 2) fill-column))

with just

content

seems to fix this, with few ill effects compared to the prior situation. Of course, it persists inside boosted toots, but that seems reasonable enough for me at the moment.

I can confirm the same.

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

What do you mean by "it persists inside boosted toots"?

from mastodon-alt.

deen1 avatar deen1 commented on June 9, 2024

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

So maybe an option that points on refill, no-refill or user defined function might be the easiest, what do you think?

from mastodon-alt.

deen1 avatar deen1 commented on June 9, 2024

So maybe an option that points on refill, no-refill or user defined
function might be the easiest, what do you think?

If you mean that there should be some (defvar mastodon-alt--toot-refill-p t), where we modify the code above so that we have

(if mastodon-alt--toot-refill-p
  (string-fill content (min (- (window-width) 2) fill-column))
  (content) )

then I am inclined to agree. Maybe there are still some bugs in the (content) fix that haven't cropped up for me but will crop up for others.

from mastodon-alt.

rougier avatar rougier commented on June 9, 2024

Exactly. Care to make a PR?

from mastodon-alt.

deen1 avatar deen1 commented on June 9, 2024

OK, see the following (which includes a fix for the status line issue too): #23

from mastodon-alt.

LuciusChen avatar LuciusChen commented on June 9, 2024

Same here. I had to change 2 to 5, for some reason, in this line

(propertize " " 'display `(space :align-to (- right ,(+ (length status) 2))))

this does for me

from mastodon-alt.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.