Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent word wrapping lines which will be truncated later #153

Closed
wants to merge 1 commit into from

Conversation

jgkamat
Copy link
Contributor

@jgkamat jgkamat commented Oct 24, 2017

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
Copy link
Contributor Author

jgkamat commented Oct 24, 2017

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.

@@ -260,18 +260,26 @@ Each function takes two arguments:
(let* ((label-string (format fmt "Preview:"))
(label-len (length label-string))
(prefix (make-string label-len ?\ ))
(max-lines 4)
did-cut)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-reviewing, did-cut is not updated, so that can cause ... to not be inserted when it should be.

@jgkamat
Copy link
Contributor Author

jgkamat commented Oct 25, 2017

#152 (comment) is better, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant