On 17:24 Thu 19 Apr     , Marcin Szamotulski wrote:
> Hello,
> 
> In my ftplugin for tex files there is a script for indentation. It sets the
> variable b:did_indent in the usual form. The problem is that even though
> b:did_indent is set to 1 the /usr/share/vim/vim73/indent/tex.vim file doesn't
> see it and it is also executed. Since the system indent/tex.vim is sourced
> after my indentation script (as revealed by the output of :scriptnames) it
> overwrites my script setting ('indentexpr').
> 
> At the very beginning of both scripts I added:
> let g:{variable_name} = (exists("b:did_indent") ? 'INDENT EXISTS' : 'INDENT 
> DOES NOT EXISTS') . ' for ' . expand('%:p')
> 
> with two different variable names local_indent (in my script) and vim_indent
> (in the vim script). After opening a tex file both variables are set to:
> 
> 'INDENT DOES NOT EXISTS for /tmp/n.tex' 
> 
> Can someone advise me what's going on?
> 
> Best,
> Marcin

The following patch to indent.vim fixes the issue.

Best regards,
Marcin

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 161d01cbb165 runtime/indent.vim
--- a/runtime/indent.vim        Fri Apr 13 23:04:47 2012 +0200
+++ b/runtime/indent.vim        Fri Apr 20 06:16:18 2012 +0100
@@ -18,7 +18,7 @@
     let s = expand("<amatch>")
     if s != ""
       if exists("b:did_indent")
-       unlet b:did_indent
+       return
       endif
 
       " When there is a dot it is used to separate filetype names.  Thus for

Reply via email to