Hi list,

* On 17 Mai 2006, Andreas Wagner wrote:
The problem persists both with another colorscheme (tried peachpuf, ps_color and without any) and with svn from an hour ago.

it seems I have gotten rid of it now. I've upgraded to vim7, but I don't think that this has much to do with it. I had a plugin -- Hugo Haas's uri-ref (script_id=76) -- which I had changed a little bit. Unlike vim63, vim7 complained about a missing endfunction. When I removed the plugin, the syntax highlighting problem went away.

I've attached the plugin, maybe if you're interested -- and more knowledgeable than I am -- you can find the cuplrit in it. I'm not sure that this has been the problem of the original poster either...

HTH,
Andreas


--
File not found. Should I fake it? (Y/N)

--
My Public PGP Keys:
1024 Bit DH/DSS: 0x869F81BA
768 Bit RSA:     0x1AD97BA5
" -------------------------------------------
" Commands for quoting URLs in emails
" Copyright (c) 2001-2004 Hugo Haas
" 2004-06-01 version
" I hereby put this code in the public domain.
" Documentation at: http://larve.net/people/hugo/2001/02/email-uri-refs/
" --------------------------------------------

" Abort if loaded already (added by Andreas Wagner on 20040712):
if exists('g:uriref_loaded')
    finish
endif
let g:uriref_loaded=1


" Insert a reference at the cursor position
function! InsertRef() abort
  let l:ref = input("Reference: ")
  call AskNumber()
  set paste
  if (col(".") == 1)
    execute "normal i[\<C-R>r]\<ESC>"
  else
    execute "normal a[\<C-R>r]\<ESC>"
  endif
  normal G
  ?^-- $
  execute "normal O  " . @r . ". " . ref . "\<ESC>`rf]"
  set nopaste
  let l:a = col(".")
  normal $
  let l:b = col(".")
  if ( l:a == l:b )
    startinsert!
  else
    normal `rf]l
    startinsert
  endif
endfuntion

" Convert <http://example.com> into a reference
function! ConvertToRef() abort
  call AskNumber()
  set paste
  execute "normal cf>[\<C-R>r]\<ESC>G"
  ?^-- $
  execute "normal O  \<ESC>"
  execute "normal a\<C-R>r. \<ESC>px0f.2 x`r"
  set nopaste
endfunction

" Ask a reference number
function! AskNumber() abort
  if !exists("b:refNumber")
    let b:refNumber = 0
    call FindRefHiNumber()
  endif
  let b:refNumber = b:refNumber + 1
  let l:number = input("Reference number (" . b:refNumber . "): ")
  if ( l:number != "" )
    let b:refNumber = l:number
  endif
  let @r = b:refNumber
endfunction

" Find the highest number in the text
function! FindRefHiNumber() abort
  normal 1G
  /^$
  let l:body = line(".")
  let l:cur = l:body + 1
  let l:found = 0
  let @/="\\[[0-9]\\+\\]"
  while ( l:cur <= line("$") )
    if (match(getline(l:cur), @/) != -1)
      let l:found = 1
      break
    endif
    let l:cur = l:cur + 1
  endwhile
  if ( l:found == 0 )
    let b:refNumber = 0
    normal `r
    return
  endif
  " Find the highest number
  normal n
  let l:l = line(".")
  let l:c = col(".")
  while (1)
    if ( line(".") > l:body )
      normal f]mqF[ly`qf]
      if ((@0 + 0) > b:refNumber)
        let b:refNumber = @0
      endif
      normal n
    endif
    if ( (line(".") < l:body) || ((l:l == line(".")) && (l:c == col("."))) ) 
      break
    endif
  endwhile
  normal `r
endfunction

imap <F5> <ESC>mr:call InsertRef()<CR>
nmap <F6> F<mr:call ConvertToRef()<CR>


" DrChip menu support (added by Andreas Wagner on 040603):
if has("gui_running") && has("menu")
 if !exists("g:DrChipTopLvlMenu")
"  let g:DrChipTopLvlMenu= "DrChip."
  let g:DrChipTopLvlMenu= "Plugin."
 endif
 exe 'menu '.g:DrChipTopLvlMenu.'uri-ref.insert<tab><F5>        InsertRef'
 exe 'menu '.g:DrChipTopLvlMenu.'uri-ref.convert<tab><F6>       ConvertToRef'
endif

Reply via email to