Skip to content

Truncation of lines does not seem to work in all cases #48

@ax487

Description

@ax487

I am experiencing an issue where the blamer message is stretching across two lines:

example

This is despite the fat that lines are supposed to be truncated.

I would like blamer to be as unobtrusive as possible, so this is somewhat unfortunate: If I move the cursor between lines, the actual lines jump around, which is a little distracting.

Is this intended behavior? I would rather have the blaming information disappear entirely, since I can always use magit if I really need it (for the most part it is not essential).

Edit: This looks a bit like an off-by-one error with respect to the width:

example
example_2

Maybe some symbol is not accounted for when the length is calculated? If I subtract one from the calculated width, everything looks fine again:

(defun blamer--maybe-normalize-truncated-line (text)
  "Disable line break for truncated line by truncated TEXT for available width."
  (if (and (not truncate-lines) blamer-force-truncate-long-line)
      (truncate-string-to-width text (- (blamer--get-available-width-before-window-end) (blamer--get-line-number-column-width) 1))
    text))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions