On Friday, October 5, 2012 10:36:20 AM UTC-5, So8res wrote:
> 1. Add a function that returns the indent level that the user desires. 
> (Basically exposes get_sw_value() to the user.)*
> 
> 
> 
> 2. Modify the existing ftplugins to use indent() instead of &shiftwidth. 
> Should be pretty easy with awk, s/(&(?:sw|shiftwidth))/indent()/.
> 
> 
> 
> 3. Post a patch.
> 
> 
> 
> * We can either modify the indent() function to return the shift unit when 
> given no params (patch below) or create a new function (shiftwidth()?). 
> Thoughts?
> 
> 
> 
> Attached is a patch that implements the first option. I've done cursory tests 
> but obviously not conclusive ones for all indent file changes. Should be 
> pretty easy to implement a different option, for those who care a quick perl 
> script to fix things up is:
> 
> 
> 
> ยป find runtime/ -type f | xargs perl -pi -e 
> 's/(&(sw|shiftwidth))/<FUNCTION_NAME>()/g'
> 
> 
> 
> (Is there a way to access the value of &sw without using the & sign? If not 
> then this should be a pretty surefire way to fix things.)
> 

getbufvar, getwinvar, gettabwinvar functions can be used, and those will use 
the & sign, but replacing it in this case would cause the script to break.

Also some scripts might use &sw to SET the value (unlikely in the official 
runtime but possible).

So you'll need to review your changes before submitting them.

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui