Skip to content

swiper: point jumps to the first line of that the current line is a substring #290

@zhaojiangbin

Description

@zhaojiangbin

When in buffer there is another line of which the current line is a sub-string, running swiper (C-s) makes the cursor jumping to that line, instead of staying in the current one.

To reproduce in the scratch buffer:

  1. Enter the following 10 lines, note the leading spaces in the last two lines:
zero
one two three
one
two
one two
three
one two three
one three
  two
 two
  1. Move the cursor to any of the 3rd, 4th, 5th, 6th and 7th line.
  2. Press C-s anywhere on that line. Watch the cursor jumping to column 0 of the 2nd line.
  3. Move the cursor to the 8th line.
  4. Press C-s anywhere on that line. The cursor does not move.
  5. The most interesting part happens when the cursor is in the 9th line, press C-s makes the cursor jumping to the 10th line.
  6. Press RET to select the 10th line and exit from swiper.
  7. Then press C-s when in 10th line, watch the cursor jumping to the 4th line.

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