parameters: (self, event)
return_statement: return "break"
docstring: Replace the current word with the next expansion.
docstring_summary: Replace the current word with the next expansion.
docstring_tokens: Replace the current word with the next expansion .
function: def expand_word_event(self, event):
          "Replace the current word with the next expansion."
          curinsert = self.text.index("insert")
          curline = self.text.get("insert linestart", "insert lineend")
          if not self.state:
              words = self.getwords()
              index = 0
          else:
              words, index, insert, line = self.state
              if insert != curinsert or line != curline:
                  words = self.getwords()
                  index = 0
          if not words:
              self.text.bell()
              return "break"
          word = self.getprevword()
          self.text.delete("insert - %d chars" % len(word), "insert")
          newword = words[index]
          index = (index + 1) % len(words)
          if index == 0:
              self.text.bell()            # Warn we cycled around
          self.text.insert("insert", newword)
          curinsert = self.text.index("insert")
          curline = self.text.get("insert linestart", "insert lineend")
          self.state = words, index, curinsert, curline
          return "break"
function_tokens: def expand_word_event ( self , event ) : curinsert = self . text . index ( "insert" ) curline = self . text . get ( "insert linestart" , "insert lineend" ) if not self . state : words = self . getwords ( ) index = 0 else : words , index , insert , line = self . state if insert != curinsert or line != curline : words = self . getwords ( ) index = 0 if not words : self . text . bell ( ) return "break" word = self . getprevword ( ) self . text . delete ( "insert - %d chars" % len ( word ) , "insert" ) newword = words [ index ] index = ( index + 1 ) % len ( words ) if index == 0 : self . text . bell ( ) # Warn we cycled around self . text . insert ( "insert" , newword ) curinsert = self . text . index ( "insert" ) curline = self . text . get ( "insert linestart" , "insert lineend" ) self . state = words , index , curinsert , curline return "break"