Bug? searchpair(), searchpairpos() and the 'b' and 'c' flags

2009-08-09 Fir de Conversatie Lech Lorens

Assume a C source file with the following contents:
1 int main()
2 {
3   printf(This is main().\n);
4   return 0;
5 }

Position the cursor at the closing brace in line 5, perform:
echo searchpair('{', '', '}', 'cn')
echo searchpairpos('{', '', '}', 'cn')

Output (as expected):
5,
[5, 1]

For the following commands I would expect the same result:
echo searchpair('{', '', '}', 'bcn')
echo searchpairpos('{', '', '}', 'bcn')

but I get:
0
[0, 0]

Is this a bug or is there a good explanation of such an inconsistency
in these behaviours?

-- 
Cheers,
Lech

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug? searchpair(), searchpairpos() and the 'b' and 'c' flags

2009-08-09 Fir de Conversatie Andy Wokula

Lech Lorens schrieb:
 Assume a C source file with the following contents:
 1 int main()
 2 {
 3 printf(This is main().\n);
 4 return 0;
 5 }
 
 Position the cursor at the closing brace in line 5, perform:
 echo searchpair('{', '', '}', 'cn')
 echo searchpairpos('{', '', '}', 'cn')
 
 Output (as expected):
 5,
 [5, 1]
 
 For the following commands I would expect the same result:
 echo searchpair('{', '', '}', 'bcn')
 echo searchpairpos('{', '', '}', 'bcn')
 
 but I get:
 0
 [0, 0]
 
 Is this a bug or is there a good explanation of such an inconsistency
 in these behaviours?

What's the deal with using the 'c' flag together with searchpair()?
You can just omit it.

-- 
Andy

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



]) bug?

2009-08-09 Fir de Conversatie Dimitar DIMITROV
Hi,

I think this is a bug. I hope it is just my version which is not recent enough 
but I didn't find anything on the FAQ.

While inside a string : (  cursor 
 )
[( and ]) won't work.

Without the presence of a .vimrc it doesn't happen.
Just after: touch .vimrc, the bug appears!

Dimitar Dimitrov

My version:

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 25 2009 17:43:03)
Included patches: 1-108  
Compiled by 'http://www.opensuse.org/'   
Huge version without GUI.  Features included (+) or not (-): 
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic 
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path  
+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand  
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap 
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte 
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript 
+printer +profile -python +quickfix +reltime +rightleft -ruby +scrollbind  
+signs +smartindent +sniff +statusline -sun_workshop +syntax +tag_binary   
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save
   system vimrc file: /etc/vimrc
 user vimrc file: $HOME/.vimrc
  user exrc file: $HOME/.exrc
  fall-back for $VIM: /etc
 f-b for $VIMRUNTIME: /usr/share/vim/current
Compilation:
gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=i586 -mtune=i686
-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe
-fno-strict-aliasing -fstack-protector-all
Linking: gcc   -L/usr/local/lib -o vim   -lm -lncurses -lacl



  
--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Bug? searchpair(), searchpairpos() and the 'b' and 'c' flags

2009-08-09 Fir de Conversatie Lech Lorens

2009/8/9 Andy Wokula anw...@yahoo.de:
 What's the deal with using the 'c' flag together with searchpair()?
 You can just omit it.

That's right. Contrary to the documentation it seems that this flag
has absolutely no effect on the result of the call. Or am I missing
something?

-- 
Cheers,
Lech

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Request: suppression of plugins

2009-08-09 Fir de Conversatie ron

There are a number of plugins loaded by vim on startup (in the runtime/
plugins directory).  Not everyone wants them to load all the time.

In order to suppress their loading, one must generally set a variable
specific to that plugin, which can only be known by perusing the
plugin itself.  Setting this variable must also be done prior to the
loading of the plugin.

I have a few suggestions to help with this:

1) All standard plugins supplied by vim should have a common method of
suppressing their loading.  That is, they should all have a common
variable name to suppress them.  For example, to suppress plugin x,
a variable g:plugin_x_loaded should be set or something.

2) Easier:  don't have the plugins load by default.   Move them to a
parallel extra directory, and then the person who wants to load x
can do runtime extras/x.vim in the vimrc

3) Harder: have the ScriptPre autocommand actually be useful.  Allow
the user to set a variable of some kind to tell vim to not continue
loading this script.

Each suggestion has pros and cons.  The ScriptPre is the only one
which would have no effect on existing instalations, so perhaps Bram
will prefer it to the others.  I personally prefer the second
suggestion, as in that case the user is in complete control over what
gets loaded.
--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---