summaryrefslogtreecommitdiffstats
path: root/indent
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-10-04 21:17:06 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-10-04 21:17:06 +0200
commitb4868c7ea7b75dd09a6d172871c901905f5d539a (patch)
tree23f20821b10163083aa5c0b2016bce1db28ccc91 /indent
parentd221139bd70fd474be52237dc8e6440e6da632bd (diff)
downloadvim-polyglot-b4868c7ea7b75dd09a6d172871c901905f5d539a.tar.gz
vim-polyglot-b4868c7ea7b75dd09a6d172871c901905f5d539a.zip
Add comments for some extensions + test
Diffstat (limited to 'indent')
-rw-r--r--indent/graphql.vim7
1 files changed, 7 insertions, 0 deletions
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