summaryrefslogtreecommitdiffstats
path: root/indent/litcoffee.vim
blob: 0515201f19a1a550ea6e8a7eee9a4c0f35a0ef6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if !polyglot#util#IsEnabled('coffee-script', expand('<sfile>:p'))
  finish
endif

if exists('b:did_indent')
  finish
endif

runtime! indent/coffee.vim

let b:did_indent = 1

setlocal indentexpr=GetLitCoffeeIndent()

if exists('*GetLitCoffeeIndent')
  finish
endif

function GetLitCoffeeIndent()
  if searchpair('^    \|\t', '', '$', 'bWnm') > 0
    return GetCoffeeIndent(v:lnum)
  else
    return -1
  endif
endfunc