Karsten Hopp 5fa9e3
To: vim-dev@vim.org
Karsten Hopp 5fa9e3
Subject: Patch 7.0.163
Karsten Hopp 5fa9e3
Fcc: outbox
Karsten Hopp 5fa9e3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5fa9e3
Mime-Version: 1.0
Karsten Hopp 5fa9e3
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 5fa9e3
Content-Transfer-Encoding: 8bit
Karsten Hopp 5fa9e3
------------
Karsten Hopp 5fa9e3
Karsten Hopp 5fa9e3
Patch 7.0.163
Karsten Hopp 5fa9e3
Problem:    Can't retrieve the position of a sign after it was set.
Karsten Hopp 5fa9e3
Solution:   Add the netbeans interface getAnno command. (Xavier de Gaye)
Karsten Hopp 5fa9e3
Files:	    runtime/doc/netbeans.txt, src/netbeans.c
Karsten Hopp 5fa9e3
Karsten Hopp 5fa9e3
Karsten Hopp 5fa9e3
*** ../vim-7.0.162/runtime/doc/netbeans.txt	Sun May  7 16:58:43 2006
Karsten Hopp 5fa9e3
--- runtime/doc/netbeans.txt	Tue Nov 14 18:24:32 2006
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 1,4 ****
Karsten Hopp 5fa9e3
! *netbeans.txt*  For Vim version 7.0.  Last change: 2006 Mar 09
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  		  VIM REFERENCE MANUAL    by Gordon Prieur
Karsten Hopp 5fa9e3
--- 1,4 ----
Karsten Hopp 5fa9e3
! *netbeans.txt*  For Vim version 7.0.  Last change: 2006 Nov 14
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  		  VIM REFERENCE MANUAL    by Gordon Prieur
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 259,266 ****
Karsten Hopp 5fa9e3
  confusion happening again, netbeans_saved() has been renamed to
Karsten Hopp 5fa9e3
  netbeans_save_buffer().
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
! We are now at version 2.3.  For the differences between 2.2 and 2.3 search for
Karsten Hopp 5fa9e3
! "2.3" below.
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  The messages are currently sent over a socket.  Since the messages are in
Karsten Hopp 5fa9e3
  plain UTF-8 text this protocol could also be used with any other communication
Karsten Hopp 5fa9e3
--- 259,266 ----
Karsten Hopp 5fa9e3
  confusion happening again, netbeans_saved() has been renamed to
Karsten Hopp 5fa9e3
  netbeans_save_buffer().
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
! We are now at version 2.4.  For the differences between 2.3 and 2.4 search for
Karsten Hopp 5fa9e3
! "2.4" below.
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  The messages are currently sent over a socket.  Since the messages are in
Karsten Hopp 5fa9e3
  plain UTF-8 text this protocol could also be used with any other communication
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 604,609 ****
Karsten Hopp 5fa9e3
--- 604,618 ----
Karsten Hopp 5fa9e3
  		TODO: explain use of partial line.
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  getMark		Not implemented.
Karsten Hopp 5fa9e3
+ 
Karsten Hopp 5fa9e3
+ getAnno serNum
Karsten Hopp 5fa9e3
+ 		Return the line number of the annotation in the buffer.
Karsten Hopp 5fa9e3
+ 		Argument:
Karsten Hopp 5fa9e3
+ 			serNum		serial number of this placed annotation
Karsten Hopp 5fa9e3
+ 		The reply is:
Karsten Hopp 5fa9e3
+ 			123 lnum	line number of the annotation
Karsten Hopp 5fa9e3
+ 			123 0		invalid annotation serial number
Karsten Hopp 5fa9e3
+ 		New in version 2.4.
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  getModified	When a buffer is specified: Return zero if the buffer does not
Karsten Hopp 5fa9e3
  		have changes, one if it does have changes.
Karsten Hopp 5fa9e3
*** ../vim-7.0.162/src/netbeans.c	Tue Aug 29 17:28:56 2006
Karsten Hopp 5fa9e3
--- src/netbeans.c	Tue Nov 14 18:23:48 2006
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 61,67 ****
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  /* The first implementation (working only with Netbeans) returned "1.1".  The
Karsten Hopp 5fa9e3
   * protocol implemented here also supports A-A-P. */
Karsten Hopp 5fa9e3
! static char *ExtEdProtocolVersion = "2.3";
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  static long pos2off __ARGS((buf_T *, pos_T *));
Karsten Hopp 5fa9e3
  static pos_T *off2pos __ARGS((buf_T *, long));
Karsten Hopp 5fa9e3
--- 61,67 ----
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  /* The first implementation (working only with Netbeans) returned "1.1".  The
Karsten Hopp 5fa9e3
   * protocol implemented here also supports A-A-P. */
Karsten Hopp 5fa9e3
! static char *ExtEdProtocolVersion = "2.4";
Karsten Hopp 5fa9e3
  
Karsten Hopp 5fa9e3
  static long pos2off __ARGS((buf_T *, pos_T *));
Karsten Hopp 5fa9e3
  static pos_T *off2pos __ARGS((buf_T *, long));
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 1269,1274 ****
Karsten Hopp 5fa9e3
--- 1269,1297 ----
Karsten Hopp 5fa9e3
  		    (int)curwin->w_cursor.col,
Karsten Hopp 5fa9e3
  		    pos2off(curbuf, &curwin->w_cursor));
Karsten Hopp 5fa9e3
  	    nb_reply_text(cmdno, text);
Karsten Hopp 5fa9e3
+ /* =====================================================================*/
Karsten Hopp 5fa9e3
+ 	}
Karsten Hopp 5fa9e3
+ 	else if (streq((char *)cmd, "getAnno"))
Karsten Hopp 5fa9e3
+ 	{
Karsten Hopp 5fa9e3
+ 	    long linenum = 0;
Karsten Hopp 5fa9e3
+ #ifdef FEAT_SIGNS
Karsten Hopp 5fa9e3
+ 	    if (buf == NULL || buf->bufp == NULL)
Karsten Hopp 5fa9e3
+ 	    {
Karsten Hopp 5fa9e3
+ 		nbdebug(("    null bufp in getAnno"));
Karsten Hopp 5fa9e3
+ 		EMSG("E652: null bufp in getAnno");
Karsten Hopp 5fa9e3
+ 		retval = FAIL;
Karsten Hopp 5fa9e3
+ 	    }
Karsten Hopp 5fa9e3
+ 	    else
Karsten Hopp 5fa9e3
+ 	    {
Karsten Hopp 5fa9e3
+ 		int serNum;
Karsten Hopp 5fa9e3
+ 
Karsten Hopp 5fa9e3
+ 		cp = (char *)args;
Karsten Hopp 5fa9e3
+ 		serNum = strtol(cp, &cp, 10);
Karsten Hopp 5fa9e3
+ 		/* If the sign isn't found linenum will be zero. */
Karsten Hopp 5fa9e3
+ 		linenum = (long)buf_findsign(buf->bufp, serNum);
Karsten Hopp 5fa9e3
+ 	    }
Karsten Hopp 5fa9e3
+ #endif
Karsten Hopp 5fa9e3
+ 	    nb_reply_nr(cmdno, linenum);
Karsten Hopp 5fa9e3
  /* =====================================================================*/
Karsten Hopp 5fa9e3
  	}
Karsten Hopp 5fa9e3
  	else if (streq((char *)cmd, "getLength"))
Karsten Hopp 5fa9e3
*** ../vim-7.0.162/src/version.c	Tue Nov  7 22:41:37 2006
Karsten Hopp 5fa9e3
--- src/version.c	Tue Nov 14 18:25:31 2006
Karsten Hopp 5fa9e3
***************
Karsten Hopp 5fa9e3
*** 668,669 ****
Karsten Hopp 5fa9e3
--- 668,671 ----
Karsten Hopp 5fa9e3
  {   /* Add new patch number below this line */
Karsten Hopp 5fa9e3
+ /**/
Karsten Hopp 5fa9e3
+     163,
Karsten Hopp 5fa9e3
  /**/
Karsten Hopp 5fa9e3
Karsten Hopp 5fa9e3
-- 
Karsten Hopp 5fa9e3
A computer without Windows is like a fish without a bicycle.
Karsten Hopp 5fa9e3
Karsten Hopp 5fa9e3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5fa9e3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5fa9e3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 5fa9e3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///