On 03/07/2015 03:04 PM, Bram Moolenaar wrote:
>
> Xavier de Gaye wrote:
>
>> This unused two characters-wide sign column wastes space, take for example a
>> screen that is vertically splitted to show multiple buffers. The attached
>> patch fixes this.
>>
>> For reference, a link to the pyclewn issue tracker that raised the issue:
>> https://bitbucket.org/xdegaye/pyclewn/issue/7
>>
>> Patch side effects on a debugger using netbeans:
>> * When browsing the source code with this patch, the presence of a sign 
column
>>     tells you that either a breakpoint or the frame sign is set in this 
buffer,
>>     even when you don't see the sign itself. This is a useful indication 
(lost
>>     when all windows have a sign column).
>>
>> * The command 'step' or 'next' causes the sign column to disappear and a
>>     reappear rapidly when there are no breakpoints and causes all the lines 
to
>>     be shifted rapidly left and right.  For example at a sleep() statement 
the
>>     sign column disappears for the duration of the sleep.  This may be
>>     considered annoying and may be the reason why netbeans currently forces 
the
>>     sign column in all the windows.
>>
>> About the patch:
>> A two characters wide space at the start of the command line is not 
accessible
>> after netbeans has set the first sign and remains inaccessible even after
>> ':nbclose'.  This minor problem already exists currently and is not fixed by
>> the patch.
>>
>> For backward compatibility we could use an option to choose between the two
>> behaviors, I don't know which option, maybe an option in the nbstart command
>> as in :{hostname}:{addr}:{password}:{sign column} or a netbeans command or an
>> existing Vim option ?
>
> It's not nice to add yet another options.  And this behavior was there
> for a reason.  Probably because we don't want the column to appear and
> disappear when signs are added and removed.
>
> How about this: Add a per-buffer flag that gets set if the b_signlist
> is not empty.  Then the sign column would only show after the first sign
> was displayed while netbeans is active.  Would that work?


Bram,

I have tested the attached patch on pyclewn, this is a patch that implements
what you are suggesting and yes indeed it works well.  This avoids the
left-right flipping of the source code and only sets a remanent sign column on
those buffers that have been on a frame stack, or will be on a frame stack
some time.  Much better than the current behavior.

-- Xavier

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/buffer.c b/src/buffer.c
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5473,6 +5473,10 @@
 
 	    /* first sign in signlist */
 	    buf->b_signlist = newsign;
+#ifdef FEAT_NETBEANS_INTG
+	    if (netbeans_active())
+		buf->sign_column = 1;
+#endif
 	}
 	else
 	    prev->next = newsign;
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -6682,7 +6682,7 @@
 #ifdef FEAT_SIGNS
 	if (curwin->w_buffer->b_signlist != NULL
 # ifdef FEAT_NETBEANS_INTG
-			    || netbeans_active()
+	    		    || curwin->w_buffer->sign_column
 # endif
 		    )
 	    textwidth -= 1;
diff --git a/src/move.c b/src/move.c
--- a/src/move.c
+++ b/src/move.c
@@ -905,7 +905,7 @@
 	    + (
 # ifdef FEAT_NETBEANS_INTG
 		/* show glyph gutter in netbeans */
-		netbeans_active() ||
+		wp->w_buffer->sign_column ||
 # endif
 		wp->w_buffer->b_signlist != NULL ? 2 : 0)
 #endif
diff --git a/src/netbeans.c b/src/netbeans.c
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -144,6 +144,12 @@
     static void
 nb_close_socket(void)
 {
+    buf_T	*buf;
+
+    for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+	if (buf->sign_column)
+	    buf->sign_column = 0;
+
 #ifdef FEAT_GUI_X11
     if (inputHandler != (XtInputId)NULL)
     {
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -2214,7 +2214,7 @@
 {
     return (wp->w_buffer->b_signlist != NULL
 # ifdef FEAT_NETBEANS_INTG
-			    || netbeans_active()
+	    		    || wp->w_buffer->sign_column
 # endif
 		    );
 }
diff --git a/src/structs.h b/src/structs.h
--- a/src/structs.h
+++ b/src/structs.h
@@ -1805,6 +1805,11 @@
 
 #ifdef FEAT_SIGNS
     signlist_T	*b_signlist;	/* list of signs to draw */
+# ifdef FEAT_NETBEANS_INTG
+    int		sign_column;	/* Flag to show the sign column after a first
+				 * sign was displayed and until the end of the
+				 * netbeans session. */
+# endif
 #endif
 
 #ifdef FEAT_NETBEANS_INTG

Raspunde prin e-mail lui