sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
814 stars 40 forks source link

[ST4/Vintage] Jumping with repeat is inconsistent #4311

Open saneef opened 3 years ago

saneef commented 3 years ago

Description

I use Vintage's jump to move around the file, with relative line number ON. Jumping with repeat: 10j to jump lines down. But, in the current ST4 the jumps are inconsistent. Some time when I type in 10j, it jumps 8 lines instead of 10.

Steps to reproduce

  1. Enable Vintage package
  2. Open a file (with lines more than 40)
  3. Jump using, 10j, 10k, 8j, 8k...

Expected behavior

When jumping the jump should be accurate, eg: 10j should jump to 10th line down (shown as in relative line numbers)

Actual behavior

The jump are not correct. When using 10j some times it jumps to 9th line, sometime to 8th line.

Environment

saneef commented 3 years ago

If it helps, this is the log with sublime.log_commands(True), when trying to jump 10 lines down. But, it only jumped to 9th

command: push_repeat_digit {"digit": 1}
command: push_repeat_digit {"digit": 0}
command: set_motion {"linewise": true, "motion": "move", "motion_args": {"by": "lines", "extend": true, "forward": true}}
command: vi_eval {"action_args": null, "action_command": null, "motion_args": {"by": "lines", "extend": true, "forward": true}, "motion_clip_to_line": false, "motion_command": "move", "motion_inclusive": false, "motion_mode": 0, "prefix_repeat": 10}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: unmark_undo_groups_for_gluing
command: drag_select {"event": {"button": 1, "x": 11.8625183105, "y": 668.00177002}}
command: unmark_undo_groups_for_gluing
deathaxe commented 3 years ago

Vintageous package hasn't been touched for a while, AFAIK.

Not a solution, but NeoVintageous is said to be a good alternative even some more features.

saneef commented 3 years ago

Thanks for the tip, @deathaxe. Will give it a try.

saneef commented 3 years ago

The mismatch between relative line number and N jump occurs when there are any wrapped lines in the buffer. I figured that out after spending more than an hour checking if this was a problem with any installed plugins. Now, I don't if this a bug or not. 🤦

jfcherng commented 3 years ago

since it mimics vim, it would be reasonable to have the same behavior with vim. (i don't actually know how vim behaves in that case)