(self, wnd, pos, posto, s, update_cursor=True)
Replace string
Replace string
Replace string
def replace_string(self, wnd, pos, posto, s, update_cursor=True):
        """Replace string"""

        cur_pos = wnd.cursor.pos

        deled = wnd.document.gettext(pos, posto)
        wnd.document.replace(pos, posto, s)

        if update_cursor:
            wnd.cursor.setpos(pos + len(s))
            wnd.cursor.savecol()

        if wnd.document.undo:
            wnd.document.undo.add(self.UNDO_REPLACE, pos, posto, s,
                                  deled, cur_pos, wnd.cursor.pos)

        self.on_edited(wnd)
def replace_string ( self , wnd , pos , posto , s , update_cursor = True ) : cur_pos = wnd . cursor . pos deled = wnd . document . gettext ( pos , posto ) wnd . document . replace ( pos , posto , s ) if update_cursor : wnd . cursor . setpos ( pos + len ( s ) ) wnd . cursor . savecol ( ) if wnd . document . undo : wnd . document . undo . add ( self . UNDO_REPLACE , pos , posto , s , deled , cur_pos , wnd . cursor . pos ) self . on_edited ( wnd )