Re: [Pydev-code] Re: Jython scripting
Brought to you by:
fabioz
From: Don T. <nos...@gm...> - 2006-04-26 01:22:57
|
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) Don. |