smart-open.nvim icon indicating copy to clipboard operation
smart-open.nvim copied to clipboard

Allow locations_input on the picker

Open dmtrKovalenko opened this issue 1 year ago • 6 comments

I'd like to have access to the feature of automatic locations input https://github.com/nvim-telescope/telescope.nvim/pull/2791#issuecomment-1881880118 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)

dmtrKovalenko avatar Jun 25 '24 10:06 dmtrKovalenko

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.

danielfalk avatar Oct 15 '24 15:10 danielfalk

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.

dmtrKovalenko avatar Oct 15 '24 16:10 dmtrKovalenko

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.

danielfalk avatar Oct 15 '24 16:10 danielfalk

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)

dmtrKovalenko avatar Oct 15 '24 16:10 dmtrKovalenko

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

danielfalk avatar Oct 15 '24 16:10 danielfalk

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.

danielfalk avatar Oct 15 '24 16:10 danielfalk