Re: [Pydev-code] Re: Jython scripting
Brought to you by:
fabioz
From: Fabio Z. <fa...@gm...> - 2006-04-26 11:00:47
|
Yeap, that's what I'd do too... Maybe I can do a 'replace selected text' method in pyselection... Also, I think that the scripting engine could start having some 'utilities' module that you can use, where this kind of stuff would go so that you coul= d share it among scripts (and maybe provide a more pythonic interface for man= y of the things Eclipse provides). What do you think? On 4/25/06, Don Taylor <nos...@gm...> wrote: > > Fabio Zadrozny wrote: > > Actually there is 1 method that does it (but it's the single one, so, > > you may want to use one of IDocument if it's not what you want): > > > > public void addLine(String contents, int afterLine) > > > Ah, ok. This does not do quite what I want. I want to replace the > current selection with some new text. Right now I am using something > like: > > selection =3D PySelection(editor) > selected_text =3D selection.getSelectedText() > offset =3D selection.getAbsoluteCursorOffset() > length =3D selection.getSelLength() > > document =3D editor.getDocument() > new_text =3D "Did this make it in?" + "\nNew line" > document.replace(offset, length, new_text) > > Don. > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |