Loading ...
Sorry, an error occurred while loading the content.

68713Complete function refresh:always bug

Expand Messages
  • Tyler Wade
    Mar 17 12:22 PM
    • 0 Attachment
      The refresh:always option for user complete functions seems to be bugged.  Based on the description in the help file I expected the competion function called every time a character was added to the leader.  Instead, the popup menu disappears and a "-- User defined completion (^U^N^P) Back at original" message is displayed.  Pressing another key causes completion mode to be exited.  A video demonstration:

      Using a build from between 7.3.311 (which was when this feature was introduced) and 7.3.403 results in the behavior I expected:

      The current behavior began starting with 7.3.404, which attempted to fix issues with the redo buffer when refresh:always is used.  I've attached a patch (refresh_always_fix.diff) that reverts the change made in 7.3.404 (as well as 7.3.561) and attempts to fix the original redo buffer problem differently.  I've tried to test this change, and as far as I can tell everything is working correctly.

      While creating this patch I also found encountered some unsual behavior when using refresh:always. Specific there are two issues:
      1. when using completeopt+=longest it can be impossible to add text to the leader because it gets erased immediately
      2. the completion list is automatically filtered to candidates whose prefix matches the leader.
      I've attached a patch to handle each of these cases. For the completopt+=longest issue, it just ignores option when refresh:always is set.  For the filtering issue, the patch causes every candidate to be included in the completion list when refresh:always is set.  I think the complete longest thing being an issue is debatable since its technically doing what its supposed to, but I think the vim should definitely leave any filtering to the completion function since it gets called every time the list should change.

      I've also attached the vimscript with the completion function I sourced at the start of each video if you want to try it youself.

      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 3 messages in this topic