Playing with something recently, I discovered that ]s doesn't seem to throw any sort of error when wrapscan is off and it hits the end of the file. To demonstrate with the following setup (where {one,two,three}.txt are some files with a couple misspelled words scattered throughout each) $ vim one.txt two.txt three.txt :set hidden nowrapscan I then repeatedly issued :try | exec 'norm ]s' | catch | n | endtry (using @: then subsequently @@ makes this easy) which worked for finding all the misspelled words in the *first* file, but after finding the last one in that file, the ]s *should* fail because there is no "next" bad-spelling in the current file and wrapscan is off. So it seems like the ]s *should* have thrown an exception, get caught, and then go to the :next file instead where the process can repeat. But it seems to silently swallow the "no more bad spellings in the current file" without letting me catch the condition. AFAICT there's no :spellnext type ex command or spellnext() function corresponding to ]s that might be more error-cooperative. Is there a better way to go about this? -tim -- -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_use/arFobflska4lvgtE%40thechases.com.
Monday, September 21, 2026
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment