Yakov Lerner wrote: > cnoremap <expr><enter> (getcmdtype()=='/' ? "\n:redraw" : "\n") > > I am intercepring the <enter> in the /pattern search. > > When search is found, it works. E.g., type /.<enter>, and you see :redraw > as a sign that mapping worked. > > But when search was not found, this mapping does not work. > Why ? Type /xyzxyz<enter>, and :redraw does not appear. Why ?
The "\n" that executes the search will result in an error. This error will clear the typeahead, thus ":redraw" is gone. -- >From "know your smileys": :-H Is missing teeth /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///