From: khartlage Date: Sat, 3 May 2003 13:57:55 +0000 (+0000) Subject: improved auto trigger for html X-Git-Url: http://git.phpeclipse.com improved auto trigger for html --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/HTMLUnitContext.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/HTMLUnitContext.java index 76343dd..afec8f5 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/HTMLUnitContext.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/HTMLUnitContext.java @@ -95,21 +95,39 @@ public class HTMLUnitContext extends DocumentTemplateContext { IDocument document = getDocument(); try { int start = getCompletionOffset(); - - if ( ((start != 0) && specialChars.indexOf(document.getChar(start - 1)) != (-1) )) { - return --start; - } - - while (((start != 0) && Character.isUnicodeIdentifierPart(document.getChar(start - 1))) - || ((start != 0) && specialChars.indexOf(document.getChar(start - 1)) != (-1) )) { - start--; + char ch = ' '; + while (start != 0) { + ch = document.getChar(start - 1); + if (specialChars.indexOf(ch) != (-1)) { + return --start; + } + if (Character.isUnicodeIdentifierPart(ch)) { + start--; + } else { + break; + } } - - if (((start != 0) && Character.isUnicodeIdentifierStart(document.getChar(start - 1))) - || ((start != 0) && specialChars.indexOf(document.getChar(start - 1)) != (-1) )) { + if ((start != 0) && Character.isUnicodeIdentifierStart(document.getChar(start - 1))) { start--; + if ((start != 0) && specialChars.indexOf(document.getChar(start - 1)) != (-1)) { + start--; + } } + // while (((start != 0) + // && Character.isUnicodeIdentifierPart(document.getChar(start - 1))) + // || ((start != 0) + // && specialChars.indexOf(document.getChar(start - 1)) != (-1))) { + // start--; + // } + // + //if (((start != 0) + // && Character.isUnicodeIdentifierStart(document.getChar(start - 1))) + // || ((start != 0) + // && specialChars.indexOf(document.getChar(start - 1)) != (-1))) { + // start--; + //} + return start; } catch (BadLocationException e) {