helm-icons icon indicating copy to clipboard operation
helm-icons copied to clipboard

helm-find-files preselect broken with icons

Open obar opened this issue 5 years ago • 2 comments

I tried this package out on a whim and found that I really like it, thanks for developing it!

When it's on with my system, the preselect of helm-find-files does not work. It goes back to working without the icons.

Expected behavior

  • Open any file
  • From the buffer navigating to that file, M-x helm-find-files
  • Helm input is the directory of the file, with the file itself as the currently highlighted item

Actual behavior

  • Open any file
  • From the buffer navigating to that file, M-x helm-find-files
  • Helm input is the directory of the file, with no preselect (highlight is at the top of the list)

This is using the latest helm, helm-icons, and a month-old-ish build of Emacs 27

obar avatar Jul 30 '20 14:07 obar

This is a tricky problem to solve! helm-preselect searches on the formatted candidates in helm-buffer (it would perhaps be better if it adhered to match-on-real [which is true for helm-find-files], but this would entail completely changing the mechanism in helm-preselect), and the regexp created for matching the current file at the end of helm-find-files is ^FILENAME, which doesn’t match when there is an icon at the beginning of line.

andersjohansson avatar Oct 25 '20 16:10 andersjohansson

Interesting, thanks for that insight into how this works. Do you think adding a bit to the start of that regexp to capture the possible icon would make sense as a solution to the overall problem?

obar avatar Oct 27 '20 02:10 obar