Re: VimL functions to determine spelling categories?
- On Fri, 29 Jun 2012, Marc Weber wrote:
> Excerpts from Benjamin R. Haskell's message of Thu Jun 28 19:35:19 +0200 2012:So, it's a side-effect. It'd be better if there were a side-effect-free
>> Unfortunately, spellbadword() can change the cursor position.
version of the function. Plus the function combines two separate, but
related, tasks pertaining to the misspelled word under the cursor (if it
1. Move the cursor to the start of the word
2. Return information about the misspelling (the word and the type)
It'd be preferable if the function returned information about the
misspelled word, but that the information would also include its
location. Then setpos() could be used for functionality #1.
> useThe version I posted (based on Ingo Karkat's SpellCheck plugin) saved
> let save_cursor = getpos(".")
> call setpos('.', save_cursor)
the view, not just the cursor position. By only saving the cursor
position, the function that moves the cursor around might also alter
folds or the viewport (for example).
> to set cursor to old position. Not perfect - but fine.My point in calling it unfortunate wasn't to say that it's impossible
> A second way is use sp to create a new window, move cursor there, then
> :q the split window again.
(or even that hard) to workaround. It just would have been nicer to
find an API similar to :synID (which takes a (line,col)-position as
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