# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/hmichel/projetos/netbeans/main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/CompletionResultItem.java --- xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/CompletionResultItem.java Base (BASE) +++ xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/CompletionResultItem.java Locally Modified (Based On LOCAL) @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -286,8 +286,15 @@ @Override public void defaultAction(JTextComponent component) { - int charsToRemove = (typedChars==null)?0:typedChars.length(); - int substOffset = component.getCaretPosition() - charsToRemove; \ No newline at end of file + int substOffset; + int charsToRemove; + if (component.getSelectedText() == null) { + charsToRemove = (typedChars == null) ? 0 : typedChars.length(); + substOffset = component.getCaretPosition() - charsToRemove; + } else { + charsToRemove = component.getSelectedText().length(); + substOffset = component.getSelectionStart(); + } \ No newline at end of file if(!shift) Completion.get().hideAll(); if(getReplacementText().equals(typedChars)) return;