Skip to content

evil-scroll-start-column doesn't take apparent column into account #2000

@anpandey

Description

@anpandey

This is especially noticeable if hscroll-margin is a small number and we're in a buffer that uses lots of text in the line-prefix property, which is common in e.g. org-indent-mode.

Steps to reproduce:

  • Set the hscroll-margin to something small, e.g. (setq hscroll-margin 3)
  • Create a new fundamental-mode buffer, and insert some text on a line
  • Evaluate this code to insert a line-prefix property for the current line:
    (put-text-property
    (line-beginning-position)
    (line-end-position)
    'line-prefix
    (make-string 20 ?\s))
  • Move towards the center of the text, and invoke evil-scroll-start-column, or alternatively z s

I'd expect the buffer to scroll so that the cursor is only 3 columns away from the left margin of the window. Instead, it is 20 + 3 columns away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions