danth / pathfinder.vim

Vim plugin to suggest better movements
MIT License
290 stars 4 forks source link

Select shorter combinations during backtracking #10

Closed danth closed 4 years ago

danth commented 4 years ago

Problem

line

para
graph

parag
raph

Start at line in the example above, and get to the blank line at the bottom. Currently, j2} is chosen. A better solution would be 3}.

This happens because j appears first in the config, and } goes to the same location with the same weight, so is ignored. Since we don't know the path ahead yet, we cannot make a choice between the two.