-
Notifications
You must be signed in to change notification settings - Fork 155
Add excluded_filetypes #309
base: master
Are you sure you want to change the base?
Conversation
hadronized
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea and would like to merge that. Just a couple of things to fix.
doc/hop.txt
Outdated
| `multi_windows = false` | ||
|
|
||
| `excluded_filetypes` | ||
| Set the excluded filetypes to skip hint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation is fairly incomplete. Please mention multi-window support because otherwise it doesn’t really make sense for people using Hop without *MW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank your review. I'll complete the documentation.
| if w ~= cur_hwin then | ||
| if w ~= cur_hwin and vim.api.nvim_win_is_valid(w) then | ||
| local b = vim.api.nvim_win_get_buf(w) | ||
| if not vim.tbl_contains(excluded_filetypes, vim.api.nvim_buf_get_option(b, 'filetype')) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indent the following lines correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my careless. I'll fix.
4d50855 to
1d631f1
Compare
1d631f1 to
65ce506
Compare
|
@phaazon I have updated the commit and rebased on the lastest commit. And this PR is ready for review now. |
|
EDIT: To avoid hop from kicking in a single buffer, the solution described in #370 can be used. This #309 PR works as intended, which is for multi window (different case of use from #370). We could merge it if you want. If @phaazon don't want to add extra complexity (as this is a kinda niche scenario), we could just keep the PR opened so interested people can use @yehuohan branch. This is an OK solution while both branches are still similar. Up to you! Thank you. |
Add configuration
excluded_filetypesto skip specified windows and buffers.For example, we can setup hop.nvim with
to avoid crash when running
HopChar1MWwith pluginchentoast/marks.nvimenabled.