Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix snippets indentation

  • Loading branch information...
commit 572689acaac1e69da649da2e523bf55a0c246e71 1 parent 6b01123
@mostafaeweda mostafaeweda authored
View
16 plugins-client/ext.codecomplete/snippets/javascript.json
@@ -1,11 +1,11 @@
{
- "fun": "function ^^() {\n \n}",
- "fn": "function() {\n ^^\n}",
- "sc": "(function() {\n ^^\n})();",
- "if ": "if (^^) {\n \n}",
- "while ": "while (^^) {\n \n}",
- "switch ": "switch (^^) {\n default:\n}",
- "for ": "for (var i = 0; i < ^^.length; i++) {\n \n}",
+ "fun": "function ^^() {\n\t\n}",
+ "fn": "function() {\n\t^^\n}",
+ "sc": "(function() {\n\t^^\n})();",
+ "if ": "if (^^) {\n\t\n}",
+ "while ": "while (^^) {\n\t\n}",
+ "switch ": "switch (^^) {\n\tdefault:\n}",
+ "for ": "for (var i = 0; i < ^^.length; i++) {\n\t\n}",
"log": "console.log(^^);",
- "setTimeout ": "setTimeout(function() {\n ^^\n}, 0);"
+ "setTimeout ": "setTimeout(function() {\n\t^^\n}, 0);"
}
View
16 plugins-client/ext.htmllanguage/snippets.js
@@ -4,20 +4,20 @@ module.exports = {
"script": "<script type=\"text/javascript\" src=\"^^\"></script>",
"csslink": "<link rel=\"stylesheet\" href=\"^^\" type=\"text/css\" />",
"link": "<link rel=\"stylesheet\" href=\"^^\" type=\"text/css\" />",
- "style": "<style type=\"text/css\">\n ^^\n</style>",
+ "style": "<style type=\"text/css\">\n\t^^\n</style>",
"amailto": "<a href=\"mailto:^^\"></a>",
- "html": "<!DOCTYPE html>\n<html>\n ^^\n</html>",
- "body": "<body>\n ^^\n</body>",
- "head": "<head>\n ^^\n</head>",
- "table": "<table>\n <tr>\n <td>^^</td>\n </tr>\n</table>",
- "th": "<th>\n ^^\n</th>",
- "tr": "<tr>\n ^^\n</tr>",
+ "html": "<!DOCTYPE html>\n<html>\n\t^^\n</html>",
+ "body": "<body>\n\t^^\n</body>",
+ "head": "<head>\n\t^^\n</head>",
+ "table": "<table>\n\t<tr>\n\t\t<td>^^</td>\n\t</tr>\n</table>",
+ "th": "<th>\n\t^^\n</th>",
+ "tr": "<tr>\n\t^^\n</tr>",
"td": "<td>^^</td>",
"divc": "<div class=\"^^\"></div>",
"div": "<div>^^</div>",
"spanc": "<span class=\"^^\"></span>",
"span": "<span>^^</span>",
- "form": "<form>\n <input type=\"text\" name=\"^^\"/>\n <input type=\"submit\" value=\"Submit\"/>\n</form>",
+ "form": "<form>\n\t<input type=\"text\" name=\"^^\"/>\n\t<input type=\"submit\" value=\"Submit\"/>\n</form>",
"input": "<input type=\"text\" name=\"^^\"/>",
"password": "<input type=\"password\" name=\"^^\"/>",
"textarea": "<input type=\"textarea\" name=\"^^\"/>",
View
7 plugins-client/ext.language/complete.js
@@ -103,8 +103,9 @@ function replaceText(editor, match) {
function asyncReplaceText(editor, match) {
var newText = match.replaceText;
var pos = editor.getCursorPosition();
- var line = editor.getSession().getLine(pos.row);
- var doc = editor.getSession().getDocument();
+ var session = editor.getSession();
+ var line = session.getLine(pos.row);
+ var doc = session.getDocument();
var prefix = completeUtil.retrievePreceedingIdentifier(line, pos.column, match.idRegex);
if (match.replaceText === "require(^^)" && isJavaScript()) {
@@ -113,6 +114,8 @@ function asyncReplaceText(editor, match) {
setTimeout(deferredInvoke, AUTO_OPEN_DELAY);
isInvokeScheduled = true;
}
+
+ newText = newText.replace(/\t/g, session.getTabString());
// Ensure cursor marker
if (newText.indexOf("^^") === -1)
Please sign in to comment.
Something went wrong with that request. Please try again.