Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

@yehuohan
Copy link
Contributor

Add configuration excluded_filetypes to skip specified windows and buffers.

For example, we can setup hop.nvim with

require('hop').setup{
    excluded_filetypes = { 'scrollbar' }
}

to avoid crash when running HopChar1MW with plugin chentoast/marks.nvim enabled.

Copy link
Owner

@hadronized hadronized left a 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.
Copy link
Owner

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.

Copy link
Contributor Author

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
Copy link
Owner

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.

Copy link
Contributor Author

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.

@yehuohan yehuohan force-pushed the feat-excluded-filetypes branch from 4d50855 to 1d631f1 Compare October 15, 2022 16:44
@yehuohan yehuohan force-pushed the feat-excluded-filetypes branch from 1d631f1 to 65ce506 Compare October 15, 2022 16:53
@yehuohan
Copy link
Contributor Author

@phaazon I have updated the commit and rebased on the lastest commit. And this PR is ready for review now.

@Zeioth
Copy link

Zeioth commented Jun 26, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants