From f052079b9b3715605da48db96c84590506f6dcce Mon Sep 17 00:00:00 2001 From: Emory Petermann Date: Sat, 13 Oct 2018 11:19:14 -0700 Subject: [PATCH] :bug: fix broken search function --- ftplugin/yaml.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ftplugin/yaml.vim b/ftplugin/yaml.vim index 81c7b8b..4c3b67f 100644 --- a/ftplugin/yaml.vim +++ b/ftplugin/yaml.vim @@ -4,6 +4,12 @@ " Maintainer: Einenlum " URL: https://github.com/Einenlum/yaml-revealer +function! GetIndentationStep() + call cursor(1,1) + call search('^\s') + return indent(".") +endfunction + function! KeyNotFound(keyName) echo "\n\"".a:keyName."\" not found." echo "\nThe correct syntax is: firstVar>secondVar>thirdVar" @@ -57,6 +63,7 @@ function! GetAncestors(line, indent) if(getline(a:line) !~ '^\s*$') " not an empty line return '' else + " sometimes there are newlines within a multiline key return GetAncestors(a:line-1, a:indent) " return ancestors of previous line endif endif