// this macro adds common syntax keywords to autocomplete // start undo buffer.beginCompoundEdit(); // start autocomplete for buffer net.jakubholy.jedit.autocomplete.AutoComplete.attachAction(buffer); // starting position begin=textArea.getCaretPosition(); // set keywords array according to current mode mode = buffer.getMode().name; switch (mode) { case "php": String[] words={ /*string functions only*/ "addcslashes", "addslashes", "bin2hex", "chop", "chr", "chunk_split", "convert_cyr_string", "convert_uudecode", "convert_uuencode", "count_chars", "crc32", "crypt", "echo", "explode", "fprintf", "get_html_translation_table", "hebrev", "hebrevc", "html_entity_decode", "htmlentities", "htmlspecialchars_decode", "htmlspecialchars", "implode", "join", "lcfirst", "levenshtein", "localeconv", "ltrim", "md5_file", "md5", "metaphone", "money_format", "nl_langinfo", "nl2br", "number_format", "ord", "parse_str", "print", "printf", "quoted_printable_decode", "quotemeta", "rtrim", "setlocale", "sha1_file", "sha1", "similar_text", "soundex", "sprintf", "sscanf", "str_getcsv", "str_ireplace", "str_pad", "str_repeat", "str_replace", "str_rot13", "str_shuffle", "str_split", "str_word_count", "strcasecmp", "strchr", "strcmp", "strcoll", "strcspn", "strip_tags", "stripcslashes", "stripos", "stripslashes", "stristr", "strlen", "strnatcasecmp", "strnatcmp", "strncasecmp", "strncmp", "strpbrk", "strpos", "strrchr", "strrev", "strripos", "strrpos", "strspn", "strstr", "strtok", "strtolower", "strtoupper", "strtr", "substr_compare", "substr_count", "substr_replace", "substr", "trim", "ucfirst", "ucwords", "vfprintf", "vprintf", "vsprintf", "wordwrap" }; break; case "html": String[] words={ "DOCTYPE", "html", "body", "font", "strong", "small", "code", "samp", "acronym" , "abbr", "address", "blockquote", "center", "cite", "strike", "link", "frame" , "frameset", "noframes", "iframe", "form", "input", "textarea", "button" , "select", "optgroup", "option", "label", "fieldset", "legend", "isindex", "menu" , "area", "table", "caption", "thead", "tbody", "tfoot", "colgroup", "style", "span", "head", "title", "meta", "base", "basefont", "script", "noscript", "applet", "object", "param", "class", "style", "title", "lang", "accesskey", "tabindex", "onload", "onunload", "onchange", "onsubmit", "onreset", "onselect", "onblur", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onclick", "ondblclick", "onmousedown", "onmousemove", "onmouseover", "onmouseout", "onmouseup", "aqua", "black", "blue", "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", "purple", "silver", "teal", "white", "yellow", "tal:contents", "tal:attributes", "tal:condition", "tal:repeat", "tal:define", "tal:on-error", "tal:replace", "tal:omit-tag", "metal:define-macro", "metal:use-macro", "metal:define-slot", "metal:fill-slot", "i18n:translate", "i18n:name", "phptal:debug", "phptal:cache", "phptal:tales", "exists", "default", "structure", "string", "autocomplete", }; break; case "css": String[] words={ "azimuth", "background-attachment", "background-color", "background-image", "background-position", "background-repeat", "background", "border-collapse", "border-color", "border-spacing", "border-style", "border-top", "border-right", "border-bottom", "border-left", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", "border-top-style", "border-right-style", "border-bottom-style", "border-left-style", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "border-width", "border", "bottom", "caption-side", "clear", "clip", "color", "content", "counter-increment", "counter-reset", "cue-after", "cue-before", "cursor", "direction", "display", "elevation", "empty-cells", "float", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "height", "left", "letter-spacing", "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "margin-right", "margin-left", "margin-top", "margin-bottom", "margin", "max-height", "max-width", "min-height", "min-width", "orphans", "outline-color", "outline-style", "outline-width", "outline", "overflow", "padding-top", "padding-right", "padding-bottom", "padding-left", "padding", "page-break-after", "page-break-before", "page-break-inside", "pause-after", "pause-before", "pause", "pitch-range", "pitch", "play-during", "position", "quotes", "richness", "right", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", "stress", "table-layout", "text-align", "text-decoration", "text-indent", "text-transform", "unicode-bidi", "vertical-align", "visibility", "voice-family", "volume", "white-space", "widows", "width", "word-spacing", "z-index", "zoom" }; break; case "beanshell": String[] words={ "textArea", "buffer", "setSelectedText" }; break; default: String[] words={}; } // write keywords to textArea for (var i=0;i