[
  {
    "path": ".github/workflows/main.yml",
    "content": "name: vim-svelte\non: [push, pull_request]\n\njobs:\n  test:\n    strategy:\n      fail-fast: false\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        neovim: [true, false]\n\n    runs-on: ${{ matrix.os }}\n    steps:\n      - name: Set up vim\n        uses: rhysd/action-setup-vim@v1\n        with:\n          version: stable\n          neovim: ${{ matrix.neovim }}\n\n      - name: Checkout vim-svelte\n        uses: actions/checkout@v2\n\n      - name: Checkout html5\n        uses: actions/checkout@v2\n        with:\n          repository: othree/html5.vim\n          path: html5.vim\n\n      - name: Checkout vader\n        uses: actions/checkout@v2\n        with:\n          repository: junegunn/vader.vim\n          path: vader.vim\n\n      - name: Checkout vim-javascript\n        uses: actions/checkout@v2\n        with:\n          repository: pangloss/vim-javascript\n          path: vim-javascript\n\n      - name: Test\n        run: vim --nofork --clean -u test/vimrc -c 'Vader! test/*.vader'\n"
  },
  {
    "path": ".gitignore",
    "content": "html5.vim\nvader.vim\nvim-javascript\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2022, Evan Lecklider\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "Makefile",
    "content": "test: html5.vim vader.vim vim-javascript\n\tvim --nofork --clean -u test/vimrc -c 'Vader! test/*.vader'\n.PHONY: test\n\nvader.vim:\n\tgit clone git@github.com:junegunn/vader.vim.git\n\nvim-javascript:\n\tgit clone git@github.com:pangloss/vim-javascript.git vim-javascript\n\nhtml5.vim:\n\tgit clone git@github.com:othree/html5.vim.git html5.vim\n\nclean:\n\trm -rf html5.vim vader.vim vim-javascript\n.PHONY: clean\n"
  },
  {
    "path": "README.md",
    "content": "# vim-svelte\n\n[![vim-svelte](https://github.com/evanleck/vim-svelte/actions/workflows/main.yml/badge.svg)](https://github.com/evanleck/vim-svelte/actions/workflows/main.yml)\n\nVim syntax highlighting and indentation for [Svelte 3][svelte] components.\n\nThis is mostly just HTML syntax highlighting with some keywords added and all\nexpressions inside of `{` and `}` highlighted as JavaScript.\n\nHighlighting includes:\n\n- HTML attributes with a colon like `on:click` or `transition:fade` highlighted\n    as `Keyword`.\n- `#if`, `/if`, `:else`, and `:else if` highlighted as `Conditional`.\n- `#await`, `/await`, `:catch`, `:then`, and `@html` highlighted as `Keyword`.\n- `#each` and `/each` highlighted as `Repeat`.\n\n\n## Dependencies\n\n1. [pangloss/vim-javascript][vim-javascript] for JavaScript syntax highlighting.\n2. [othree/html5.vim][html5-vim] for HTML indent.\n\nBoth of those dependencies are included in [sheerun/vim-polyglot][vim-polyglot]\nso if you're already using that then you should be set.\n\n\n## Installation\n\nThe simplest way to install vim-svelte is via a package manager like\n[Pathogen][pathogen], [Vundle][vundle], [NeoBundle][neobundle],\n[Plug][vim-plug], or [minpac][minpac].\n\nFor example, using minpac:\n\n```vimscript\ncall minpac#add('othree/html5.vim')\ncall minpac#add('pangloss/vim-javascript')\ncall minpac#add('evanleck/vim-svelte')\n```\n\nOr using Plug:\n\n```vimscript\nPlug 'othree/html5.vim'\nPlug 'pangloss/vim-javascript'\nPlug 'evanleck/vim-svelte', {'branch': 'main'}\n```\n\nvim-svelte works just fine with Vim 8's native package loading as well.\n\n\n## Options\n\nTo disable indentation within `<script>` and `<style>` tags, set one of these\nvariables in your `vimrc`:\n\n```vim\nlet g:svelte_indent_script = 0\nlet g:svelte_indent_style = 0\n```\n\n\n## Preprocessed languages\n\nSyntax highlighting for additional languages is supported, assuming you have a\ncorresponding syntax definition installed. For example, newer versions of Vim\nship with a TypeScript syntax definition, so you wouldn't need anything\nadditional installed for that to work. Supported languages include:\n\n- `less`\n- `scss`\n- `sass`\n- `stylus`\n- `typescript`\n\nSince Svelte doesn't support these out of the box (see\n[svelte-preprocess][preprocess] for how to set up some common language\npreprocessors with e.g. Rollup), they're all disabled by default so the first\nthing you'll need to do is enable your languages via the\n`g:svelte_preprocessors` variable:\n\n```vim\nlet g:svelte_preprocessors = ['typescript']\n```\n\nThen, use your language in your Svelte components like this:\n\n```html\n<script lang='typescript'>\n</script>\n\n<!-- Or... -->\n<style type='text/scss'>\n</style>\n```\n\n### Customizing the list of preprocessed languages\n\nIn addition to enabling the built-in preprocessors, you can add your own\npreprocessors that this plugin will detect using the\n`g:svelte_preprocessor_tags` variable. It should be a list of dictionaries with\nat least a `name` and a `tag` attribute. You can optionally include an `as`\nattribute which maps to the syntax you'd like to use within the tag.\n\nHere's an example:\n\n```vim\nlet g:svelte_preprocessor_tags = [\n  \\ { 'name': 'postcss', 'tag': 'style', 'as': 'scss' }\n  \\ ]\n\" You still need to enable these preprocessors as well.\nlet g:svelte_preprocessors = ['postcss']\n```\n\nThis would highlight `<style type=\"postcss\">` contents as `scss`, useful if you\nuse something like [postcss-nested][nested].\n\nYou can also create shorthand names if, for example, writing out\n`lang='typescript'` takes too long:\n\n```vim\nlet g:svelte_preprocessor_tags = [\n  \\ { 'name': 'ts', 'tag': 'script', 'as': 'typescript' }\n  \\ ]\nlet g:svelte_preprocessors = ['ts']\n```\n\n<table>\n  <thead>\n    <tr>\n      <th>Field</th>\n      <th>Usage</th>\n      <th>Required</th>\n      <th>Default value</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td><code>name</code></td>\n      <td>\n        The value within the attribute <code>lang</code> or <code>type</code> on\n        the <code>tag</code> as well as the value to include in\n        <code>g:svelte_preprocessors</code>.\n      </td>\n      <td>Yes</td>\n      <td>None</td>\n    </tr>\n    <tr>\n      <td><code>tag</code></td>\n      <td>The HTML tag to target e.g. <code>script</code> or <code>style</code>.</td>\n      <td>Yes</td>\n      <td>None</td>\n    </tr>\n    <tr>\n      <td><code>as</code></td>\n      <td>The syntax name to use for highlighting.</td>\n      <td>No</td>\n      <td>The <code>name</code> attribute.</td>\n    </tr>\n  </tbody>\n</table>\n\nNote, that enabling and loading a lot of different syntax definitions can\nconsiderably degrade Vim's performance. Consider yourself warned.\n\n\n## Integrations\n\n- [ALE][ale]: vim-svelte should work out of the box with `eslint` and a few\n  other linters/fixers. PRs welcome if the one you want is missing.\n- [matchit.vim][matchit]: vim-svelte should work out of the box and allow moving\n  between HTML tags as well as flow control like `#if/:else//if`.\n- [Syntastic][syntastic]: vim-syntastic will work with javascript and html checkers, for example:\n  ```vim\n  let g:syntastic_svelte_checkers = ['javascript/eslint', 'html/htmlhint']\n  ```\n\n\n## Tests\n\nIndentation tests are provided and any contributions would be much appreciated.\nThey can be run with `make test` which will clone [vader.vim][vader] into the\ncurrent working directory and run the test suite.\n\n\n## Alternatives\n\n1. [burner/vim-svelte][burner]\n2. [leafOfTree/vim-svelte-plugin][leafOfTree]\n\n\n[ale]: https://github.com/dense-analysis/ale\n[burner]: https://github.com/burner/vim-svelte\n[html5-vim]: https://github.com/othree/html5.vim\n[leafOfTree]: https://github.com/leafOfTree/vim-svelte-plugin\n[matchit]: https://github.com/adelarsq/vim-matchit\n[minpac]: https://github.com/k-takata/minpac\n[neobundle]: https://github.com/Shougo/neobundle.vim\n[nested]: https://github.com/postcss/postcss-nested\n[pathogen]: https://github.com/tpope/vim-pathogen\n[preprocess]: https://github.com/sveltejs/svelte-preprocess\n[svelte]: https://svelte.dev\n[syntastic]: https://github.com/vim-syntastic/syntastic\n[vader]: https://github.com/junegunn/vader.vim\n[vim-javascript]: https://github.com/pangloss/vim-javascript\n[vim-plug]: https://github.com/junegunn/vim-plug\n[vim-polyglot]: https://github.com/sheerun/vim-polyglot\n[vundle]: https://github.com/VundleVim/Vundle.vim\n"
  },
  {
    "path": "ftdetect/svelte.vim",
    "content": "au BufRead,BufNewFile *.svelte setfiletype svelte\n"
  },
  {
    "path": "ftplugin/svelte.vim",
    "content": "\" Vim filetype plugin\n\" Language:   Svelte 3 (HTML/JavaScript)\n\" Author:     Evan Lecklider <evan@lecklider.com>\n\" Maintainer: Evan Lecklide <evan@lecklider.com>\n\" URL:        https://github.com/evanleck/vim-svelte\nif (exists('b:did_ftplugin'))\n  finish\nendif\nlet b:did_ftplugin = 1\n\n\" Matchit support\nif exists('loaded_matchit') && !exists('b:match_words')\n  let b:match_ignorecase = 0\n\n  \" In order:\n  \"\n  \" 1. Svelte control flow keywords.\n  \" 2. Parens.\n  \" 3-5. HTML tags pulled from Vim itself.\n  \"\n  \" https://github.com/vim/vim/blob/5259275347667a90fb88d8ea74331f88ad68edfc/runtime/ftplugin/html.vim#L29-L35\n  let b:match_words =\n        \\ '#\\%(if\\|await\\|each\\)\\>:\\:\\%(else\\|catch\\|then\\)\\>:\\/\\%(if\\|await\\|each\\)\\>,' .\n        \\ '{:},' .\n        \\ '<\\@<=[ou]l\\>[^>]*\\%(>\\|$\\):<\\@<=li\\>:<\\@<=/[ou]l>,' .\n        \\ '<\\@<=dl\\>[^>]*\\%(>\\|$\\):<\\@<=d[td]\\>:<\\@<=/dl>,' .\n        \\ '<\\@<=\\([^/][^ \\t>]*\\)[^>]*\\%(>\\|$\\):<\\@<=/\\1>'\nendif\n\n\" ALE fixing and linting.\nif exists('g:loaded_ale')\n  if !exists('b:ale_fixers')\n    let b:ale_fixers = ['eslint', 'prettier', 'prettier_standard']\n  endif\n\n  if !exists('b:ale_linter_aliases')\n    let b:ale_linter_aliases = ['css', 'javascript']\n  endif\n\n  if !exists('b:ale_linters')\n    let b:ale_linters = ['stylelint', 'eslint']\n  endif\nendif\n"
  },
  {
    "path": "indent/svelte.vim",
    "content": "\" Vim indent file\n\" Language:   Svelte 3 (HTML/JavaScript)\n\" Author:     Evan Lecklider <evan@lecklider.com>\n\" Maintainer: Evan Lecklide <evan@lecklider.com>\n\" URL:        https://github.com/evanleck/vim-svelte\n\nif exists(\"b:did_indent\")\n  finish\nendif\n\nif !exists('g:svelte_indent_script')\n  let g:svelte_indent_script = 1\nendif\n\nif !exists('g:svelte_indent_style')\n  let g:svelte_indent_style = 1\nendif\n\n\" Try to mirror Svelte's indent settings so the HTML indenting scripts match.\nif g:svelte_indent_script\n  let b:html_indent_script1 = \"inc\"\nelse\n  let b:html_indent_script1 = \"zero\"\nendif\n\nif g:svelte_indent_style\n  let b:html_indent_style1 = \"inc\"\nelse\n  let b:html_indent_style1 = \"zero\"\nendif\n\nruntime! indent/html.vim\nlet s:html_indent = &l:indentexpr\nunlet! b:did_indent\n\nlet b:did_indent = 1\n\nsetlocal indentexpr=GetSvelteIndent()\nsetlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],!^F,;,=:else,=:then,=:catch,=/if,=/each,=/await\n\n\" Only define the function once.\nif exists('*GetSvelteIndent')\n  finish\nendif\n\nfunction! GetSvelteIndent()\n  let current_line_number = v:lnum\n\n  if current_line_number == 0\n    return 0\n  endif\n\n  let current_line = getline(current_line_number)\n\n  \" Opening script and style tags should be all the way outdented.\n  if current_line =~ '^\\s*</\\?\\(script\\|style\\)'\n    return 0\n  endif\n\n  let previous_line_number = prevnonblank(current_line_number - 1)\n  let previous_line = getline(previous_line_number)\n  let previous_line_indent = indent(previous_line_number)\n\n  \" The inside of scripts an styles should be indented unless disabled.\n  if previous_line =~ '^\\s*<script'\n    if g:svelte_indent_script\n      return previous_line_indent + shiftwidth()\n    else\n      return previous_line_indent\n    endif\n  endif\n\n  if previous_line =~ '^\\s*<style'\n    if g:svelte_indent_style\n      return previous_line_indent + shiftwidth()\n    else\n      return previous_line_indent\n    endif\n  endif\n\n  execute \"let indent = \" . s:html_indent\n\n  \" For some reason, the HTML CSS indentation keeps indenting the next line over\n  \" and over after each style declaration.\n  if searchpair('<style>', '', '</style>', 'bW') && previous_line =~ ';$' && current_line !~ '}'\n    return previous_line_indent\n  endif\n\n  \" \"/await\" or \":catch\" or \":then\"\n  if current_line =~ '^\\s*{\\s*\\/await' || current_line =~ '^\\s*{\\s*:\\(catch\\|then\\)'\n    let await_start = searchpair('{\\s*#await\\>', '', '{\\s*\\/await\\>', 'bW')\n\n    if await_start\n      return indent(await_start)\n    endif\n  endif\n\n  \" \"/each\"\n  if current_line =~ '^\\s*{\\s*\\/each'\n    let each_start = searchpair('{\\s*#each\\>', '', '{\\s*\\/each\\>', 'bW')\n\n    if each_start\n      return indent(each_start)\n    endif\n  endif\n\n  \" \"/if\"\n  if current_line =~ '^\\s*{\\s*\\/if'\n    let if_start = searchpair('{\\s*#if\\>', '', '{\\s*\\/if\\>', 'bW')\n\n    if if_start\n      return indent(if_start)\n    endif\n  endif\n\n  \" \":else\" is tricky because it can match an opening \"#each\" _or_ an opening\n  \" \"#if\", so we try to be smart and look for the closest of the two.\n  if current_line =~ '^\\s*{\\s*:else'\n    let if_start = searchpair('{\\s*#if\\>', '', '{\\s*\\/if\\>', 'bW')\n\n    \" If it's an \"else if\" then we know to look for an \"#if\"\n    if current_line =~ '^\\s*{\\s*:else if' && if_start\n      return indent(if_start)\n    else\n      \" The greater line number will be closer to the cursor position because\n      \" we're searching backward.\n      return indent(max([if_start, searchpair('{\\s*#each\\>', '', '{\\s*\\/each\\>', 'bW')]))\n    endif\n  endif\n\n  \" \"#if\" or \"#each\"\n  if previous_line =~ '^\\s*{\\s*#\\(if\\|each\\|await\\)'\n    return previous_line_indent + shiftwidth()\n  endif\n\n  \" \":else\" or \":then\"\n  if previous_line =~ '^\\s*{\\s*:\\(else\\|catch\\|then\\)'\n    return previous_line_indent + shiftwidth()\n  endif\n\n  \" Custom element juggling for abnormal self-closing tags (<Widget />),\n  \" capitalized component tags (<Widget></Widget>), and custom svelte tags\n  \" (<svelte:head></svelte:head>).\n  if synID(previous_line_number, match(previous_line, '\\S') + 1, 0) == hlID('htmlTag')\n        \\ && synID(current_line_number, match(current_line, '\\S') + 1, 0) != hlID('htmlEndTag')\n    let indents_match = indent == previous_line_indent\n    let previous_closes = previous_line =~ '/>$'\n\n    if indents_match && !previous_closes && previous_line =~ '<\\(\\u\\|\\l\\+:\\l\\+\\)'\n      return previous_line_indent + shiftwidth()\n    elseif !indents_match && previous_closes\n      return previous_line_indent\n    endif\n  endif\n\n  return indent\nendfunction\n"
  },
  {
    "path": "syntax/svelte.vim",
    "content": "\" Vim syntax file\n\" Language:   Svelte 3 (HTML/JavaScript)\n\" Author:     Evan Lecklider <evan@lecklider.com>\n\" Maintainer: Evan Lecklide <evan@lecklider.com>\n\" Depends:    pangloss/vim-javascript\n\" URL:        https://github.com/evanleck/vim-svelte\n\"\n\" Like vim-jsx, this depends on the pangloss/vim-javascript syntax package (and\n\" is tested against it exclusively). If you're using vim-polyglot, then you're\n\" all set.\n\nif exists(\"b:current_syntax\")\n  finish\nendif\n\n\" Read HTML to begin with.\nruntime! syntax/html.vim\nunlet! b:current_syntax\n\n\" Expand HTML tag names to include mixed case, periods, and colons.\nsyntax match htmlTagName contained \"\\<[a-zA-Z:\\.]*\\>\"\n\n\" Special attributes that include some kind of binding e.g. \"on:click\",\n\" \"bind:something\", etc.\nsyntax match svelteKeyword \"\\<[a-z]\\+:[a-zA-Z|]\\+=\" contained containedin=htmlTag\n\n\" The \"slot\" attribute has special meaning.\nsyntax keyword svelteKeyword slot contained containedin=htmlTag\n\n\" According to vim-jsx, you can let jsBlock take care of ending the region.\n\"   https://github.com/mxw/vim-jsx/blob/master/after/syntax/jsx.vim\nsyntax region svelteExpression start=\"{\" end=\"\" contains=javaScriptEmbed,jsBlock,javascriptBlock containedin=htmlString,htmlTag,htmlArg,htmlValue,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlHead,htmlTitle,htmlBoldItalicUnderline,htmlUnderlineBold,htmlUnderlineItalicBold,htmlUnderlineBoldItalic,htmlItalicUnderline,htmlItalicBold,htmlItalicBoldUnderline,htmlItalicUnderlineBold,htmlLink,htmlLeadingSpace,htmlBold,htmlBoldUnderline,htmlBoldItalic,htmlBoldUnderlineItalic,htmlUnderline,htmlUnderlineItalic,htmlItalic,htmlStrike,javaScript\n\n\" Block conditionals.\nsyntax match svelteConditional \"#if\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteConditional \"/if\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteConditional \":else if\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteConditional \":else\" contained containedin=jsBlock,javascriptBlock\n\n\" Block keywords.\nsyntax match svelteKeyword \"#await\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteKeyword \"/await\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteKeyword \":catch\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteKeyword \":then\" contained containedin=jsBlock,javascriptBlock\n\n\" Inline keywords.\nsyntax match svelteKeyword \"@html\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteKeyword \"@debug\" contained containedin=jsBlock,javascriptBlock\n\n\" Repeat functions.\nsyntax match svelteRepeat \"#each\" contained containedin=jsBlock,javascriptBlock\nsyntax match svelteRepeat \"/each\" contained containedin=jsBlock,javascriptBlock\n\nhighlight def link svelteConditional Conditional\nhighlight def link svelteKeyword Keyword\nhighlight def link svelteRepeat Repeat\n\n\" Preprocessed languages that aren't supported out of the box by Svelte require\n\" additional syntax files to be pulled in and can slow Vim down a bit. For that\n\" reason, preprocessed languages must be enabled manually. Note that some may\n\" require additional plugins that contain the actual syntax definitions.\n\"\n\" Heavily cribbed from https://github.com/posva/vim-vue and largely completed by\n\" @davidroeca (thank you!).\n\n\" A syntax should be registered if there's a valid syntax definition known to\n\" Vim and it is enabled for the Svelte plugin.\nfunction! s:enabled(language)\n  \" Check whether a syntax file for {language} exists\n  let s:syntax_name = get(a:language, 'as', a:language.name)\n  if empty(globpath(&runtimepath, 'syntax/' . s:syntax_name . '.vim'))\n    return 0\n  endif\n\n  \" If g:svelte_preprocessors is set, check for it there, otherwise return 0.\n  if exists('g:svelte_preprocessors') && type(g:svelte_preprocessors) == v:t_list\n    return index(g:svelte_preprocessors, a:language.name) != -1\n  else\n    return 0\n  endif\nendfunction\n\n\" Default tag definitions.\nlet s:languages = [\n      \\ { 'name': 'less', 'tag': 'style' },\n      \\ { 'name': 'scss', 'tag': 'style' },\n      \\ { 'name': 'sass', 'tag': 'style' },\n      \\ { 'name': 'stylus', 'tag': 'style' },\n      \\ { 'name': 'typescript', 'tag': 'script' },\n      \\ ]\n\n\" Add global tag definitions to our defaults.\nif exists('g:svelte_preprocessor_tags') && type(g:svelte_preprocessor_tags) == v:t_list\n  let s:languages += g:svelte_preprocessor_tags\nendif\n\nfor s:language in s:languages\n  let s:attr = '\\(lang\\|type\\)=\\(\"\\|''\\)[^\\2]*' . s:language.name . '[^\\2]*\\2'\n  let s:start = '<' . s:language.tag . '\\>\\_[^>]*' . s:attr . '\\_[^>]*>'\n\n  if s:enabled(s:language)\n    execute 'syntax include @' . s:language.name . ' syntax/' . get(s:language, 'as', s:language.name) . '.vim'\n    unlet! b:current_syntax\n\n    execute 'syntax region svelte_' . s:language.name\n          \\ 'keepend'\n          \\ 'start=/' . s:start . '/'\n          \\ 'end=\"</' . s:language.tag . '>\"me=s-1'\n          \\ 'contains=@' . s:language.name . ',svelteSurroundingTag'\n          \\ 'fold'\n  endif\nendfor\n\nsyntax region svelteSurroundingTag contained start=+<\\(script\\|style\\|template\\)+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent\n\n\" Cybernetically enhanced web apps.\nlet b:current_syntax = \"svelte\"\n\n\" Sync from start because of the wacky nesting.\nsyntax sync fromstart\n"
  },
  {
    "path": "test/indent.vader",
    "content": "Given svelte (an open tag right after a close tag):\n  {#if something}\n    {/if}\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (matching indentation of the opening and closing tags):\n  {#if something}\n  {/if}\n\n\nGiven svelte (a svelte: tag):\n  <svelte:head>\n    <title>Foo</title>\n    </svelte:head>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (an indented svelte: tag):\n  <svelte:head>\n    <title>Foo</title>\n  </svelte:head>\n\n\nGiven svelte (a sequence of self-closing tags):\n  <Foo/>\n    <Foo {bar}/>\n      <Foo bar={bar}/>\n    <Foo bar=\"{bar}\"/>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (an indented sequence of self-closing tags):\n  <Foo/>\n  <Foo {bar}/>\n  <Foo bar={bar}/>\n  <Foo bar=\"{bar}\"/>\n\n\nGiven svelte (a mix of self-closing and normal custom tags):\n  <Foo>\n  <Bar/>\n  </Foo>\n  <Foo>\n      <Bar />\n  </Foo>\n  <Foo>\n  <Bar></Bar>\n  </Foo>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (an indented mix of self-closing and normal custom tags):\n  <Foo>\n    <Bar/>\n  </Foo>\n  <Foo>\n    <Bar />\n  </Foo>\n  <Foo>\n    <Bar></Bar>\n  </Foo>\n\n\nGiven svelte (a combination of normal and capitalize tags):\n  <Foo>\n    <Bar>\n      <Baz />\n      </Bar>\n    </Foo>\n  <Foo>\n  <div>\n      <Baz />\n      </div>\n    </Foo>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (indented block):\n  <Foo>\n    <Bar>\n      <Baz />\n    </Bar>\n  </Foo>\n  <Foo>\n    <div>\n      <Baz />\n    </div>\n  </Foo>\n\n\nGiven svelte (namespaced tags):\n  <Widget.Foo>\n  <div>\n      <Baz />\n      </div>\n    </Widget.Foo>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (indented block):\n  <Widget.Foo>\n    <div>\n      <Baz />\n    </div>\n  </Widget.Foo>\n\n\nGiven svelte (outdented style tag):\n  <style>\n  .foo {\n        bar: 1;\n    }\n  </style>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (indented style tag):\n  <style>\n    .foo {\n      bar: 1;\n    }\n  </style>\n\n\nGiven svelte (uneven script tag #1):\n  <script>\n  import { foo } from \"./stores.js\"\n\n    function bar() {\n        console.log('bar');\n      }\n  </script>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (indented script tag):\n  <script>\n    import { foo } from \"./stores.js\"\n\n    function bar() {\n      console.log('bar');\n    }\n  </script>\n\n\nGiven svelte (uneven script tag #2):\n  <script>\n    let name;\n      let text\n      let yes;\n\n      $: document.title = name;\n  </script>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (indented script tag):\n  <script>\n    let name;\n    let text\n    let yes;\n\n    $: document.title = name;\n  </script>\n\n\nExecute (turn off script indenting):\n  let g:svelte_indent_script = 0\n\nGiven svelte (an indented script tag):\n  <script>\n    import { foo } from \"./stores.js\"\n  </script>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (an outdented script tag):\n  <script>\n  import { foo } from \"./stores.js\"\n  </script>\n\nExecute (reset script indenting):\n  unlet g:svelte_indent_script\n\n\nExecute (turn off style indenting):\n  let g:svelte_indent_style = 0\n\nGiven svelte (an indented style tag):\n  <style>\n    .foo {\n      bar: 1;\n    }\n  </style>\n\nDo (indent the whole buffer):\n  gg=G\n\nExpect svelte (an outdented style tag):\n  <style>\n  .foo {\n    bar: 1;\n  }\n  </style>\n\nExecute (reset style indenting):\n  unlet g:svelte_indent_style\n"
  },
  {
    "path": "test/vimrc",
    "content": "set nocompatible\n\nfiletype off\n\nset runtimepath^=html5.vim\nset runtimepath^=vader.vim\nset runtimepath^=vim-javascript\nset runtimepath^=.\n\nset expandtab\nset shiftwidth=2\nset softtabstop=2\nset tabstop=2\n\nfiletype plugin indent on\nsyntax enable\n"
  }
]