Skip to content

Commit

Permalink
prefer lispindent() to 'lisp' and add cpo to syntax file
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Jul 29, 2018
1 parent 9446e98 commit c4555b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runtime/indent/wast.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ endif
let b:did_indent = 1

" WebAssembly text format is S-expression. We can reuse LISP indentation
setlocal lisp
setlocal indentexpr=
" logic.
setlocal indentexpr=lispindent('.')
setlocal noautoindent nosmartindent

let b:undo_indent = "setl lisp< indentexpr<"
6 changes: 6 additions & 0 deletions runtime/syntax/wast.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if exists("b:current_syntax")
finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn cluster wastCluster contains=wastModule,wastInstWithType,wastInstGeneral,wastParamInst,wastControlInst,wastString,wastNamedVar,wastUnnamedVar,wastFloat,wastNumber,wastComment,wastList,wastType

" Instructions
Expand Down Expand Up @@ -76,3 +79,6 @@ hi def link wastComment Comment
hi def link wastType Type

let b:current_syntax = "wast"

let &cpo = s:cpo_save
unlet s:cpo_save

0 comments on commit c4555b5

Please sign in to comment.