Hi,

rameo wrote:
> 
> I still have to click on "n" to highlight the found items.
> Did I do something wrong?

it seems, "n" does not reactivate the highlighting either if called
inside a function.

How do you call this function? If you do this from a mapping, you can
simply append

  n

at the end. In this case you might have to put calls to inputsave() and
inputrestore() around the three calls to inputdialog().

Or you can rewrite the function to return a string containing a command
and ":execute" this string:

  fun! s:searchcollines()
    if !exists("g:from_column")
      let g:from_column = "Search from column:"
    endif
    if !exists("g:to_column")
      let g:to_column = "Search to column:"
    endif
    if !exists("g:search_column")
      let g:search_column = "Search:"
    endif
    let f = inputdialog(g:from_column)
    let g = inputdialog(g:to_column)
    let s = inputdialog(g:search_column)
    if f != "" && g != "" && s != ""
      let @/ =  "\\%>".f."c\\%<".g."c".s
      return 'normal n'
    else
      return ''
    endif
  endfun

  :exe s:searchcollines()

Regards,
Jürgen


-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

-- 
You received this message from the "vim_use" 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

Reply via email to