I have the following function and binding:

noremap <silent> g: <Esc>:set operatorfunc=<SID>get_command_mode_range<CR>g@

function! s:get_command_mode_range(type)
  let b = line("'[")
  let e = line("']")

  if b < e
    let range = '.,+' . (e - b)
  elseif b == e
    let range = '.'
  else
    let range = '.,+' . (b - e)
  endif

  call feedkeys(':' . range, 'n')
endfunction

If I start on the first line of the function, that is, "function!..."
and press g: followed by / and then searching for "endf" and pressing
enter, my command line will be

:.,+12

However, endfunction is actually on the thirteenth line after
function!, so the range should really be .,+13.  If i instead search
for "ndf" I get the correct result.

So it seems that there's something strange going on in what line is
being set for the ] mark when performing a search under these
conditions, coupled with patterns that match at the very beginning of
a line.

  nikolai

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui