nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.4k stars 46 forks source link

Keep line order in non fuzzy mode #85

Closed darkangel-ua closed 1 year ago

darkangel-ua commented 2 years ago

When we set fuzzy = false it's would be great to keep lines in orders they are appear in file/buffer/source. This will mimic grep like behavior.

Conni2461 commented 1 year ago

I would not always enable it for fuzzy=false, i would implement it as separate option.

We could improve performance by swapping out functions, which would remove 1 if.

And i even think we can implement this on telescope.nvim sorter level.

Its a good idea thought, thanks :) If you are interested in trying the last point, feel free to say so, we could do a guided PR over there.

Conni2461 commented 1 year ago

this is solved on telescope level, latest master

require("telescope.builtin").oldfiles {
  tiebreak = function(current_entry, existing_entry, _)
    return current_entry.index < existing_entry.index
  end
}

i prefer not to implement this here