* Contributors:
* Igor Malinin - initial contribution
*
- * $Id: MultiViewPartitioner.java,v 1.2 2004-09-22 18:51:51 jsurfer Exp $
+ * $Id: MultiViewPartitioner.java,v 1.3 2004-10-21 16:21:11 jsurfer Exp $
*/
package net.sourceforge.phpeclipse.ui.text.rules;
try {
if (outerDocument != null) {
DocumentEvent event = null;
- if (position.offset >= 0) {
- event = new DocumentEvent(outerDocument, outerDocument.getLocalOffset(position.offset), 0, document.get(position.offset,
- position.length));
+ if (position.offset >= 0 && position.length >= 0) {
+ int outerOffset = outerDocument.getLocalOffset(position.offset);
+ if (outerOffset > 0) {
+ event = new DocumentEvent(outerDocument, outerOffset, 0, document.get(
+ position.offset, position.length));
- outerDocument.fireDocumentAboutToBeChanged(event);
+ outerDocument.fireDocumentAboutToBeChanged(event);
+ }
}
super.removeInnerRegion(position);
if (position.offset >= 0) {
if (p instanceof ViewNode) {
// TODO: revisit condition
InnerDocumentView innerDocument = ((ViewNode) p).view;
- if (innerDocument != null) {
+ if (innerDocument != null) {
int start = innerDocument.getLocalOffset(offset);
innerDocument.fireDocumentChanged(new DocumentEvent(innerDocument, start, length, text));
}