From b4868c7ea7b75dd09a6d172871c901905f5d539a Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 4 Oct 2020 21:17:06 +0200 Subject: Add comments for some extensions + test --- indent/graphql.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indent/graphql.vim') diff --git a/indent/graphql.vim b/indent/graphql.vim index 3a910928..12204f5f 100644 --- a/indent/graphql.vim +++ b/indent/graphql.vim @@ -62,6 +62,13 @@ function GetGraphQLIndent() return 0 endif + " If the previous line isn't GraphQL, don't change this line's indentation. + " Assume we've been manually indented as part of a template string. + let l:stack = map(synstack(l:prevlnum, 1), "synIDattr(v:val, 'name')") + if get(l:stack, -1) !~# '^graphql' + return -1 + endif + let l:line = getline(v:lnum) " If this line contains just a closing bracket, find its matching opening -- cgit v1.2.3