Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

shortcut problem with code completion

Help
Klaus_O
2004-11-08
2013-04-26
  • Klaus_O
    Klaus_O
    2004-11-08

    I configured code completion to show the code completion window after typing the character "." like discribed in the plugin help. Now when I type for example "wx." the code completion window appears for a few milliseconds, then disappears and then the char "." is inserted in the editor window.
    Is it a bug or am I doing somthing wrong?
    I use drpython 3.6.9, Python 2.3, wxPython 2.5.2.8

    regards
    klaus

     
    • Hello Klaus,

      (maybe a better place to report this would be plugins forum)
      Anyway I tried it out, and yes, this seems to be a bug.

      If I put the show Autocomplete list on '.', it behaves like
      you described. I i select for example alt-c for code
      completition, it works as expected.

      Franz

       
    • Did you restart drpython?

      At first I thought this was a code completion bug, but now I think it is because I started loading ALL plugin changes only on restart.

      If not, I am having trouble replicating this bug.

       
    • it seems, that all keyboard bindings, which actually
      inserts text into the document, aren't working here
      (on WinXP, 2.5.3.1 wxPython).
      the AutoComp flashes and then the '.' char is inserted
      into the txtdocument (I tried it also with '-' character).
      Maybe inserting the char '.' causes the AutoComp to close (?)

       
    • Bother it.  I cannot seem to replicate this at all.
      On windows/linux, 2.5.2.8, python 2.2/2.3, all is well.
      Is this perhaps a 2.5.3.1 centric bug?  Does it work on an earlier version?

      If not, try doing this on a vanilla install.  Is another plugin conflicting?  Perhaps another shortcut?  A preference?

      If you are still stuck, plop this in as a bug report, and attach your drpython preferences directory (plugins and all), and I will try to isolate the problem.

       
    • Klaus_O
      Klaus_O
      2004-11-13

      Hello Franz,

      sorry for beeing a little late continuing this thread, but I needed a little time to experiment.
      I added the following code to codecompletion.py into the OnAutoComplete-function:
      def OnAutoComplete(event):
           event.Skip()
           word,partext,origword = GetWordOfInterest( DrFrame.txtDocument,True )
              #test
              print "len: ", len(origword)
              print "origword: ", origword
              for c in origword:
                  print ord(c)
              #test end

      The result showed with code completion set to shortcut "." the following:
      len: 6
      origword: scene
      115
      99
      101
      110
      101
      13

      The result with code completion set to shortcut "F12" looks like this:
      len: 6
      origword: scene.
      115
      99
      101
      110
      101
      46

      It seems  that the last character in the var origword(13 = carriage return) in the first example leads to the code completion behaviour described in my first message.  Maybe you are able to replicate this as well.

      I think I have to take a closer look to the GetWordOfInterest-function cause the var origword comes from there. But this will take a little time, because I am just starting with python.

      Hello Daniel,

      like discribed in my first message I use drpython 3.6.9, Python 2.3, wxPython 2.5.2.8 on WinXP-SP2. Therefore it cannot be a wxpython 2.5.3.1 centric bug! I have started with DrPython 3.6.3 and as far as I can remeber it did not work properly from the beginning. I also tried a vanilla install (if that means a clean fresh install) with only the code completion plugin installed. I tried also to restart DrPython several times with the same result. 

      Regards
      Klaus

       
    • Hello Klaus,

      good observation!

      I found on my HD an older version of (0.0.0) codecompletion and it worked
      the current 0.0.2 makes the problem.
      So after file compare:
      I came to the conclusion, that if you replace
      DrFrame.txtDocument.AutoCompShow(len(origword), results)
      with
      DrFrame.txtDocument.AutoCompShow(len(word), results)
      it seems to work fine, but i'm not sure, if this is the right solution.
      But then for example alt-c isn't working properly anymore.
      wx=>alt-c ok
      wx.=>alt-c (it dissapears then again)

      Franz

       
    • Hey, I added in Franz's fix, this looks fine for now.