Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pchampio
Copy link

@pchampio pchampio commented Nov 14, 2019

Fixes: #8

The side effect of this PR, is that /\<$SEARCH\ /?<$SEARCH\
will get echoed every time a loupe mapping gets called.
As this is the default neovim (and maybe vim) behavior + that it isn't
stated in https://github.com/wincent/loupe#overrides.
I don't thinks this change in behavior matters.
Having the search indices matches neovim defaults matters much more.

The side effect of this PR, is that `/\<$SEARCH\` `/?<$SEARCH\` 
will get echoed every time `n` or `N` are pressed. 
As this is the default neovim (and maybe vim) behavior + that it isn't 
stated in https://github.com/wincent/loupe#overrides. 
I don't thinks this change in behavior matters. 
Having the search indices matches neovim defaults.
@pchampio
Copy link
Author

@wincent friendly ping!

@pchampio
Copy link
Author

Friendly ping. Got any feedback on this PR? Thanks.

@wincent
Copy link
Owner

wincent commented Feb 11, 2020

The code seems fine @pchampio, but I am struggling to see what actually changes as a result of this PR, at least with the versions of Vim and Neovim that I am testing:

  • Vim 8.1 (patches 1-1300), :echo has('patch1270') returns 1.
  • NVIM v0.4.0-dev.

In Vim I don't see the search indices, in Neovim I do ([27/>99] etc). In both, I see the search string (eg. /\vfoo). I'm going to try updating and see if I notice anything different. What am I supposed to be seeing here?

@pchampio
Copy link
Author

pchampio commented Feb 13, 2020

What am I supposed to be seeing here?

  • You are supposed to see /\vfoo on both vim and nvim. (Added by this PR)
  • You are supposed to see the search indices in nvim. (Added by this PR)
  • You are supposed to see the search indices in vim if you have set the shortmess appropriately source. (set shortmess-=S) (Not added by this PR)

@wincent
Copy link
Owner

wincent commented Feb 13, 2020

My first tests were pretty pointless because I forgot that I had the Loupe mappings disabled like this in my .vimrc:

map <Nop><F1> <Plug>(LoupeN)
nmap <Nop><F2> <Plug>(Loupen)

Anyway, when I re-enable them, I can't seem to get this PR to work.

On Neovim (NVIM v0.5.0-5d5b068) I see the search indices, but they never update:

ScreenFlow

On Vim, I don't see the indices, except for a brief flash at the start (ie. if I type /foo, I see the index, but as soon as I hit n, it's gone, never to return) — that's with shortmess-=S.

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb  3 2020 01:40:36)
macOS version
Included patches: 1-200
Compiled by Homebrew

@pchampio
Copy link
Author

Using the following .vimrc file (and no additional bundle/autoload/plugin scrips):

" Leader Mappings
let mapleader = ","

" Add bundles
call plug#begin('/tmp/')

" searching
Plug 'pchampio/loupe'
map <leader><space> <Plug>(LoupeClearHighlight)

call plug#end()

On both vim and Neovim, I see the search indices, and they update.

NVIM v0.5.0-144-g568900806
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 12 2020 16:34:19)
Included patches: 1-246
Compiled by travis@travis-job-50a506dc-57e7-488b-99a4-8a2925ce0e55

I confirm that this PR was needed on neovim in order to have the search indices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include search indices

2 participants