shortcut problem with code completion

  • 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


    • Franz Steinhaeusler

      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.


    • Daniel Pozmanter

      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.

    • Franz Steinhaeusler

      it seems, that all keyboard bindings, which actually
      inserts text into the document, aren't working here
      (on WinXP, 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 (?)

    • Daniel Pozmanter

      Bother it.  I cannot seem to replicate this at all.
      On windows/linux,, python 2.2/2.3, all is well.
      Is this perhaps a 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 into the OnAutoComplete-function:
      def OnAutoComplete(event):
           word,partext,origword = GetWordOfInterest( DrFrame.txtDocument,True )
              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

      The result with code completion set to shortcut "F12" looks like this:
      len: 6
      origword: scene.

      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 on WinXP-SP2. Therefore it cannot be a wxpython 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. 


    • Franz Steinhaeusler

      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)
      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)


    • Daniel Pozmanter

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


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks