Prevent word wrapping lines which will be truncated later #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
onqutebrowser/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:
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).