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

Re: completion problem

Expand Messages
  • Yukihiro Nakadaira
    ... I expect noignorecase ignorecase 3: 3: foo foo Foo Foo 3: f 3: f foo foo Foo 3:
    Message 1 of 3 , Sep 28, 2006
    • 0 Attachment
      Bram Moolenaar wrote:
      > Yukihiro Nakadaira wrote:
      >> There are two problems in completion. I wrote a patch. Please check
      >> the following.
      >> 1. 'ignorecase' does not work for completion.
      >> For example, when ":set nosmartcase ignorecase" and buffer is
      >> 1: foo
      >> 2: Foo
      >> Then, complete with
      >> 3: <C-N>
      >> or
      >> 3: f<C-N>
      >> or
      >> 3: F<C-N>
      >> In all cases, only "foo" is matched.
      > Hmm, setting 'ignorecase' was used as a hint that case doesn't matter.
      > However, when it's set just to find more matches, you will still want to
      > complete words with different case, I suppose.

      I expect

      'noignorecase' 'ignorecase'
      3: <C-N> 3: <C-N>
      foo foo
      Foo Foo

      3: f<C-N> 3: f<C-N>
      foo foo

      3: F<C-N> 3: F<C-N>
      Foo foo

      This is same as searching behavior. And before 7.0.068, Vim behaved as
      I expect.

      > I wonder if this change causes a problem in combination with other
      > things, such as using "longest" in 'completeopt'.

      My patch seems to work with "longest". But maybe it should be tested
      for other completion method. I checked only i_CTRL-X_CTRL-N.

      >> 2. Completion is slow when 'completeopt' doesn't have "menu" and
      >> "menuone". Until search finished, current selected item is not
      >> displayed and typed key is not handled (except CTRL-C).
      > I wonder when this is noticable. I do see a match displayed before the
      > search is finished. Is this only in a very long file perhaps?

      Yes, I worry for very long file. The unoperatable time I complained to
      is only 3 or 5 seconds, but I don't like it. And I think there is no
      reason to not check if key is typed while searching, only when popup
      menu is not used.

      By the way, I got a crash with plain vim when 'completeopt' doesn't have
      "longest" and CTRL-L is used while completing.

      $ vim -u NONE
      :execute "normal! ifoo\n\<C-N>\<C-P>\<C-L>"

      This is stacktrace.

      #0 0x2889c0b9 in strlen () from /lib/libc.so.6
      #1 0x08066191 in ins_compl_addfrommatch () at edit.c:3209
      #2 0x080625f2 in edit (cmdchar=111, startln=1, count=1) at edit.c:753
      #3 0x0811b55b in invoke_edit (cap=0xbfbfe4c0, repl=0, cmd=111, startln=1)
      at normal.c:8714
      #4 0x0811a855 in n_opencmd (cap=0xbfbfe4c0) at normal.c:8085
      #5 0x0811bd9c in nv_open (cap=0xbfbfe4c0) at normal.c:9059
      #6 0x0810f810 in normal_cmd (oap=0xbfbfe530, toplevel=1) at normal.c:1137
      #7 0x080d7201 in main_loop (cmdwin=0, noexmode=0) at main.c:1154
      #8 0x080d6d63 in main (argc=3, argv=0xbfbfe6f8) at main.c:934

      Yukihiro Nakadaira - yukihiro.nakadaira@...
    Your message has been successfully submitted and would be delivered to recipients shortly.