Author Topic: sometimes auto completion doesn't works  (Read 3588 times)

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
sometimes auto completion doesn't works
« on: May 16, 2015, 03:52:48 AM »
Hi Expert,
     I am maintaining a lot of source codes (TCL+C/CPP), so I create a workspace/project for all of these codes,  sometimes, I will edit some legacy codes,  but auto completion sometimes doesn't works in c/c++; here is the details
1) if I implement a new c fucntion and append it to the legacy source code file like
     int test () {
         bool result = 1;
         int xyz;
         if (resu} {
         }
      ...
      when I type resu, the automatic completion will works and give a drop-downlist include  "result" in the list. that is what I expect.
2) if I modify some other legacy functions in that file to add below lines
    ....
    bool result = 1;
    if (resu) {   #here add by lusu,
    }
    ....
    after I type resu, it will never give the automatic completion candidates list. I wait for several mins, it still no hint shown, so I change to other applcaiton like firefox etc. after mins, I back to slickedit, it will immediately show a message  at right bottom of slickedit that "backgroud tagging is running". but there still no hint for automatically completion, then I continue type "l"  (so now, the word is "resul"), then it show the completion candidates list, then I use backspace to delete the character "l", the word change to "resu" again, and the automatcially condidates list shown again!     but more strange thing is coming...., that is if I remove the whole line "if {resu} {" and type it again from scratch,  after type "u", so the word change from "res" to "resu", there is still NO hint for candidates list. I suppose the tagging is done and the "result" varaible is in local scope, no matter I remove that line or not, SE should give the automatic completion hint, right?
     I try it both on ubuntu 14.04LTS and Redhat EE linux platform, same result.  so I am confused tottally.
any one could help to comment?

Thanks
Lusu

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
Re: sometimes auto completion doesn't works
« Reply #1 on: May 16, 2015, 03:56:31 AM »
I try again, sorry for my bad memory, the message shown after I switch back to slickedit is "updating ...vtg"

Thanks
Lusu

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
Re: sometimes auto completion doesn't works
« Reply #2 on: May 16, 2015, 04:07:22 AM »
continue try

if (result) {
    }
    if (resul) {
    }
    if (resu) {
    }
    if (resu) {
    }
    if (resu) {
    }

after I switch back from firefox to slickedit, I write several duplicate if {resu} {},
every time, when type resu, there is no hint for automatic completion (the drop-downlist), but once I press "ESC" (since I am in vim emulator), since the curor is still after the "u" character, it will show the auto-completion hint(the drop-down list)...  so I am still in puzzle..., what I expected is "show the hint" no matter I press ESC or not.

Thanks
Lusu

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: sometimes auto completion doesn't works
« Reply #3 on: May 18, 2015, 03:18:10 PM »
Auto-complete will not come up while Dynamic surround is active.  Completing the "if" statement activated dynamic surround, as indicated by the box drawn around the statement.

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
Re: sometimes auto completion doesn't works
« Reply #4 on: May 21, 2015, 05:29:14 AM »
Hi Dennis,
    thanks! I take a look again, yes , exactly as your comment, when the block is surrounded by a blue box, the auto complete doesn't work.

    but I am still confused, in the same .cpp file, why sometimes press if<space>, it lead into dynamic surround mode (in legacy function), an some other times (in fresh function), it lead into non-surround mode.

Thanks,
Lusu
« Last Edit: May 21, 2015, 05:33:18 AM by lusu2004 »

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: sometimes auto completion doesn't works
« Reply #5 on: May 21, 2015, 03:19:12 PM »
Surround mode isn't activated if there isn't anything to surround.  For example, if you add an if statement at the end of an existing statement block.

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
Re: sometimes auto completion doesn't works
« Reply #6 on: May 22, 2015, 02:30:11 AM »
Dennis,

    I got it. thanks a lot for your patient explanation.

Best Regards,
Lusu