vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 63 forks source link

Prevent word wrapping lines which will be truncated later #153

Closed jgkamat closed 6 years ago

jgkamat commented 6 years ago

See #152.

This is the first thing I noticed (the most obvious fix), but it's far from the biggest improvement. I tried taking a look at the bigger issue, but I dove really deep into macros so that might take some more time. I'm suspecting a 'catch' in a magit macro, but that's going to take a longer time to deal with.

This change reduces my magit-status on qutebrowser/qutebrowser from 4 seconds to 3, so not a huge improvement, but it is measurable. There is one possible regression in this, though.

Previously, the trim would always trim at 4 lines, regardless of input. Now, there is an edge case where if any of the first few lines is long:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a
a
a

The line will be truncated early. Do you think that's acceptible? I don't think it makes too much of a difference, and all the other cases should be the same.

Also, I'm assuming this should go on develop, let me know if that's not the case (it dosen't conflict when cherry picking it to master).

jgkamat commented 6 years ago

Ah, I think we duplicated work, sorry! My patch is pretty small, so I'm fine with dropping it, I'll read the comments you made and your patch in a bit.

jgkamat commented 6 years ago

https://github.com/vermiculus/magithub/issues/152#issuecomment-339208407 is better, so closing this.