Re: Regex performance - SoC

2007-05-02 Thread Asiri Rathnayake
On Tue, 2007-05-01 at 18:16 -0500, James Longstreet wrote:
 Hello,
 
 I'm wondering if any of the Summer of Code winners are tackling the  
 regex performance thing suggested here: http://www.vim.org/soc/ideas.php

Bram said two students are working on this, but you are welcome to help
them (i think). Nikolai too would help anyone with this.

 If anyone chose that project, I'll of course defer to them.  But if  
 no one's working on it, I might give it a shot, I think it'd be fun.

 Thanks,
 James Longstreet

- Asiri



patch 7.0.239

2007-05-02 Thread Bram Moolenaar

Patch 7.0.239
Problem:When using local directories and tab pages :mksession uses a
short file name when it shouldn't.  Window-local options from a
modeline may be applied to the wrong window. (Teemu Likonen)
Solution:   Add the did_lcd flag, use the full path when it's set.  Don't use
window-local options from the modeline when using the current
window for another buffer in :doautoall.
Files:  src/fileio.c,  src/ex_docmd.c


*** ../vim-7.0.238/src/fileio.c Tue Feb 27 16:51:07 2007
--- src/fileio.cTue May  1 22:35:34 2007
***
*** 8086,8092 
  
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap-arg, FALSE);
!   do_modelines(0);
  
/* restore the current window */
aucmd_restbuf(aco);
--- 8087,8096 
  
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap-arg, FALSE);
! 
!   /* Execute the modeline settings, but don't set window-local
!* options if we are using the current window for another buffer. */
!   do_modelines(aco.save_curwin == NULL ? OPT_NOWIN : 0);
  
/* restore the current window */
aucmd_restbuf(aco);
*** ../vim-7.0.238/src/ex_docmd.c   Tue Mar 27 16:57:54 2007
--- src/ex_docmd.c  Tue Mar 27 16:49:06 2007
***
*** 375,380 
--- 375,381 
  static intput_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned 
*flagp));
  static void   ex_loadview __ARGS((exarg_T *eap));
  static char_u *get_view_file __ARGS((int c));
+ static intdid_lcd;/* whether :lcd was produced for a session */
  #else
  # define ex_loadview  ex_ni
  #endif
***
*** 8573,8578 
--- 8574,8581 
  }
  
  #ifdef FEAT_SESSION
+ did_lcd = FALSE;
+ 
  /* :mkview or :mkview 9: generate file name with 'viewdir' */
  if (eap-cmdidx == CMD_mkview
 (*eap-arg == NUL
***
*** 10327,10332 
--- 10330,10336 
|| ses_put_fname(fd, wp-w_localdir, flagp) == FAIL
|| put_eol(fd) == FAIL)
return FAIL;
+   did_lcd = TRUE;
  }
  
  return OK;
***
*** 10384,10394 
  char_u*name;
  
  /* Use the short file name if the current directory is known at the time
!  * the session file will be sourced.  Don't do this for :mkview, we
!  * don't know the current directory. */
  if (buf-b_sfname != NULL
 flagp == ssop_flags
!(ssop_flags  (SSOP_CURDIR | SSOP_SESDIR)))
name = buf-b_sfname;
  else
name = buf-b_ffname;
--- 10388,10401 
  char_u*name;
  
  /* Use the short file name if the current directory is known at the time
!  * the session file will be sourced.
!  * Don't do this for :mkview, we don't know the current directory.
!  * Don't do this after :lcd, we don't keep track of what the current
!  * directory is. */
  if (buf-b_sfname != NULL
 flagp == ssop_flags
!(ssop_flags  (SSOP_CURDIR | SSOP_SESDIR))
!!did_lcd)
name = buf-b_sfname;
  else
name = buf-b_ffname;
*** ../vim-7.0.238/src/version.cTue May  1 22:06:41 2007
--- src/version.c   Tue May  1 23:21:32 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 239,
  /**/

-- 
Those who live by the sword get shot by those who don't.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Bug: windo and exceptions

2007-05-02 Thread Andy Wokula

GVim runs into an endless loop if I do the following:

clean startup
   :new  at least two windows
   :windo throw foo

   Error detected while processing :
   E605: Exception not caught: foo
   E605: Exception not caught: foo
   E605: Exception not caught: foo
   E605: Exception not caught: foo
   ...

Another example:

   clean startup
  :set modified
  :bot new
  :try
  :  windo enew

   - go and kill GVim in the task manager

(does not happen if  :bot new  is replaced by  :abo new )

--
Regards,
Andy

EOM


patch 7.0.240

2007-05-02 Thread Bram Moolenaar

Patch 7.0.240
Problem:Crash when splitting a window in the GUI. (opposite of 7.0.227)
Solution:   Don't call out_flush() from win_alloc().  Also avoid this for
win_delete().  Also block autocommands while the window structure
is invalid.
Files:  src/window.c


*** ../vim-7.0.239/src/window.c Thu Apr 26 16:11:47 2007
--- src/window.cTue May  1 19:23:22 2007
***
*** 722,727 
--- 722,733 
need_status = STATUS_HEIGHT;
  }
  
+ #ifdef FEAT_GUI
+ /* May be needed for the scrollbars that are going to change. */
+ if (gui.in_use)
+   out_flush();
+ #endif
+ 
  #ifdef FEAT_VERTSPLIT
  if (flags  WSP_VERT)
  {
***
*** 4071,4076 
--- 4077,4088 
  
  if (newwin != NULL)
  {
+ #ifdef FEAT_AUTOCMD
+   /* Don't execute autocommands while the window is not properly
+* initialized yet.  gui_create_scrollbar() may trigger a FocusGained
+* event. */
+   ++autocmd_block;
+ #endif
/*
 * link the window in the window list
 */
***
*** 4100,4106 
  #ifdef FEAT_GUI
if (gui.in_use)
{
-   out_flush();
gui_create_scrollbar(newwin-w_scrollbars[SBAR_LEFT],
SBAR_LEFT, newwin);
gui_create_scrollbar(newwin-w_scrollbars[SBAR_RIGHT],
--- 4112,4117 
***
*** 4114,4119 
--- 4125,4133 
  #ifdef FEAT_FOLDING
foldInitWin(newwin);
  #endif
+ #ifdef FEAT_AUTOCMD
+   --autocmd_block;
+ #endif
  }
  return newwin;
  }
***
*** 4130,4135 
--- 4144,4155 
  {
  int   i;
  
+ #ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while the window is halfway being deleted.
+  * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
+ ++autocmd_block;
+ #endif
+ 
  #ifdef FEAT_MZSCHEME
  mzscheme_window_free(wp);
  #endif
***
*** 4188,4193 
--- 4208,4217 
  
  win_remove(wp, tp);
  vim_free(wp);
+ 
+ #ifdef FEAT_AUTOCMD
+ --autocmd_block;
+ #endif
  }
  
  /*
*** ../vim-7.0.239/src/version.cTue May  1 23:22:32 2007
--- src/version.c   Wed May  2 21:51:10 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 240,
  /**/

-- 
Just remember...if the world didn't suck, we'd all fall off.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Regex performance - SoC

2007-05-02 Thread Bram Moolenaar

James -

 I'm wondering if any of the Summer of Code winners are tackling the  
 regex performance thing suggested here: http://www.vim.org/soc/ideas.php
 
 If anyone chose that project, I'll of course defer to them.  But if  
 no one's working on it, I might give it a shot, I think it'd be fun.

Yes, two students were selected to work on this.  Russ Cox volunteered
to mentor them.

- Bram

-- 
Bumper sticker: Honk if you love peace and quiet.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Bug: windo and exceptions

2007-05-02 Thread Bram Moolenaar

Andy Wokula wrote:

 GVim runs into an endless loop if I do the following:
 
  clean startup
 :new  at least two windows
 :windo throw foo
 
 Error detected while processing :
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 E605: Exception not caught: foo
 ...

See patch below.

 Another example:
 
 clean startup
:set modified
:bot new
:try
:  windo enew
 
 - go and kill GVim in the task manager
 
 (does not happen if  :bot new  is replaced by  :abo new )

Solved with the same patch.  Please verify.


*** ../vim-7.0.240/src/ex_cmds2.c   Tue Feb 13 06:21:24 2007
--- src/ex_cmds2.c  Wed May  2 22:04:38 2007
***
*** 2287,2292 
--- 2287,2294 
if (!win_valid(wp))
break;
win_goto(wp);
+   if (curwin != wp)
+   break;  /* something must be wrong */
wp = curwin-w_next;
}
else if (eap-cmdidx == CMD_tabdo)


-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


bug in java indentation

2007-05-02 Thread Tomas Golembiovsky
There seems to be a bug in java indentation. The maintainer (Cc'ed) is said
to be resigned, so I'm writing here. It is sort of special situation. Take
a look at the println() in the following:

public class Bug {
public static void main(String args[]) {
Foo.bar(new Baz() {
public void run() {
if (true) {
/*nothing here*/
}

while (true);
System.out.println(doh!);
}
});
}
}

And some findings - it indent's correctly if you:
 a) put the if .. { .. } on one line
 b) remove the if
 c) remove the while()
 d) add body to the while

--
Best regards,
Tomas Golembiovsky

--
||- - -
|
| Law of Algebra
| 
| You never catch on until after the test.
| 
|- - -


Re: Bug: windo and exceptions

2007-05-02 Thread Andy Wokula

Bram Moolenaar schrieb:

Andy Wokula wrote:


GVim runs into an endless loop if I do the following:

 clean startup
:new  at least two windows
:windo throw foo

Error detected while processing :
E605: Exception not caught: foo
E605: Exception not caught: foo
E605: Exception not caught: foo
E605: Exception not caught: foo
...


See patch below.


Another example:

clean startup
   :set modified
   :bot new
   :try
   :  windo enew

- go and kill GVim in the task manager

(does not happen if  :bot new  is replaced by  :abo new )


Solved with the same patch.  Please verify.


*** ../vim-7.0.240/src/ex_cmds2.c   Tue Feb 13 06:21:24 2007
--- src/ex_cmds2.c  Wed May  2 22:04:38 2007
***
*** 2287,2292 
--- 2287,2294 
if (!win_valid(wp))
break;
win_goto(wp);
+   if (curwin != wp)
+   break;  /* something must be wrong */
wp = curwin-w_next;
}
else if (eap-cmdidx == CMD_tabdo)


Great, the patch works (examples tested).

--
Thanks,
Andy

EOM