Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: don't steal focus when denite is opened. #630

Closed
dsummersl opened this issue May 2, 2019 · 9 comments
Closed

Feature Request: don't steal focus when denite is opened. #630

dsummersl opened this issue May 2, 2019 · 9 comments

Comments

@dsummersl
Copy link

dsummersl commented May 2, 2019

Problems summary

Given the plethora of plugins that operate asynchronously, there are cases where Denite could be used to handle the result of an asynchronous request. Create an option to launch Denite, but don't change the cursor's current position/focus.

Example: I use Grepper for search, and have configured Grepper to use Denite as its quickfix viewer with autocmd User Grepper :Denite quickfix. Since Grepper searches asynchronously, when a search takes several seconds I can continue to work within my current buffer. Once Grepper has collected its search results it launches Denite, and interrupts whatever other task I may be performing in the editor. Ideally I could configure Denite to launch in the background so that I can see the search results, but whatever task I am currently performing is not interrupted.

@Shougo
Copy link
Owner

Shougo commented May 6, 2019

You should use wincmd p in ui branch.

@Shougo Shougo closed this as completed May 6, 2019
@dsummersl
Copy link
Author

dsummersl commented May 6, 2019

kinda confused here...how would I do that? I tried something like autocmd User Grepper :Denite -do='wincmd p' quickfix and autocmd User Grepper :Denite quickfix \| wincmd p...neither of which ended well!

@Shougo
Copy link
Owner

Shougo commented May 6, 2019

Please use the branch.
#624

And:

autocmd User Grepper Denite quickfix | wincmd p

@dsummersl
Copy link
Author

Interesting, it sort of works...except the quickfix window is opened rather than denite's window (seems to be a problem with Denite quickfix ittself)

@Shougo
Copy link
Owner

Shougo commented May 30, 2019

You can close the quickfix window by cclose command.

@Shougo
Copy link
Owner

Shougo commented May 30, 2019

autocmd User Grepper cclose | Denite quickfix | wincmd p

@dsummersl
Copy link
Author

It works, thank you! I didn't realize with this ui branch merge I would have to define my own mappings. Once I got through that, I was able to get it working.

One interesting little bug is that specifying -matchers=matcher/regexp I see an error [denite] Empty sources. Taking it out works fine. 🤷‍♂

Thank you!

@Shougo
Copy link
Owner

Shougo commented Jun 5, 2019

One interesting little bug is that specifying -matchers=matcher/regexp I see an error [denite] Empty sources. Taking it out works fine. man_shrugging

:Denite file -matchers-matcher/regexp works for me.
I think you don't provide sources in arguments.

@dsummersl
Copy link
Author

I had done -matchers="matcher/regexp" and it didn't like it for some reason. Removing the double quotes and it works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants