fix #1606 broken markdown snippets

This commit is contained in:
nightwing 2013-09-13 23:46:03 +04:00
commit 3c6cd4d16f
2 changed files with 11 additions and 8 deletions

View file

@ -155,11 +155,13 @@ var SnippetManager = function() {
case "SELECTED_TEXT":
return s.getTextRange(r);
case "CURRENT_LINE":
return s.getLine(e.getCursorPosition().row);
return s.getLine(editor.getCursorPosition().row);
case "PREV_LINE": // not possible in textmate
return s.getLine(editor.getCursorPosition().row - 1);
case "LINE_INDEX":
return e.getCursorPosition().column;
return editor.getCursorPosition().column;
case "LINE_NUMBER":
return e.getCursorPosition().row + 1;
return editor.getCursorPosition().row + 1;
case "SOFT_TABS":
return s.getUseSoftTabs() ? "YES" : "NO";
case "TAB_SIZE":

View file

@ -23,14 +23,15 @@ snippet ![:*
![${1:id}]: ${2:`@*`} "${3:title}"
snippet ===
`repeat('=', strlen(getline(line(".") - 1)))`
regex /^/=+/=*//
${PREV_LINE/./=/g}
${1}
${0}
snippet ---
`repeat('-', strlen(getline(line(".") - 1)))`
regex /^/-+/-*//
${PREV_LINE/./-/g}
${1}
${0}
snippet blockquote
{% blockquote %}
${1:quote}