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 could share it among scripts (and maybe provide a more pythonic interface for many of the things Eclipse provides). What do you think?

On 4/25/06, Don Taylor <> 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 = PySelection(editor)
             selected_text = selection.getSelectedText()
             offset = selection.getAbsoluteCursorOffset()
             length = selection.getSelLength()

             document = editor.getDocument()
             new_text = "Did this make it in?" + "\nNew line"
             document.replace(offset, length, new_text)


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 Geronimo
pydev-code mailing list