Permalink
Browse files

Fix indent with syntax off

Move indent related settings from syntax to index.
Fix #126
  • Loading branch information...
1 parent 67b59d5 commit 642730fccce7e78c995389f3c430747d266efa96 @shirosaki shirosaki committed Nov 16, 2015
Showing with 34 additions and 10 deletions.
  1. +10 −0 indent/markdown.vim
  2. +0 −10 syntax/markdown.vim
  3. +24 −0 test/indent.vader
View
@@ -5,6 +5,16 @@ setlocal indentexpr=GetMarkdownIndent()
setlocal nolisp
setlocal autoindent
+" Automatically insert bullets
+setlocal formatoptions+=r
+" Do not automatically insert bullets when auto-wrapping with text-width
+setlocal formatoptions-=c
+" Accept various markers as bullets
+setlocal comments=b:*,b:+,b:-
+
+" Automatically continue blockquote on line break
+setlocal comments+=b:>
+
" Only define the function once
if exists("*GetMarkdownIndent") | finish | endif
View
@@ -130,16 +130,6 @@ HtmlHiLink mkdLinkTitle htmlString
HtmlHiLink mkdMath Statement
HtmlHiLink mkdDelimiter Delimiter
-" Automatically insert bullets
-setlocal formatoptions+=r
-" Do not automatically insert bullets when auto-wrapping with text-width
-setlocal formatoptions-=c
-" Accept various markers as bullets
-setlocal comments=b:*,b:+,b:-
-
-" Automatically continue blockquote on line break
-setlocal comments+=b:>
-
let b:current_syntax = "mkd"
delcommand HtmlHiLink
View
@@ -0,0 +1,24 @@
+Given markdown;
+* item1
+
+Do (Insert enter at list end):
+ A\<Enter>item2
+
+Expect (auto insert * and indent level is same):
+ * item1
+ * item2
+
+Given markdown;
+
+Execute:
+ syntax off
+
+Do (Insert enter at list end with syntax off):
+ i* item1\<Enter>item2
+
+Expect (auto insert * and indent level is same):
+ * item1
+ * item2
+
+Execute:
+ syntax on

0 comments on commit 642730f

Please sign in to comment.