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
Add multi_windows and dict support #133
Conversation
Cool features! I PR-ed #39 that has the similar feature. It uses a calculated dict for I want to merge here and #39 if possible, so that many people are happy to hop! |
@delphinus With pleasure to hear more dict support. How would you like to merge cmigemo dict? Would you like commit your cmigemo dict to multi-windows branch and then I bypass here or any other way you would like? |
I transformed this dict (utf-8.lua) from vim-easymotion's one. The original already has punctuation entries and they have Japanese-specific Regexp. Such as, we can hop by
2. & 3. are used only in Japanese, so it is not so useful that we separate them from utf-8.lua. |
Think for you reply. It's true that I thought it too simple. When I look back, I find out that taking punctations as part of a language is better and we don't need to maintain the difference of punctations that various language use. |
Ah, I see. But I think it is difficult to solve “What are punctuation marks?”. Because some symbols include Japanese-specific regexp, ones from vim-easymotion at least. 🤔
As one solution, it should be good that we limit “punctuation marks” to |
It's seemd that I didn't commet clear. I said |
Thanks for the PR, I’ll have a look asap. |
Add commits to fix the issue of different windows with the same buffer:
The main change is to |
doc/hop.txt
Outdated
Defaults:~ | ||
`multi_windows = false` | ||
|
||
`dict_list` |
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.
The name of this configuration variable is not explicit enough. Can you change it to something that conveys what it’s used for?
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.
How about match_mappings
or search_mappings
? Means that extending the match space via mapping the pattern to what match_mappings
provided.
lua/hop/dict/ascii.lua
Outdated
@@ -0,0 +1,98 @@ | |||
-- Ascii |
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.
Eh, this is going to generate a regression in lots of configuration, starting with mine, where I use unicode on some of my keys (I’m using the bépo layout, so é
is a direct key to me).
Not sure this is a good idea to do it that way.
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 think I had ignored the case for different layout. And for users who use bépo layout, the key of dict from ascii.lua
may be unicode keys, but not only the ascii keys.
I fix the issue by rename ascci.lua
to zh.lua
( and add some unicode mappings to zh.lua used in Chinese language ), meaning zh.lua
is a basic mappings to Chinese language.
lua/hop/hint.lua
Outdated
local dict_char_pat = '' | ||
-- checkout dict-char pattern from each dict | ||
for _, v in ipairs(opts.dict_list) do | ||
local val = require('hop.dict.' .. v)[char] |
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’m not sure how caching will be done by the Lua runtime here but even then I’m not liking this style, especially because that loop could be partially moved out to prevent having to get the cached dict.
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.
How about executing dict require
at setup()?
This commit is a simple fix to this issue. If it's a correct fix, I'm pleasure to merge it to this PR.
Can you resolve your conflicts so that we I can review properly? I haven’t had to review lately. |
I rebased this PR into a new branch new-multi-windows. But I'm not familar with the api "test script
let g:ns = nvim_create_namespace('test')
call nvim_buf_set_extmark(0, g:ns , 0, 0, {
\ 'end_line': 1,
\ 'end_col': 2,
\ 'hl_group': 'Question',
\ 'hl_eol': v:true,
\ 'priority': 100 }) @phaazon Do you have any idea about the |
0aac6c9
to
161dbed
Compare
My fault. I mixed up that @phaazon Now |
This PR has been around for a long time and its scope is too wide (multi window, dict, previews). I’m going to close this, especially because of the conflicts. This is probably my fault because of the recent (big) redesign that I did to ship Hop v1.0 along with the extensions support. However, I would happily review a subset of that PR for the multi-window support as a priority, as people are asking for it and I see that as a top-1 feature for Hop. For dict support and previews, one PR each is clearly something I would like to review too. Don’t hesitate to re-open 3 PRs @yehuohan for those topics. |
Thank your comment and I'll split out each feature as single PR with the new plugin API. |
@yehuohan The dict feature could be very useful! Is there any progress? Thanks! |
HopPattern
like(easymotion-sn)
what does. As it's based on dict pattern, so it supports dict preview alse.