summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeLibertineGamer <zlg@zelibertinegamer.me>2016-06-16 10:21:59 -0700
committerZeLibertineGamer <zlg@zelibertinegamer.me>2016-06-16 10:21:59 -0700
commit20cb01f2bace954883264002ae31849c9176ee55 (patch)
tree3a8dd54b66638940f1c1accb65780a579fb2fce0
parentEnsure trailing spaces are always highlighted (diff)
downloadvimrc-20cb01f2bace954883264002ae31849c9176ee55.tar.gz
vimrc-20cb01f2bace954883264002ae31849c9176ee55.tar.bz2
vimrc-20cb01f2bace954883264002ae31849c9176ee55.tar.xz
vimrc-20cb01f2bace954883264002ae31849c9176ee55.zip
Correct foldtext function
No clue why it didn't take indent into account before...
-rw-r--r--vimrc6
1 files changed, 4 insertions, 2 deletions
diff --git a/vimrc b/vimrc
index 059fee7..65dc4c1 100644
--- a/vimrc
+++ b/vimrc
@@ -69,11 +69,13 @@ set foldmethod=expr
set foldtext=MyFoldText()
function! MyFoldText()
- let line = getline(v:foldstart)
+ let indent = repeat(' ', indent(v:foldstart))
+ let line = substitute(getline(v:foldstart), '\v^\s+', '', '')
let folded_lines = v:foldend - v:foldstart
- return line . ' (' . folded_lines . 'L)'
+ return indent . line . ' (' . folded_lines . 'L)'
endfunction
+
" Autocommands {{{1
if has("autocmd")
filetype plugin indent on