fix #1606 broken markdown snippets
This commit is contained in:
parent
fbdcbd00a1
commit
3c6cd4d16f
2 changed files with 11 additions and 8 deletions
|
|
@ -155,11 +155,13 @@ var SnippetManager = function() {
|
||||||
case "SELECTED_TEXT":
|
case "SELECTED_TEXT":
|
||||||
return s.getTextRange(r);
|
return s.getTextRange(r);
|
||||||
case "CURRENT_LINE":
|
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":
|
case "LINE_INDEX":
|
||||||
return e.getCursorPosition().column;
|
return editor.getCursorPosition().column;
|
||||||
case "LINE_NUMBER":
|
case "LINE_NUMBER":
|
||||||
return e.getCursorPosition().row + 1;
|
return editor.getCursorPosition().row + 1;
|
||||||
case "SOFT_TABS":
|
case "SOFT_TABS":
|
||||||
return s.getUseSoftTabs() ? "YES" : "NO";
|
return s.getUseSoftTabs() ? "YES" : "NO";
|
||||||
case "TAB_SIZE":
|
case "TAB_SIZE":
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,15 @@ snippet ![:*
|
||||||
![${1:id}]: ${2:`@*`} "${3:title}"
|
![${1:id}]: ${2:`@*`} "${3:title}"
|
||||||
|
|
||||||
snippet ===
|
snippet ===
|
||||||
`repeat('=', strlen(getline(line(".") - 1)))`
|
regex /^/=+/=*//
|
||||||
|
${PREV_LINE/./=/g}
|
||||||
|
|
||||||
${1}
|
${0}
|
||||||
snippet ---
|
snippet ---
|
||||||
`repeat('-', strlen(getline(line(".") - 1)))`
|
regex /^/-+/-*//
|
||||||
|
${PREV_LINE/./-/g}
|
||||||
|
|
||||||
${1}
|
${0}
|
||||||
|
|
||||||
snippet blockquote
|
snippet blockquote
|
||||||
{% blockquote %}
|
{% blockquote %}
|
||||||
${1:quote}
|
${1:quote}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue