patch 7.0.225

2007-04-26 Thread Bram Moolenaar

Patch 7.0.225
Problem:When using setline() in an InsertEnter autocommand and doing A
the cursor ends up on the last byte in the line. (Yukihiro
Nakadaira)
Solution:   Only adjust the column when using setline() for the cursor line.
Move it back to the head byte if necessary.
Files:  src/eval.c, src/misc2.c


*** ../vim-7.0.224/src/eval.c   Tue Mar 27 16:57:54 2007
--- src/eval.c  Thu Apr 26 10:52:09 2007
***
*** 14397,14403 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}
--- 14411,14418 
if (u_savesub(lnum) == OK  ml_replace(lnum, line, TRUE) == OK)
{
changed_bytes(lnum, 0);
!   if (lnum == curwin-w_cursor.lnum)
!   check_cursor_col();
rettv-vval.v_number = 0;   /* OK */
}
}
*** ../vim-7.0.224/src/misc2.c  Tue Feb 20 03:18:20 2007
--- src/misc2.c Tue Mar 27 21:59:56 2007
***
*** 516,522 
--- 516,529 
|| virtual_active())
curwin-w_cursor.col = len;
else
+   {
curwin-w_cursor.col = len - 1;
+ #ifdef FEAT_MBYTE
+   /* prevent cursor from moving on the trail byte */
+   if (has_mbyte)
+   mb_adjust_cursor();
+ #endif
+   }
  }
  
  #ifdef FEAT_VIRTUALEDIT
*** ../vim-7.0.224/src/version.cTue Mar 27 16:57:54 2007
--- src/version.c   Thu Apr 26 10:53:33 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 225,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
14. You start introducing yourself as Jim at I-I-Net dot net dot au

 /// 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///


patch 7.0.226

2007-04-26 Thread Bram Moolenaar

Patch 7.0.226
Problem:Display flickering when updating signs through the netbeans
interface. (Xavier de Gaye)
Solution:   Remove the redraw_later(CLEAR) call.
Files:  src/netbeans.c


*** ../vim-7.0.225/src/netbeans.c   Tue Nov 14 18:29:00 2006
--- src/netbeans.c  Sat Apr 21 18:14:00 2007
***
*** 2143,2150 
coloncmd(:sign jump %d buffer=%d, serNum,
   buf-bufp-b_fnum);
}
-   /* XXX only redraw what changed. */
-   redraw_later(CLEAR);
  #endif
  /* =*/
}
--- 2143,2148 
*** ../vim-7.0.225/src/version.cThu Apr 26 10:55:46 2007
--- src/version.c   Thu Apr 26 11:00:01 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 226,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
15. Your heart races faster and beats irregularly each time you see a new WWW
site address in print or on TV, even though you've never had heart
problems before.

 /// 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///


patch 7.0.227

2007-04-26 Thread Bram Moolenaar

Patch 7.0.227
Problem:Crash when closing a window in the GUI. (Charles Campbell)
Solution:   Don't call out_flush() from win_free().
Files:  src/window.c


*** ../vim-7.0.226/src/window.c Sun Mar 11 15:53:27 2007
--- src/window.cWed Apr 18 22:31:52 2007
***
*** 2084,2089 
--- 2084,2096 
  }
  #endif
  
+ #ifdef FEAT_GUI
+ /* Avoid trouble with scrollbars that are going to be deleted in
+  * win_free(). */
+ if (gui.in_use)
+   out_flush();
+ #endif
+ 
  /*
   * Close the link to the buffer.
   */
***
*** 4174,4180 
  #ifdef FEAT_GUI
  if (gui.in_use)
  {
-   out_flush();
gui_mch_destroy_scrollbar(wp-w_scrollbars[SBAR_LEFT]);
gui_mch_destroy_scrollbar(wp-w_scrollbars[SBAR_RIGHT]);
  }
--- 4181,4186 
*** ../vim-7.0.226/src/version.cThu Apr 26 11:01:16 2007
--- src/version.c   Thu Apr 26 16:09:30 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 227,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
you don't have a clue when it happened.

 /// 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///


patch 7.0.228

2007-04-26 Thread Bram Moolenaar

Patch 7.0.228
Problem:Cygwin: problem with symlink to DOS style path.
Solution:   Invoke cygwin_conv_to_posix_path(). (Luca Masini)
Files:  src/os_unix.c


*** ../vim-7.0.227/src/os_unix.cTue Mar  6 20:27:03 2007
--- src/os_unix.c   Mon Apr 23 22:27:16 2007
***
*** 55,60 
--- 55,66 
  # endif
  #endif
  
+ #ifdef __CYGWIN__
+ # ifndef WIN32
+ #  include sys/cygwin.h /* for cygwin_conv_to_posix_path() */
+ # endif
+ #endif
+ 
  #if defined(HAVE_SELECT)
  extern int   select __ARGS((int, fd_set *, fd_set *, fd_set *, struct timeval 
*));
  #endif
***
*** 2228,2233 
--- 2258,2270 
  
  #ifdef VMS
  fname = vms_fixfilename(fname);
+ #endif
+ 
+ #ifdef __CYGWIN__
+ /*
+  * This helps for when /etc/hosts is a symlink to c:/something/hosts.
+  */
+ cygwin_conv_to_posix_path(fname, fname);
  #endif
  
  /* expand it if forced or not an absolute path */
*** ../vim-7.0.227/src/version.cThu Apr 26 16:11:47 2007
--- src/version.c   Thu Apr 26 16:27:29 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 228,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
19. All of your friends have an @ in their names.

 /// 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///


patch 7.0.229

2007-04-26 Thread Bram Moolenaar

Patch 7.0.229
Problem:When 'pastetoggle' starts with Esc then pressing Esc in Insert
mode will not time out. (Jeffery Small)
Solution:   Use KL_PART_KEY instead of KL_PART_MAP, so that 'ttimeout' applies
to the 'pastetoggle' key.
Files:  src/getchar.c


*** ../vim-7.0.228/src/getchar.cSun Mar  4 21:25:44 2007
--- src/getchar.c   Thu Apr 19 22:13:37 2007
***
*** 2183,2189 
}
/* Need more chars for partly match. */
if (mlen == typebuf.tb_len)
!   keylen = KL_PART_MAP;
else if (max_mlen  mlen)
/* no match, may have to check for termcode at
 * next character */
--- 2187,2193 
}
/* Need more chars for partly match. */
if (mlen == typebuf.tb_len)
!   keylen = KL_PART_KEY;
else if (max_mlen  mlen)
/* no match, may have to check for termcode at
 * next character */
*** ../vim-7.0.228/src/version.cThu Apr 26 16:28:43 2007
--- src/version.c   Thu Apr 26 16:48:59 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 229,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.

 /// 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///


patch 7.0.230

2007-04-26 Thread Bram Moolenaar

Patch 7.0.230
Problem:After using :lcd a script doesn't know how to restore the
current directory.
Solution:   Add the haslocaldir() function. (Bob Hiestand)
Files:  runtime/doc/usr_41.txt, runtime/doc/eval.txt, src/eval.c


*** ../vim-7.0.229/runtime/doc/usr_41.txt   Sun May  7 17:02:39 2006
--- runtime/doc/usr_41.txt  Thu Apr 26 17:06:48 2007
***
*** 1,4 
! *usr_41.txt*  For Vim version 7.0.  Last change: 2006 Apr 30
  
 VIM USER MANUAL - by Bram Moolenaar
  
--- 1,4 
! *usr_41.txt*  For Vim version 7.0.  Last change: 2007 Apr 26
  
 VIM USER MANUAL - by Bram Moolenaar
  
***
*** 703,708 
--- 703,709 
isdirectory()   check if a directory exists
getfsize()  get the size of a file
getcwd()get the current working directory
+   haslocaldir()   check if current window used |:lcd|
tempname()  get the name of a temporary file
mkdir() create a new directory
delete()delete a file
*** ../vim-7.0.229/runtime/doc/eval.txt Tue Mar 27 10:20:58 2007
--- runtime/doc/eval.txtTue Apr 24 21:50:49 2007
***
*** 1,4 
! *eval.txt*  For Vim version 7.0.  Last change: 2006 Nov 01
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
--- 1,4 
! *eval.txt*  For Vim version 7.0.  Last change: 2007 Apr 24
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
***
*** 1623,1628 
--- 1633,1639 
  globpath( {path}, {expr}) String  do glob({expr}) for all dirs in {path}
  has( {feature})   Number  TRUE if feature {feature} 
supported
  has_key( {dict}, {key})   Number  TRUE if {dict} has entry {key}
+ haslocaldir() Number  TRUE if current window executed |:lcd|
  hasmapto( {what} [, {mode} [, {abbr}]])
Number  TRUE if mapping to {what} exists
  histadd( {history},{item})String  add an item to a history
***
*** 3016,3021 
--- 3041,3049 
The result is a Number, which is 1 if |Dictionary| {dict} has
an entry with key {key}.  Zero otherwise.
  
+ haslocaldir() *haslocaldir()*
+   The result is a Number, which is 1 when the current
+ window has set a local path via |:lcd|, and 0 otherwise.
  
  hasmapto({what} [, {mode} [, {abbr}]])*hasmapto()*
The result is a Number, which is 1 if there is a mapping that
*** ../vim-7.0.229/src/eval.c   Thu Apr 26 10:55:46 2007
--- src/eval.c  Thu Apr 26 10:52:09 2007
***
*** 541,546 
--- 541,547 
  static void f_globpath __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_has __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_has_key __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_haslocaldir __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_hasmapto __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_histadd __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_histdel __ARGS((typval_T *argvars, typval_T *rettv));
***
*** 7110,7115 
--- 7111,7117 
  {globpath,  2, 2, f_globpath},
  {has,   1, 1, f_has},
  {has_key,   2, 2, f_has_key},
+ {haslocaldir,   0, 0, f_haslocaldir},
  {hasmapto,  1, 3, f_hasmapto},
  {highlightID,   1, 1, f_hlID},  /* obsolete */
  {highlight_exists,1, 1, f_hlexists},/* obsolete */
***
*** 11131,11136 
--- 11133,11150 
  
  rettv-vval.v_number = dict_find(argvars[0].vval.v_dict,
  get_tv_string(argvars[1]), -1) != NULL;
+ }
+ 
+ /*
+  * haslocaldir() function
+  */
+ /*ARGSUSED*/
+ static void
+ f_haslocaldir(argvars, rettv)
+ typval_T  *argvars;
+ typval_T  *rettv;
+ {
+ rettv-vval.v_number = (curwin-w_localdir != NULL);
  }
  
  /*
*** ../vim-7.0.229/src/version.cThu Apr 26 16:50:05 2007
--- src/version.c   Thu Apr 26 17:04:15 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 230,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
22. You've already visited all the links at Yahoo and you're halfway through
Lycos.

 /// 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: [PATCH] Determining whether a window used :lcd

2007-04-26 Thread Bob Hiestand

On 4/26/07, Nikolai Weibull [EMAIL PROTECTED] wrote:

  Either way, wouldn't it be more useful to alter getcwd() to take an
  optional argument stating whether we want the local or global cwd?

 The problem is that my plugin needs to change the current working
 directory, perform an action, and then restore the previous working
 directory.  I need to know whether to use :lcd or :cd to do that.  If
 I use :cd in a window that had previously used :lcd, then I clobbered
 the :lcd usage and that window is now stuck to the global directory;
 additionally, the global directory is changed to whatever the prior
 value.  If I instead use :lcd always, and the window wasn't previously
 using a local directory, it now is.

let saved_cwd = getcwd('local')
let cd_cmd = (saved_cwd != getcwd('global')) ? 'lcd' : 'cd'
exec cd_cmd '…'
⋮
exec cd_cmd saved_cwd

(assuming getcwd('local') returns the local directory, if there is
one, or whatever getcwd('global') would, if not.)


While, again, that functionality would suit my plugin's need, I can't
help but feel that that's a pretty inefficient way of checking
compared to:

let cd_cmd = haslocaldir() ? 'lcd' : 'cd'

In the larger picture, I don't know why you'd want to distinguish
between local and global directory normally, other than to determine
the correct ':l?cd' to use, so I don't think that specifying a
parameter to getcwd() to be very useful.  haslocaldir() has the
advantage of (imo) being simpler.

Thank you,

bob


patch 7.0.231

2007-04-26 Thread Bram Moolenaar

Patch 7.0.231
Problem:When recovering from a swap file the page size is likely to be
different from the minimum.  The block used for the first page
then has a buffer of the wrong size, causing a crash when it's
reused later.  (Zephaniah Hull)
Solution:   Reallocate the buffer when the page size changes.  Also check that
the page size is at least the minimum value.
Files:  src/memline.c


*** ../vim-7.0.230/src/memline.cTue Mar  6 20:27:03 2007
--- src/memline.c   Thu Apr 19 16:10:39 2007
***
*** 1015,1032 
--- 1015,1053 
msg_end();
goto theend;
  }
+ 
  /*
   * If we guessed the wrong page size, we have to recalculate the
   * highest block number in the file.
   */
  if (mfp-mf_page_size != (unsigned)char_to_long(b0p-b0_page_size))
  {
+   unsigned previous_page_size = mfp-mf_page_size;
+ 
mf_new_page_size(mfp, (unsigned)char_to_long(b0p-b0_page_size));
+   if (mfp-mf_page_size  previous_page_size)
+   {
+   msg_start();
+   msg_outtrans_attr(mfp-mf_fname, attr | MSG_HIST);
+   MSG_PUTS_ATTR(_( has been damaged (page size is smaller than 
minimum value).\n),
+   attr | MSG_HIST);
+   msg_end();
+   goto theend;
+   }
if ((size = lseek(mfp-mf_fd, (off_t)0L, SEEK_END)) = 0)
mfp-mf_blocknr_max = 0;/* no file or empty file */
else
mfp-mf_blocknr_max = (blocknr_T)(size / mfp-mf_page_size);
mfp-mf_infile_count = mfp-mf_blocknr_max;
+ 
+   /* need to reallocate the memory used to store the data */
+   p = alloc(mfp-mf_page_size);
+   if (p == NULL)
+   goto theend;
+   mch_memmove(p, hp-bh_data, previous_page_size);
+   vim_free(hp-bh_data);
+   hp-bh_data = p;
+   b0p = (ZERO_BL *)(hp-bh_data);
  }
  
  /*
*** ../vim-7.0.230/src/version.cThu Apr 26 17:08:16 2007
--- src/version.c   Thu Apr 26 17:11:38 2007
***
*** 668,669 
--- 668,671 
  {   /* Add new patch number below this line */
+ /**/
+ 231,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother...she doesn't have a modem.

 /// 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: Vim's ole functionality

2007-04-26 Thread Sebastian Menge
Am Donnerstag, den 26.04.2007, 14:08 +0200 schrieb Sebastian Menge:
  Perhaps this Mail from eclipse helps:
[ ... ]

quote from that mail:

 SWT supports the embedding of OleDocuments and Active X Controls only.
 In order to be an ActiveX control, the control must support a minimum
 set of interfaces.  The error you are getting is Interface not
 supported.  
[...] 
 but my guess is it does not have the minimum set of API required to be
 an ActiveX Control.
  
 Some of the required interfaces are:
  
 IOleObject
 IOleInPlaceObject
 IOleInPlaceActiveObject
 IOleControl

Are the if_ole developers around? Does gvim implement these
interfaces !? I don't see them in the OLEViewer from M$ ...

Sebastian.



patch 7.0.232 (extra)

2007-04-26 Thread Bram Moolenaar

Patch 7.0.232 (extra)
Problem:Mac: doesn't support GUI tab page labels.
Solution:   Add GUI tab page labels. (Nicolas Weber)
Files:  src/feature.h, src/gui.c, src/gui.h, src/gui_mac.c,
src/proto/gui_mac.pro


*** ../vim-7.0.231/src/feature.hWed Nov  1 18:10:36 2006
--- src/feature.h   Thu Mar 15 19:02:15 2007
***
*** 756,761 
--- 756,762 
  #if defined(FEAT_WINDOWS)  defined(FEAT_NORMAL) \
   (defined(FEAT_GUI_GTK) \
|| (defined(FEAT_GUI_MOTIF)  defined(HAVE_XM_NOTEBOOK_H)) \
+   || defined(FEAT_GUI_MAC) \
|| (defined(FEAT_GUI_MSWIN)  (!defined(_MSC_VER) || _MSC_VER  1020)))
  # define FEAT_GUI_TABLINE
  #endif
*** ../vim-7.0.231/src/gui.cTue Oct 10 17:36:50 2006
--- src/gui.c   Thu Mar 15 19:02:15 2007
***
*** 1159,1165 
  #endif
  
  # if defined(FEAT_GUI_TABLINE)  (defined(FEAT_GUI_MSWIN) \
!   || defined(FEAT_GUI_MOTIF))
  if (gui_has_tabline())
text_area_y += gui.tabline_height;
  #endif
--- 1159,1165 
  #endif
  
  # if defined(FEAT_GUI_TABLINE)  (defined(FEAT_GUI_MSWIN) \
!   || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_MAC))
  if (gui_has_tabline())
text_area_y += gui.tabline_height;
  #endif
*** ../vim-7.0.231/src/gui.hThu Apr 27 01:52:33 2006
--- src/gui.h   Thu Mar 15 19:02:15 2007
***
*** 421,427 
  #endif/* FEAT_GUI_GTK */
  
  #if defined(FEAT_GUI_TABLINE) \
!(defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF))
  int   tabline_height;
  #endif
  
--- 425,432 
  #endif/* FEAT_GUI_GTK */
  
  #if defined(FEAT_GUI_TABLINE) \
!(defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF) \
!  || defined(FEAT_GUI_MAC))
  int   tabline_height;
  #endif
  
*** ../vim-7.0.231/src/gui_mac.cThu Mar  8 20:39:02 2007
--- src/gui_mac.c   Fri Mar 16 11:26:05 2007
***
*** 4,10 
   *GUI/Motif support by Robert Webb
   *Macintosh port by Dany St-Amant
   *  and Axel Kielhorn
!  *Port to MPW by Bernhard PrŸmmer
   *Initial Carbon port by Ammon Skidmore
   *
   * Do :help uganda  in Vim to read copying and usage conditions.
--- 4,10 
   *GUI/Motif support by Robert Webb
   *Macintosh port by Dany St-Amant
   *  and Axel Kielhorn
!  *Port to MPW by Bernhard Pruemmer
   *Initial Carbon port by Ammon Skidmore
   *
   * Do :help uganda  in Vim to read copying and usage conditions.
***
*** 260,265 
--- 260,270 
  OSErr HandleUnusedParms(const AppleEvent *theAEvent);
  #endif
  
+ #ifdef FEAT_GUI_TABLINE
+ static void initialise_tabline(void);
+ static WindowRef drawer = NULL; // TODO: put into gui.h
+ #endif
+ 
  /*
   * 
   * Conversion Utility
***
*** 2357,2362 
--- 2323,2335 
  
  thePart = FindWindow(theEvent-where, whichWindow);
  
+ #ifdef FEAT_GUI_TABLINE
+ /* prevent that the vim window size changes if it's activated by a
+click into the tab pane */
+ if (whichWindow == drawer)
+ return;
+ #endif
+ 
  switch (thePart)
  {
case (inDesk):
***
*** 3097,3102 
--- 3070,3082 
  #endif
  */
  
+ #ifdef FEAT_GUI_TABLINE
+ /*
+  * Create the tabline
+  */
+ initialise_tabline();
+ #endif
+ 
  /* TODO: Load bitmap if using TOOLBAR */
  return OK;
  }
***
*** 5895,5901 
  theCPB.dirInfo.ioFDirIndex = 0;
  theCPB.dirInfo.ioNamePtr   = file.name;
  theCPB.dirInfo.ioVRefNum   = file.vRefNum;
!   /*theCPB.hFileInfo.ioDirID   = 0;*/
  theCPB.dirInfo.ioDrDirID   = file.parID;
  
  /* As ioFDirIndex = 0, get the info of ioNamePtr,
--- 5875,5881 
  theCPB.dirInfo.ioFDirIndex = 0;
  theCPB.dirInfo.ioNamePtr   = file.name;
  theCPB.dirInfo.ioVRefNum   = file.vRefNum;
! /*theCPB.hFileInfo.ioDirID   = 0;*/
  theCPB.dirInfo.ioDrDirID   = file.parID;
  
  /* As ioFDirIndex = 0, get the info of ioNamePtr,
***
*** 6093,6096 
--- 6073,6479 
  return (script != smRoman
 script == GetScriptManagerVariable(smSysScript)) ? 1 : 0;
  }
+ 
  #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
+ 
+ 
+ 
+ 
+ #if defined(FEAT_GUI_TABLINE) || defined(PROTO)
+ // drawer implementation
+ static MenuRef contextMenu = NULL;
+ enum
+ {
+ kTabContextMenuId = 42,
+ };
+ 
+ // the caller has to CFRelease() the returned string
+ static CFStringRef
+ getTabLabel(tabpage_T *page)
+ {
+ get_tabline_label(page, FALSE);
+ #ifdef MACOS_CONVERT
+ return mac_enc_to_cfstring(NameBuff, STRLEN(NameBuff));
+ #else

Re: syntax highlighting addition

2007-04-26 Thread Jonathan Smith

sorry for the long time between replies. i've been busy on other things :)

Nikolai Weibull wrote:
 Well, the rpm spec file-type has been with us a long time, well before
 we knew better.  Try to give your file-type an as specific name as
 possible.  You will not be getting the name recipe; it's way too
 generic in this day and age.  Go with conrecipe or something
 similar.  Remember: Bram has his own build system, called Aap, which
 also uses recipes.  Also, if Vim will never edit a (Conary) changeset,
 then why will we have to worry about a name-clash between different
 conary file-types?

done - changed to conaryRecipe.

 Nitpick: remove the empty comment.

done

 Just do

 if exists(b:current_syntax)
  finish
 endif

 No one will be using your syntax definition with vim 5 anyway.  Let's
 keep new files clean from (now) unnecessary cruft.

done

 syn match   conaryUse   Use\.[a-z0-9.]* contains=conaryUseFlag

 Sure that * shouldn't be a \+?  And can you have a sequence of dots,
 as in Use...?

done

 A better way of doing this is to do (substitute \w with whatever
 pattern your parser actually allows)

 syn match conaryUse
 \ Use\.\w\+
 \ nextgroup=conaryUseFlag

 syn keyword conaryUseFlag
 \ contained
 \ nextgroup=conaryUseFlagSeparator
 \ pcre
 \ tcpwrappers
 \ ...

 syn match conaryUseFlagSeparator
 \ contained
 \ nextgroup=conaryUseFlag
 \ '\.'

that didn't work for me for some reason. perhaps i'm misunderstanding?

 syn match   conaryRr\.\w* contains=conaryFunction

 Leftover?

yes. axed.

 if version = 508 || !exists(did_python_syn_inits)
   if version = 508
let did_python_syn_inits = 1
 command -nargs=+ HiLink hi link args
   else
 command -nargs=+ HiLink hi def link args
   endif

 Just skip this.  No one will be using your syntax definition with Vim 5.

yep, removed. as i said, rPath has been maintaining this for a long time. :)

   HiLink pythonStatement   Statement
   HiLink pythonFunctionFunction
   HiLink pythonConditional Conditional
   HiLink pythonRepeat  Repeat
   HiLink pythonString  String
   HiLink pythonRawString   String
   HiLink pythonEscape  Special
   HiLink pythonOperatorOperator
   HiLink pythonPreCondit   PreCondit
   HiLink pythonComment Comment
   HiLink pythonTodoTodo

 ?

all wacked. just crufty.

  vim: ts=8

 This is the default setting.

removed

new version attached, as before. thanks for the feedback. further feedback 
requested :)


-smithj

--- vim63/runtime/filetype.vim.old	2005-07-29 18:16:25.0 -0400
+++ vim63/runtime/filetype.vim	2005-07-29 18:16:32.0 -0400
@@ -1216,6 +1216,9 @@
   endif
 endfun
 
+ Conary Recipe
+au BufNewFile,BufRead *.recipe		setf conaryRecipe
+
  Remind
 au BufNewFile,BufRead .reminders*		setf remind
 
 Vim syntax file
 Language: Conary Recipe
 Maintainer:   rPath Inc http://www.rpath.com
 Updated:  2007-04-26

if exists(b:current_syntax)
  finish
endif

runtime! syntax/python.vim
syn keyword conarySFunction mainDir addAction addSource addArchive addPatch
syn keyword conarySFunction addRedirect

syn keyword conaryGFunction add addAll addNewGroup addReference createGroup
syn keyword conaryGFunction addNewGroup startGroup remove removeComponents
syn keyword conaryGFunction replace setByDefault setDefaultGroup 
syn keyword conaryGFunction setLabelPath addCopy setSearchPath

syn keyword conaryBFunction Run Automake Configure ManualConfigure 
syn keyword conaryBFunction Make MakeParallelSubdir MakeInstall
syn keyword conaryBFunction MakePathsInstall CompilePython
syn keyword conaryBFunction Ldconfig Desktopfile Environment SetModes
syn keyword conaryBFunction Install Copy Move Symlink Link Remove Doc
syn keyword conaryBFunction Create MakeDirs disableParallelMake
syn keyword conaryBFunction ConsoleHelper Replace SGMLCatalogEntry
syn keyword conaryBFunction XInetdService XMLCatalogEntry TestSuite
syn keyword conaryBFunction PythonSetup

syn keyword conaryPFunction NonBinariesInBindirs FilesInMandir 
syn keyword conaryPFunction ImproperlyShared CheckSonames CheckDestDir
syn keyword conaryPFunction ComponentSpec PackageSpec 
syn keyword conaryPFunction Config InitScript GconfSchema SharedLibrary
syn keyword conaryPFunction ParseManifest MakeDevices DanglingSymlinks
syn keyword conaryPFunction AddModes WarnWriteable IgnoredSetuid
syn keyword conaryPFunction Ownership ExcludeDirectories
syn keyword conaryPFunction BadFilenames BadInterpreterPaths ByDefault
syn keyword conaryPFunction ComponentProvides ComponentRequires Flavor
syn keyword conaryPFunction EnforceConfigLogBuildRequirements Group
syn keyword conaryPFunction EnforceSonameBuildRequirements InitialContents
syn keyword conaryPFunction FilesForDirectories LinkCount
syn keyword conaryPFunction MakdeDevices NonMultilibComponent 

Re: syntax highlighting addition

2007-04-26 Thread Nikolai Weibull

It's getting there.

On 4/26/07, Jonathan Smith [EMAIL PROTECTED] wrote:


Nikolai Weibull wrote:



  A better way of doing this is to do (substitute \w with whatever
  pattern your parser actually allows)
 
  syn match conaryUse
  \ Use\.\w\+
  \ nextgroup=conaryUseFlag


Oops.  That should be

syn keyword conaryUse
 \ nextgroup=conaryUseFlagSeparator
 \ Use


 Vim syntax file
 Language: Conary Recipe
 Maintainer:   rPath Inc http://www.rpath.com
 Updated:  2007-04-26



The empty comment is still there.  Just leave that line blank.  No
biggie, of course, just aesthetics.


runtime! syntax/python.vim


Just to make sure: Python is allowed anywhere in a conary recipe?


syn keyword conarySFunction mainDir addAction addSource addArchive addPatch


If you change the filetype name to conaryrecipe (note: no caps),
you'll also have to change the syntax-group names.


syn match   conaryMacro %(\w*)[sd] contained
syn match   conaryBadMacro  %(\w*)[^sd] contained  no final marker


OK, so you can have the following:

%()s

or should it be %(\w\+)[sd]


 strings
syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ 
skip=+\|\\'+ contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString matchgroup=Normal start=+[uU]\=+ end=++ 
skip=+\|\\+ contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString matchgroup=Normal start=+[uU]\=+ end=++ 
contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString matchgroup=Normal start=+[uU]\='''+ end=+'''+ 
contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonRawString  matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ 
skip=+\|\\'+ contains=conaryMacro,conaryBadMacro
syn region pythonRawString  matchgroup=Normal start=+[uU]\=[rR]+ end=++ 
skip=+\|\\+ contains=conaryMacro,conaryBadMacro
syn region pythonRawString  matchgroup=Normal start=+[uU]\=[rR]+ 
end=++ contains=conaryMacro,conaryBadMacro
syn region pythonRawString  matchgroup=Normal start=+[uU]\=[rR]'''+ 
end=+'''+ contains=conaryMacro,conaryBadMacro


I wonder if naming them pythonX is very good.  Bram?


if version = 508 || !exists(did_python_syn_inits)
  command -nargs=+ HiLink hi def link args

   The default methods for highlighting.  Can be overridden later
  HiLink conaryMacroSpecial
  HiLink conaryBFunctionFunction
  HiLink conaryGFunctionFunction
  HiLink conarySFunctionOperator
  HiLink conaryPFunctionTypedef
  HiLink conaryFlagsPreCondit
  HiLink conaryArches   Special
  HiLink conarySubArchesSpecial
  HiLink conaryBad  Error
  HiLink conaryBadMacro Error
  HiLink conaryKeywords Special
  HiLink conaryUseFlag  Typedef

  delcommand HiLink
endif


Substitute that with

hi def link conaryrecipeMacro Macro
hi def link conaryrecipeFunction Function
hi def link conaryrecipeBFunction conaryrecipeFunction
hi def link conaryrecipeGFunction conaryrecipeFunction
:
:

(If conary recipe macros aren't much like macros in C, then perhaps
Special is better.  Also note the linking of a generic group to
function and then other groups linking to them so that a user can
change them all en masse, to something they like.)

That HiLink cruft is also Vim5 compatibility stuff.  And remove the if
statement.


let b:current_syntax = recipe


This should be

let b:current_syntax = conaryrecipe

 nikolai


Re: syntax highlighting addition

2007-04-26 Thread Bram Moolenaar

Jonathan Smith wrote:

 sorry for the long time between replies. i've been busy on other things :)
 
 Nikolai Weibull wrote:
   Well, the rpm spec file-type has been with us a long time, well before
   we knew better.  Try to give your file-type an as specific name as
   possible.  You will not be getting the name recipe; it's way too
   generic in this day and age.  Go with conrecipe or something
   similar.  Remember: Bram has his own build system, called Aap, which
   also uses recipes.  Also, if Vim will never edit a (Conary) changeset,
   then why will we have to worry about a name-clash between different
   conary file-types?
 
 done - changed to conaryRecipe.

No other filetype has an uppercase letter.  I would call it
conaryrecipe.  It's a bit long, but clear.

Now all items in the syntax file need to start with conaryrecipe to
avoid any confusion with other syntax files and highlighting items.
b:current_syntax also needs to be set to the same name.

   Nitpick: remove the empty comment.
 
 done
 
   Just do
  
   if exists(b:current_syntax)
finish
   endif
  
   No one will be using your syntax definition with vim 5 anyway.  Let's
   keep new files clean from (now) unnecessary cruft.
 
 done
 
   syn match   conaryUse   Use\.[a-z0-9.]* contains=conaryUseFlag
  
   Sure that * shouldn't be a \+?  And can you have a sequence of dots,
   as in Use...?
 
 done
 
   A better way of doing this is to do (substitute \w with whatever
   pattern your parser actually allows)
  
   syn match conaryUse
   \ Use\.\w\+
   \ nextgroup=conaryUseFlag
  
   syn keyword conaryUseFlag
   \ contained
   \ nextgroup=conaryUseFlagSeparator
   \ pcre
   \ tcpwrappers
   \ ...
  
   syn match conaryUseFlagSeparator
   \ contained
   \ nextgroup=conaryUseFlag
   \ '\.'
 
 that didn't work for me for some reason. perhaps i'm misunderstanding?
 
   syn match   conaryRr\.\w* contains=conaryFunction
  
   Leftover?
 
 yes. axed.
 
   if version = 508 || !exists(did_python_syn_inits)
 if version = 508
  let did_python_syn_inits = 1
   command -nargs=+ HiLink hi link args
 else
   command -nargs=+ HiLink hi def link args
 endif
  
   Just skip this.  No one will be using your syntax definition with Vim 5.
 
 yep, removed. as i said, rPath has been maintaining this for a long time. :)

You might as well use hi def link instead of HiLink.

 HiLink pythonStatement   Statement
 HiLink pythonFunctionFunction
 HiLink pythonConditional Conditional
 HiLink pythonRepeat  Repeat
 HiLink pythonString  String
 HiLink pythonRawString   String
 HiLink pythonEscape  Special
 HiLink pythonOperatorOperator
 HiLink pythonPreCondit   PreCondit
 HiLink pythonComment Comment
 HiLink pythonTodoTodo
  
   ?
 
 all wacked. just crufty.

But the python syntax items are still there.  This doesn't look right.

vim: ts=8
  
   This is the default setting.
 
 removed
 
 new version attached, as before. thanks for the feedback. further feedback 
 requested :)

-- 
hundred-and-one symptoms of being an internet addict:
27. You refer to your age as 3.x.

 /// 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///


vim 7.1?

2007-04-26 Thread Jonathan Smith
With the insane number of patches collecting against 7.0, and presumably the new 
features accumulating in the devel tree, is anyone thinking about when a 7.1 
release might be made?


-smithj


Re: vim 7.1?

2007-04-26 Thread A.J.Mechelynck

Jonathan Smith wrote:
With the insane number of patches collecting against 7.0, and presumably 
the new features accumulating in the devel tree, is anyone thinking 
about when a 7.1 release might be made?


-smithj



- Insane? All is relative. We're only at 7.0.233 as of today. FYI, Vim 6.2 
went to 532 patches, see http://ftp.vim.org/pub/vim/patches/ .


- What devel tree? I'll believe that a 7.1 is on the rails when I see at least 
an alpha. Before that, AFA-anyone-CT, there's no devel tree. Let's not 
presume about what we know nothing about.


- It's not anyone, it's Bram Moolenaar and no-one else; and since he now has 
a full-time job again, it's a small sort of miracle that he still finds some 
time for Vim.



Best regards,
Tony.
--
There is no distinctly native American criminal class except Congress.
-- Mark Twain


possible bug: lowercase dotless i and langmap

2007-04-26 Thread Ali Polatel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone,
  I was playing around with langmap and found out there is a problem with
characters
'ı'[1] - 0131;LATIN SMALL LETTER DOTLESS I - and
'ğ'[2] - 011F;LATIN SMALL LETTER G WITH BREVE
  The Turkish keyboard looks like this[3] for those who don't know about
it.
  The problem is when I set langmap=ıi small dotless I doesn't work as
expected. I'm using tr_TR.UTF-8 locale and I tried it both on the
console,with consoles on X and with gvim. The same is true
for g with breve. The other turkish keys work fine with langmap. I wasn't sure
if this was about my system or vim so I made some people with turkish keyboards
try this:
[EMAIL PROTECTED] ~ $ vim -c set lmap=ıi
 execute \normal ıhi\Esc\
 let line = getline(1)
 if line =~ \hi\
echo \The dotless small I works as expected\
 else
echo \The dotless small I doesn't work with langmap\
 endif 
- - there is probably a shorter way but anyway :) -
and they could reproduce the problem. 
  Internationalizing dotted and dotless letter I has always been a problem[4]
but I don't think this is the issue here because the same problem exists for g 
with
breve.

  Regards,

[1] http://www.fileformat.info/info/unicode/char/0131/index.htm
[2] http://www.fileformat.info/info/unicode/char/011f/index.htm
[3] 
http://upload.wikimedia.org/wikipedia/commons/thumb/6/63/KB_Turkey.svg/540px-KB_Turkey.svg.png
[4] http://www.i18nguy.com/unicode/turkish-i18n.html

- -- 
Ali Polatel (hawking) [EMAIL PROTECTED]
http://hawking.nonlogic.org/
gpg: 0x8E724EDC fp: DBC2 2BC7 95B8 6D6C 8BC3  37EC CA00 CFC1 8E72 4EDC
()  ascii ribbon campaign - against html mail
/\
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.3 (GNU/Linux)

iD8DBQFGMRvFygDPwY5yTtwRAl34AKCR03ale9/J1wTZHd+iC2T4Jykl/ACgkoqE
NaEI8m12uXStnfwAZdt/MG8=
=pI61
-END PGP SIGNATURE-


feedkeys() allowed in sandbox

2007-04-26 Thread Tomas Golembiovsky
Greetings mortals,

today somebody came to #vim, and pasted some modeline (containig joke or
such). He muttered something about not knowing what that means and left
before long. But (!) what I noticed is that feedkeys() was used as part of
foldexpression and it turned out that feedkeys() is allowed in sandbox,
which means malicious file can run arbitrary command via modeline like
this:

vim: fdm=expr fde=feedkeys(\\:!touch\ phantom_was_here\\cr)

I guess you can see the consequences. Is this known/intentional?

-- 

Best regards,
Tomas Golembiovsky

--
||- - -
|
| Alan's Law of Research
| 
| The theory is supported as long as the funds are.
| 
|- - -


Re: vim 7.1?

2007-04-26 Thread Jonathan Smith

A.J.Mechelynck wrote:
- Insane? All is relative. We're only at 7.0.233 as of today. FYI, Vim 
6.2 went to 532 patches, see http://ftp.vim.org/pub/vim/patches/


Release early, release often :)

- What devel tree? I'll believe that a 7.1 is on the rails when I see at 
least an alpha. Before that, AFA-anyone-CT, there's no devel tree. 
Let's not presume about what we know nothing about.


Hence presume.

- It's not anyone, it's Bram Moolenaar and no-one else; and since he 
now has a full-time job again, it's a small sort of miracle that he 
still finds some time for Vim.


Even if BM is the only one who can actually make a release, I'd imagine others 
have opinions on the matter. Anyway, I was just wondering.


-smithj


Re: vim 7.1?

2007-04-26 Thread A.J.Mechelynck

Jonathan Smith wrote:
[...]
Even if BM is the only one who can actually make a release, I'd imagine 
others have opinions on the matter. Anyway, I was just wondering.


-smithj



AFAICT, the current bugs are all (or almost all) mere bugfixes. I don't feel a 
release is imperatively called-for (but Bram has of course the final say). On 
Unix-like systems (like yours and mine) compiling Vim is really no problem; 
yet if you absolutely want it, I can make my binaries available. I don't know, 
however, whether they will even load without perl, python, ruby and tcl all 
installed, and I think the GUI won't load without Gnome2.



Best regards,
Tony.
--
Automobile, n.:
A four-wheeled vehicle that runs up hills and down
pedestrians.


Re: Vim's ole functionality

2007-04-26 Thread A.J.Mechelynck

Sebastian Menge wrote:

Am Donnerstag, den 26.04.2007, 14:08 +0200 schrieb Sebastian Menge:

 Perhaps this Mail from eclipse helps:

[ ... ]

quote from that mail:


SWT supports the embedding of OleDocuments and Active X Controls only.
In order to be an ActiveX control, the control must support a minimum
set of interfaces.  The error you are getting is Interface not
supported.  
[...] 

but my guess is it does not have the minimum set of API required to be
an ActiveX Control.
 
Some of the required interfaces are:
 
IOleObject

IOleInPlaceObject
IOleInPlaceActiveObject
IOleControl


Are the if_ole developers around? Does gvim implement these
interfaces !? I don't see them in the OLEViewer from M$ ...

Sebastian.



I don't think gvim ever meant to be an ActiveX control. shudder/

Best regards,
Tony.
--
Baker's First Law of Federal Geometry:
A block grant is a solid mass of money surrounded on all sides
by governors.


join all lines inside pattern that occurs more than once

2007-04-26 Thread Nikolaos A. Patsopoulos

Hi,

I want to join all lines that are inside a given pattern and occurs more 
than once  in the text, ie:



PatternStart 
text1
text2
...text3
..text4
PatternEnd
...
...


PatternStart 
text1
text2
...text3
..text4
...
...textn
PatternEnd



...
PatternStart text1text2...text3..text4PatternEnd



PatternStart text1text2...text3..text4......textnPatternEnd



I tried to use:
:g/PatternStart\_.\{-}PatternEnd/ J

but this joins only first and second line of the pattern.

How can I tell vi to join all lines inside all occurrences of this 
pattern with variable containing lines?


Thanks in advance,

Nikos



Re: join all lines inside pattern that occurs more than once

2007-04-26 Thread Jürgen Krämer

Hi,

Nikolaos A. Patsopoulos wrote:
 
 I want to join all lines that are inside a given pattern and occurs more 
 than once  in the text, ie:
 
 
 PatternStart 
 text1
 text2
 ...text3
 ..text4
 PatternEnd
 ...
 ...
 
 
 PatternStart 
 text1
 text2
 ...text3
 ..text4
 ...
 ...textn
 PatternEnd
 
 
 
 ...
 PatternStart text1text2...text3..text4PatternEnd
 
 
 
 PatternStart text1text2...text3..text4......textnPatternEnd
 
 
 
 I tried to use:
 :g/PatternStart\_.\{-}PatternEnd/ J
 
 but this joins only first and second line of the pattern.
 
 How can I tell vi to join all lines inside all occurrences of this 
 pattern with variable containing lines?

the pattern you supplied only specifies a single line range. If you want
to join a whole block you must give a start address and an end address,
e.g.

  :g/PatternStart/,/PatternEnd/j

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)


Re: join all lines inside pattern that occurs more than once

2007-04-26 Thread Peter Palm
Op donderdag 26 april 2007, schreef Nikolaos A. Patsopoulos:
 Hi,

Hi

 I want to join all lines that are inside a given pattern and occurs
 more than once  in the text, ie:

 
 PatternStart 
 text1
 text2
 ...text3
 ..text4
 PatternEnd
 ...
 ...


 PatternStart 
 text1
 text2
 ...text3
 ..text4
 ...
 ...textn
 PatternEnd
 


 ...
 PatternStart text1text2...text3..text4PatternEnd
 
 

 PatternStart text1text2...text3..text4...   
 ...textnPatternEnd 

 I tried to use:
 :g/PatternStart\_.\{-}PatternEnd/ J

How about:

:g/PatternStart/,/PatternEnd/j


Peter


Re: button t useless?

2007-04-26 Thread zzapper
zzapper [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]: 

 alebo [EMAIL PROTECTED] wrote in
 news:[EMAIL PROTECTED]: 
 
 
 In fact VIM has many features that appear redundant but then one day
 (perhaps after many years) you realise their utility.
 
In fact I've found that there is usually (always?) a subtle advantage in 
using one or other of a command which apparently does the same thing, and 
that in different circumstances one or the other will be superior.

eg

When the cursor is in the middle of a word you wish to delete

diw has a distinct advantage over bdw

But what is it?


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: button t useless?

2007-04-26 Thread Michael Dunn

On 25/04/07, Erlend Hamberg [EMAIL PROTECTED] wrote:

On Wednesday 25 April 2007 09:01:49 alebo wrote:
 Whats the reason vim has the function t
 which does the same as f, only moving to the character
 before? It seems useless to me; you can use f insted
 of t always, or...?

If you want to change or delete text to a certain character it would be
annoying to use f, as you then would have to retype that character. ;-)


Brilliant! I didn't know about t before (thanks, alebo). I always need
this in python, where _ is a word character, but you sometimes want to
treat it as a word boundary. For example, suppose you have the cursor
over o in the following:

reactor.vent_radioactive_gas()

ciw will replace the entire method vent_radioactive_gas
But T_ct_ will replace just radioactive

Cheers, Michael


Re: button t useless?

2007-04-26 Thread Tim Chase

When the cursor is in the middle of a word you wish to delete

diw has a distinct advantage over bdw

But what is it?


I think it's the mental model.

diw is two mental steps:  {action}{object} where {action} is 
delete and {object} is iw even though that {object} is two 
characters.


bdw, OTOH, has a 3-step mental model of 
{prepare}{action}{motion} where you {prepare} with b, {action} 
with d over {motion} with w.


When vimming, you begin to think in the flow okay...I want to 
delete something [hit 'd'] and it's this thing [provide 
object/motion].  The latter intrudes on this by requiring you to 
not start your deletion action until you've prepared for it.


Or maybe that's just the warped way my own mind works :)

-tim




RE: button t useless?

2007-04-26 Thread Halim, Salman
This might not be a huge deal, but bdw is typed entirely with the left
hand if you're on a QWERTY keyboard (most people with English/US
keyboards) while diw switches hands.  Unless you're pecking at the
keys with one hand, diw is simply much faster to type :)

Salman.

 -Original Message-
 From: Tim Chase [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 26, 2007 9:48 AM
 To: zzapper
 Cc: vim@vim.org
 Subject: Re: button t useless?
 
  When the cursor is in the middle of a word you wish to delete
  
  diw has a distinct advantage over bdw
  
  But what is it?
 
 I think it's the mental model.
 
 diw is two mental steps:  {action}{object} where {action} 
 is delete and {object} is iw even though that {object} is 
 two characters.
 
 bdw, OTOH, has a 3-step mental model of 
 {prepare}{action}{motion} where you {prepare} with b, 
 {action} with d over {motion} with w.
 
 When vimming, you begin to think in the flow okay...I want 
 to delete something [hit 'd'] and it's this thing [provide 
 object/motion].  The latter intrudes on this by requiring 
 you to not start your deletion action until you've prepared for it.
 
 Or maybe that's just the warped way my own mind works :)
 
 -tim
 
 
 


Re: FW: verilog-mode, veri-tedium

2007-04-26 Thread Albie Janse van Rensburg

Normandie Azucena wrote:

hi all vim lovers!

is there no script available that works like the veri-tedium plugin of
xemacs?

if there is none, can any guru do it?

=)

pls?pls?pls?


  

What is xemacs?  =)

--
It is Fortune, not Wisdom, that rules man's life.


help needed with completion in version 7

2007-04-26 Thread Andrei A. Voropaev
Hello!

There is one thing about completion in version 7 that keeps confusing
me. Let's look at the example. Take the text

--
int test_func1()
{
}

int test_func2()
{
}
-

Now I want to add new line

int test_func3()

I type 'int t' and the hit CTRL-P. The completion inserts test_func2 for
me. Now I hit BackSpace and continue typing '3('. But the completion does not
stop. It contitues untill I hit space. And if before hitting space I
want to complete another word, then it does not do it for me.

Is there any way to change this? So that when I hit BackSpace the
completion stops like it happens when I hit Space? Or even better, stop
the completion when I do any modification to the text at all?

Thank you.

-- 
Minds, like parachutes, function best when open


Re: button t useless?

2007-04-26 Thread Yegappan Lakshmanan

Hi,

On 4/26/07, zzapper [EMAIL PROTECTED] wrote:

zzapper [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:

 alebo [EMAIL PROTECTED] wrote in
 news:[EMAIL PROTECTED]:


 In fact VIM has many features that appear redundant but then one day
 (perhaps after many years) you realise their utility.

In fact I've found that there is usually (always?) a subtle advantage in
using one or other of a command which apparently does the same thing, and
that in different circumstances one or the other will be superior.

eg

When the cursor is in the middle of a word you wish to delete

diw has a distinct advantage over bdw

But what is it?



The bdw command can be used to delete the current word only when
the cursor is in the middle of the word. Also, this command cannot be
used to delete single letter words. You have to then use 'x' to delete
single letter words, 'dw' when the cursor is at the start of a word
and 'bdw' when the cursor is not at the start of the word.

The diw command can be used to delete the current word irrespective
of the cursor position in the word and also to delete single letter
words. This is particularly useful from a map command.

- Yegappan


syntax - multiple colors in same string

2007-04-26 Thread subrama6

i'm somewhat new to vim, and particularly new to making my own syntax file,
so please forgive me if this is a dumb question :)  basically, i'm using vim
to keep a GTD style todo list, with various tasks tagged by context.  the
format of the file is as follows:

  @vim @syntax : learn how to do write vim syntax files
  @vim @motions : learn more about motions
  @shopping @grocery : pick up bread on the way home
...etc

these are all indented two spaces so that folding by indent works well for
the various headings i've made.  i've made a syntax file that does *almost*
everything i want it to.  the only thing i can't seem to get work is to get
the tag identfier, namely @, to be a different, but specified, color than
the text following it.

here's what i mean.

in the syntax file, i have something similar to the following

syn match tag /\s@/
highlight link tag Special

this makes the whole thing, @x, appear highlighted as Special.  what
i'd like to do, though, is have the @ be one color and the rest of the tag
be another - Error, for example.  I've tried the following:

syn match tagtext /@[a-z]*/s+1
highlight link tagtext Error

if the statements from above are in there, these lines appear not to make
any difference.  if they are not, the whole string gets highlighted as
Error.  I've tried multiple kinds of regexes, but it seems to me that when
there are two that both have to do with the @, they seem to be clobbering
each other.

Any suggestions?
-- 
View this message in context: 
http://www.nabble.com/syntax---multiple-colors-in-same-string-tf3653839.html#a10207707
Sent from the Vim - General mailing list archive at Nabble.com.



Re: button t useless?

2007-04-26 Thread fREW

On 4/26/07, Yegappan Lakshmanan [EMAIL PROTECTED] wrote:

Hi,

On 4/26/07, zzapper [EMAIL PROTECTED] wrote:
 zzapper [EMAIL PROTECTED] wrote in
 news:[EMAIL PROTECTED]:

  alebo [EMAIL PROTECTED] wrote in
  news:[EMAIL PROTECTED]:
 
 
  In fact VIM has many features that appear redundant but then one day
  (perhaps after many years) you realise their utility.
 
 In fact I've found that there is usually (always?) a subtle advantage in
 using one or other of a command which apparently does the same thing, and
 that in different circumstances one or the other will be superior.

 eg

 When the cursor is in the middle of a word you wish to delete

 diw has a distinct advantage over bdw

 But what is it?


The bdw command can be used to delete the current word only when
the cursor is in the middle of the word. Also, this command cannot be
used to delete single letter words. You have to then use 'x' to delete
single letter words, 'dw' when the cursor is at the start of a word
and 'bdw' when the cursor is not at the start of the word.

The diw command can be used to delete the current word irrespective
of the cursor position in the word and also to delete single letter
words. This is particularly useful from a map command.

- Yegappan



The subject may have been beaten to death by now, but one thing that
happens to me a lot that proves the usefulness of t is this:

Say you have the following line of text:

Computer.open_close(cdrom)

if your cursor is on the o and you want to delete till the (, dt( will
do the trick, whereas dfe will not unless you do it twice.  Honestly,
I use t more because it fits my mental model better, like tim was
talking about.

-fREW


Re: button t useless?

2007-04-26 Thread A.J.Mechelynck

Halim, Salman wrote:

This might not be a huge deal, but bdw is typed entirely with the left
hand if you're on a QWERTY keyboard (most people with English/US
keyboards) while diw switches hands.  Unless you're pecking at the
keys with one hand, diw is simply much faster to type :)

Salman.

[...]

I'm a one-handed typist (right-handed), and to me both are about equally bad 
on ergonomical grounds. I don't think of what I do as pecking however: I 
know where the keys are on my AZERTY keyboard, and I use all five fingers of 
my right hand, which is not riveted to a constant location over the 
keyboard: this makes for reasonably fast typing, maybe faster that some of 
you decadactylographers ;-) .


I go with the previous argument however: bdw has the inconvenient of including 
a prepare step:


bdw (move);(delete(word))
diw (delete((inner)word))


In my mental model, bdw is two steps, diw is one.


Best regards,
Tony.