A new version is available, to try: - Download the below file and put it in your autoload directory: http://haridara.googlepages.com/forms.vim - Start a fresh Vim session and execute: :call forms#demo()
The new version has support for listening to changes in the field values. The demo can now automatically lookup city and state when you fill in your zipcode using a webservice (you need wget in the path and need Internet connection). On Tue, 3 Oct 2006 at 11:59am, Mikolaj Machowski wrote: > > Do arrows work like j and k outside form? Since I am mapping <Up> and > > <Down> keys, as long as they work outside form, I am assuming they > > shoudl work inside form also. > > No. They are inserting some version of keycode: OA, OB, OC, OD. In gui > everything works well. In menus enabled Doesn't that just mean your term is not properly setup? I tried it on win32 console vim and it worked just fine. > Bug: When completely remove value, leave field and later return > to it default value is forgotten, Esc is going to Normal mode. This is not a bug. When you leave the field, the value is immediately saved, which means the new empty value overwrote the old value. When you return back to the field, this empty value becomes your new default value. > Bug: Form is creating swap file which makes hard to use simultaneously > the same form in various Vims when editing files in the same directory. > Solution: Add 'setl noswapfile' after 'setl nomodified' in SetupBuf > function (this is local option and but it is easier to read when > explicitly declaring as local). This is really not a bug. Since the user is creating the buffer, it is his responsibility to set noswapfile if he is intending to open the same form multiple times. We could set noswapfile in forms, but then if the Vim crashes in the middle of the form entry, the user could loose some important data :) > Wish: different highlighting of <> in drop-down menu (State) and > combobox (Country). Maybe use {} somewhere? Makes sense, I took a note in the TODO. > I looked in the code: you are making just difference between editable > and non-editable combobox. IMO would be better to split this in two > widgets: combobox and dropdown menu. With that you will be able to make > visual differences between those two items (highlighting, braces). I don't know if this is more intuitive, but I know Java Swing/AWT framework (the only GUI framework that I am familiar with) doesn't have separate widgets. > Good thing would be possibility to scale height of buffer to height of > form and width [1]. Usually when filling you want to check context. Also > in space preserving department: header is 3 lines high. First - empty > line should go to /dev/null; second - value of separator is doubtful > when highlighting works. > > [1] User may want to split window vertically. Maybe full buffer > management isn't required but some elements for making it easier to user > would be good: eg. length and width of form. > > This is complete addition to beginning SetupBuf:: > > setl noswapfile > let formheight = len(b:curForm.fields) + 3 > exe "normal! ".formheight."\<C-W>_" > let formwidth = b:curForm.maxLblSize * 2 > exe "normal! ".formwidth."\<C-W>|" We have to be careful in doing this. E.g., if you change the height while there is only one window, Vim will behave strangely. I don't know if there is any similar side effect of changing the width when there is only one window. Again, since user is creating the window for now I think we should leave this to the user. When buffer management is implemented in forms, we can set these parameters. > Unfortunately it goes wild when form will be opened in vertical > window... What do you mean? > > > Are you interested to use the forms for any of your plugins or are you > > just helping me out? :) (in either case, many thanks). > > I have idea where I would like to use it but at the moment it is rather > vague (tag form for HTML/XML editing). At the moment I want to have > something good in tool-box (new screwdriver syndrome ;) I get several such urges and try to control myself. :) E.g., I created a softtabstop plugin to allow setting tabs at arbitrary locations (just like a word processor), just for the fun of it and because I needed it once. However, after I finished it a few weeks back, I didn't need to use it even once. :)) -- Thanks, Hari __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com