Skip to content

How to reliably check if at the beginning of the line in Evil visual state? #1869

@hubisan

Description

@hubisan

Issue type

  • Question

Environment

Emacs version: 30.0.50 and 29.2
Operating System:
Evil version: 1.15
Evil installation type: With Straight
Graphical/Terminal: Graphical
Tested in a make emacs session (see CONTRIBUTING.md): No (but with emacs -q)

Reproduction steps

  • Place the cursor at the beginning of a line in normal state.
  • Evaluate (bolp) (Return t if point is at the beginning of a line).
  • It returns t.
  • Switch to visual state.
  • Evaluate (bolp)
  • It returns nil.

Expected behavior

  • Expected (bolp) to return t after switching to visual state.

Actual behavior

  • It returns nil instead.

Question

  • How can I reliably check if I'm at the beginning of a line even in that case?
  • Am I doing something wrong?
  • Is there maybe a variable I can configure to change this behaviour?

Further notes

  • After switching to visual (point) is increased by 1
  • If I switch to visual state when I am not at the beginning of the line and then move to the beginning of the line with 0, bolp correctly returns t. So, this is only a problem when the cursor is at the beginning of the line when entering visual state and the marked region is only the first character..

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