Repository navigation
Conversation
5dbc2bc to
b0af507
Compare
|
In order to be compatible with various devices, especially old versions of Vim: I hope that the new features will not affect the user experience of my original settings, because the higher consistency is generally more comfortable to use. I just compiled your PR, it works well and meets my expectations. Now I can add About #15294, I don't need fuzzy collection very much personally, I just need the fuzzy filter to work perfectly with longest. Now fuzzy filter and fuzzy collect are separated, so let's test the To be honest, it is not easy to make
So my personal idea is to implement a effect similar to Another issue, run Of course, after the fuzzy filter and fuzzy collect are separated, we now have more choices, such as |
|
Thanks for the detailed reply. I will fix the wholeline bug later. I will take a look at longest. |
417401d to
d2a8a5d
Compare
79fd1f1 to
66f5bc9
Compare
|
See your new commit, did you revert your last commit? To be honest, I think you can consider how to balance it later.
As a summary, let's categorize the achievements before this submission about this reply. Firstly, Most importantly, fuzzy filter and fuzzy collect are separated, which gives us too many choices. For me personally, I just need
Then, We have been discussing and testing
In conclusion, I will only set
BTW, this bug still exists in the latest commit. |
b299d0f to
7f32f01
Compare
|
@roccomao The current behavior is that subsequent input will not be searched again. This means that if you type h for hello helio think`, you will get hel. If you type k again, you will not get think. |
@glepnir First of all, I think this is acceptable at present. I seem to have a long comment before to explain why. I remember that the purpose of pointing this out at first seemed to be just to propose a possible requirement. Thanks for your work, I may do some simple testing again later to give you feedback. |
|
Thank you for your kind help ❤️ |
|
@glepnir LGTM 👍 And after revert this, As you said before, now the problem of comment[1] and comment[2] is gone too. |
| each enabling fuzzy collection for a specific completion mode: | ||
| k keyword completion in 'complete' and current file | ||
| l whole lines | ||
| f file names |
There was a problem hiding this comment.
can we use the values "keyword", "lines", "files" instead? That way it is more intuitive.
Also I have to wonder, what about the other completion modes? Will that be done later? Or is not affected?
There was a problem hiding this comment.
Also I have to wonder, what about the other completion modes? Will that be done later? Or is not affected?
not be affected. because they are all separated. If there are bugs, it will not affect daily use. If someone needs a certain mode to be included, then implement it here.
There was a problem hiding this comment.
can we use the values "keyword", "lines", "files" instead? That way it is more intuitive.
okay
There was a problem hiding this comment.
Not affected means what? Other completion methods will be supporting "fuzzy collection" or not? Please clarify in the doc.
There was a problem hiding this comment.
I think the documentation has already explained that only keyword filename wholeline is supported. Those outside this range are not supported.
|
@glepnir Thank you for working on this Might I suggest:
|
|
It just sounds consistent with: |
|
|
|
But those are return values of complete_info(mode), correct ? A bit different than values for set someoption=... |
|
thanks all. |
There is also |
|
Unfortunately, this introduce 2 warnings in Coverity: leader = ins_compl_leader();
54. Condition leader != NULL, taking false branch.
55. var_compare_op: Comparing leader to null implies that leader might be null.
3961 if (leader != NULL)
3962 leader_len = STRLEN(leader);
3963
3964 // skip non-consecutive prefixes
CID 1644149: (#1 of 1): Dereference after null check (FORWARD_NULL)
56. var_deref_model: Passing null pointer leader to strncmp, which dereferences it.
3965 if (STRNCMP(prefix, leader, leader_len) != 0)
3966 goto end; }
12. Condition in_fuzzy_collect, taking true branch.
13. Condition leader_len > 0, taking true branch.
25. Condition in_fuzzy_collect, taking true branch.
26. Condition leader_len > 0, taking true branch.
1854 else if (in_fuzzy_collect && leader_len > 0)
1855 {
1856 line_end = find_line_end(ptr);
14. Condition ptr < line_end, taking true branch.
27. Condition ptr < line_end, taking true branch.
32. Condition ptr < line_end, taking true branch.
37. Condition ptr < line_end, taking true branch.
1857 while (ptr < line_end)
1858 {
15. Condition fuzzy_match_str_in_line(&ptr, leader, &len, NULL, &score), taking false branch.
28. Condition fuzzy_match_str_in_line(&ptr, leader, &len, NULL, &score), taking false branch.
33. Condition fuzzy_match_str_in_line(&ptr, leader, &len, NULL, &score), taking false branch.
CID 1644150: (#3 of 3): Untrusted value as argument (TAINTED_SCALAR)
38. tainted_data: Passing tainted expression *ptr to fuzzy_match_str_in_line, which uses it as an offset.[show details]
Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
CID 1644150:(#1 of 3):Untrusted value as argument (TAINTED_SCALAR) [ "select issue" ]
CID 1644150:(#2 of 3):Untrusted value as argument (TAINTED_SCALAR) [ "select issue" ]
1859 if (fuzzy_match_str_in_line(&ptr, leader, &len, NULL, &score))
1860 {
1861 char_u *end_ptr = ctrl_x_mode_line_or_eval()
1862 ? find_line_end(ptr) : find_word_end(ptr);
1863 add_r = ins_compl_add_infercase(ptr, (int)(end_ptr - ptr),
1864 p_ic, files[i], *dir, FALSE, score);
1865 if (add_r == FAIL)
1866 break;
1867 ptr = end_ptr; // start from next word
1868 if (compl_get_longest && ctrl_x_mode_normal()
1869 && compl_first_match->cp_next
1870 && score == compl_first_match->cp_next->cp_score)
1871 compl_num_bests++;
1872 }@glepnir can you please check it? Thanks |
|
#16814 may fix the first Coverity warning |
fuzzyincompleteoptmeans to fuzzy filter each cp_str only if our compl_match doubly linked list is not empty. For some default completion modes use the new option completefuzzycollect in ins-completion to control this. This way there will be no violation of the original behavior.Fix #15296
Fix #15295
Fix #15294