danielfalk / smart-open.nvim

Neovim plugin for fast file-finding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow locations_input on the picker

dmtrKovalenko opened this issue · comments

I'd like to have access to the feature of automatic locations input nvim-telescope/telescope.nvim#2791 (comment) from the comment but it doesn't work for some with smart open picker.

Providing __location_input=true on the picker should make picker accept input like file:12 and by selecting opening the line number 12 (this functionality builtin to telescope)

It appears this is an experimental feature to telescope that lets you paste in file:12 and it will open and jump?

Could you explain more about the workflow here? I'm not clear on the benefits or some of the specifics. What if you don't enter a full path for "file"? Does it just attempt to open the first entry and jump to a line?

Also if this is built in to telescope, I'm not sure why it wouldn't work, but maybe you're more familiar since you seem to have been the author of the issue linked above.

It is needed to be able to paste the compiler output path which includes the precise location to the telescope input instead of looking for it directly.

If you will simply enable a flag or will allow to provide telescope picker options the problem will be solved.

You should be able to pass telescope picker options. Something like

require("telescope").extensions.smart_open.smart_open({
  __locations_input = true
});

Should do what you're asking for.

This doesn't work as I mentioned in the original issue

Providing __location_input=true on the picker should make picker accept input like file:12 and by selecting opening the line number 12 (this functionality builtin to telescope)

Hmm. I tried it using the exact snippet I pasted and it worked for me.

Apparently the behavior isn't consistent for me, but I can verify that the __locations_input key is getting passed down to the picker. I'm not sure what the issue might be, but I can't contribute any more time to looking into it for now. I'd welcome anyone else's effort there.