[macvim] Work-in-progress patch for new events

2006-09-20 Thread Nicolas Weber

Hi everyone,

I'm currently writing a patch to port mac vim to carbon's "new" (os  
9? os x 10.0?) event model. This has the main advantage that the new  
event model provides standard handlers for a lot of stuff (window  
movement, ...) and makes further patches much easier to write.


In the next weeks I will be somewhat busy with Real Life (tm), so I  
post a work-in-progress patch if someone wants to play with it until  
I continue my work.


There are still some regressions in this patch (dialogs are not  
always painted correctly, dragging the mouse out of the window  
doesn't work, scrolling takes twice as much cpu%), but some stuff is  
already better (mainly life resizing). I don't recommend it for daily  
work just yet ;-)


I hope I can write some high level notes about the patch in the next  
few days...


Bye,
Nico



eventpatch.diff
Description: Binary data


Re: [vim-dev] Re: Keyword completion

2006-09-20 Thread Gautam Iyer
On Wed, Sep 20, 2006 at 10:41:58PM +0200, Martin Stubenschrott wrote:

> > Maybe this has been discussed already: When pressing Ctrl-P / Ctrl-N,
> > can we get vim to complete from the list of syntax keywords?
> 
> You can do that by setting:
> 
> :set omnifunc=syntaxcomplete#Complete
> 
> and then use 
> 
> You can also specifiy certain syntax groups too use, but look into the
> docs/scripts, how to do that.

Great! Thanks,

Gautam

-- 
'Common' Proof Techniques:
10. Proof by cumbersome notation -- Best done with access to at least
four alphabets and special symbols.


syntax bug. extend inside normal inside keepend

2006-09-20 Thread Ilya Bobir

Hello.

I've already posted about this bug in syntax matching code.  But now I 
have a fix.


Test case
=
Having following syntax rules

:syn cluster Top contains=Block,String,Identifier
:syn region Block start=+{+ end=+}+ keepend extend [EMAIL PROTECTED]
:syn region String start=+"+ end=+"+ contains=Identifier
:syn region Identifier start=+\${+ end=+}+ extend

and the following buffer is matched incorrectly

{ "string ${var} string" }

on current vim version (7.0.109) I'm getting following syntax groups:

{ "string ${var} string" }
BB
 SS   SS
 II

Where B means Block region, S - String region and I - Identifier region.

While I'm expecting to see the following picture:

{ "string ${var} string" }
BB
 SS
 II

Bug description
===
Bug appears, when one have an extend region inside a normal region 
inside a keepend region.  Currently, when any extend region ends vim 
checks all the outer keepend regions to see, if theirs ends should be 
"extended", but it does not checks intermediate normal (non keepend) 
regions and theirs ends should also be checked otherwise one could end 
up with a normal region been forcefully ended by enclosing keepend 
region and this keepend region later be extended by a containing extend 
region.


Just as it is seen in the first picture in the test case.  Block region 
ends String region on a first '}'.  But later when Identifier region 
consumes that first '}' Block region is extended, while String region is 
not.


Solution

Test intermediate normal region ends along with keepend region ends when 
an extend region ends.


Here is a patch for syntax.c that does this check.  I'm getting correct 
behavior with this patch for my test case.


--
Ilya Bobir
Index: syntax.c
===
RCS file: /cvsroot/vim/vim7/src/syntax.c,v
retrieving revision 1.62
diff -c -r1.62 syntax.c
*** syntax.c26 Apr 2006 23:58:59 -  1.62
--- syntax.c20 Sep 2006 20:58:12 -
***
*** 977,982 
--- 977,983 
  {
  stateitem_T   *cur_si;
  int   i;
+ int   seen_keepend;
  
  if (startofline)
  {
***
*** 1002,1008 
  /*
   * Need to update the end of a start/skip/end that continues from the
   * previous line.  And regions that have "keepend", because they may
!  * influence contained items.
   * Then check for items ending in column 0.
   */
  i = current_state.ga_len - 1;
--- 1003,1012 
  /*
   * Need to update the end of a start/skip/end that continues from the
   * previous line.  And regions that have "keepend", because they may
!  * influence contained items.  If we've just removed "extend" 
!  * (startofline == 0) then we should update ends of normal regions 
!  * contained inside "keepend" because "extend" could have extended 
!  * these "keepend" regions as well as contained normal regions. 
   * Then check for items ending in column 0.
   */
  i = current_state.ga_len - 1;
***
*** 1010,1019 
--- 1014,1026 
for ( ; i > keepend_level; --i)
if (CUR_STATE(i).si_flags & HL_EXTEND)
break;
+ 
+ seen_keepend = 0;
  for ( ; i < current_state.ga_len; ++i)
  {
cur_si = &CUR_STATE(i);
if ((cur_si->si_flags & HL_KEEPEND)
+   || (seen_keepend && !startofline)
|| (i == current_state.ga_len - 1 && startofline))
{
cur_si->si_h_startpos.col = 0;  /* start highl. in col 0 */
***
*** 1021,1026 
--- 1028,1036 
  
if (!(cur_si->si_flags & HL_MATCHCONT))
update_si_end(cur_si, (int)current_col, !startofline);
+ 
+   if(!startofline && (cur_si->si_flags & HL_KEEPEND))
+   seen_keepend = 1;
}
  }
  check_keepend();


Re: Keyword completion

2006-09-20 Thread Martin Stubenschrott
On Wed, Sep 20, 2006 at 01:33:54PM -0700, Gautam Iyer wrote:
> Maybe this has been discussed already: When pressing Ctrl-P / Ctrl-N,
> can we get vim to complete from the list of syntax keywords?

You can do that by setting:

:set omnifunc=syntaxcomplete#Complete

and then use 

You can also specifiy certain syntax groups too use, but look into the
docs/scripts, how to do that.

--
Martin


Keyword completion

2006-09-20 Thread Gautam Iyer
Hi All,

Maybe this has been discussed already: When pressing Ctrl-P / Ctrl-N,
can we get vim to complete from the list of syntax keywords?

Better still say from a specified group? Or does one have to write out
these keywords separately in a completion file?

Thanks,

GI

-- 
A hangover is the wrath of grapes.


vim bof audio available anyone ?

2006-09-20 Thread Christian MICHON

Hi vimmers,

I remember there was some audio recording of vim BOF/sane 2004.

Has anyone attended yesterday's BOF session with an audio
recording device ? It would be nice to hear it for those/us who
could not attend.

Thanks in advance
--
Christian