Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex
In directory sc8-pr-cvs1:/tmp/cvs-serv2795
Modified Files:
smartspace.vim
Log Message:
Bug: Ulrich Spoerlein reports that, when we press <space> after the
following line:
$aaaaaaaaaaaaaaaaaa.........$
^
line starts here. There is a space before the leading $
Then smartspace makes vim go into an infinite loop.
Fix: Instead of trying to see if the first character of the line is '$',
check if the first non blank character is a '$'. This seems a little
like a temporary fix though..
Index: smartspace.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/smartspace.vim,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** smartspace.vim 22 Dec 2002 03:15:44 -0000 1.3
--- smartspace.vim 3 Jan 2003 23:08:13 -0000 1.4
***************
*** 3,7 ****
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Sat Dec 21 07:00 PM 2002 PST
"
" Description:
--- 3,7 ----
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Fri Jan 03 03:00 PM 2003 PST
"
" Description:
***************
*** 47,51 ****
" }}}
function! s:TexFormatLine(width) " {{{
! let first = strpart(getline(line(".")),0,1)
normal! $
let length = col(".")
--- 47,52 ----
" }}}
function! s:TexFormatLine(width) " {{{
! " get the first non-blank character.
! let first = matchstr(getline('.'), '\S')
normal! $
let length = col(".")
***************
*** 53,57 ****
while length > a:width+2 && go
let between = 0
! let string = strpart(getline(line(".")),0,a:width)
" Count the dollar signs
let number_of_dollars = 0
--- 54,58 ----
while length > a:width+2 && go
let between = 0
! let string = strpart(getline('.'), 0, a:width)
" Count the dollar signs
let number_of_dollars = 0
***************
*** 73,77 ****
" Then you are between dollars.
normal! F$
! if col(".") == 1 || strpart(getline(line(".")),col(".")-1,1) != "$"
let go = 0
endif
--- 74,78 ----
" Then you are between dollars.
normal! F$
! if col(".") == 1 || getline('.')[col(".")-1] != "$"
let go = 0
endif
***************
*** 81,85 ****
else
exe "normal! i\<CR>\<Esc>$"
! let first = strpart(getline(line(".")),0,1)
endif
let length = col(".")
--- 82,87 ----
else
exe "normal! i\<CR>\<Esc>$"
! " get the first non-blank character.
! let first = matchstr(getline('.'), '\S')
endif
let length = col(".")
|