Re: breakindent, take 2

2007-05-30 Thread Václav Šmilauer
What do you think? I prefer (c) from implementation, efficiency and 
intuitivity perspective.


I agree. Strongly.


Based on popular demand, this patch implements, in addition, 
'breakindentshift' (brishift). It seems to work well, report problems. 
And please suggestions for some shorter names: breakindent is already 
long enough, breakindentshift is not nice at all.


Vaclav
Index: runtime/doc/eval.txt
===
--- runtime/doc/eval.txt	(revision 296)
+++ runtime/doc/eval.txt	(working copy)
@@ -5262,8 +5262,8 @@
 keymap			Compiled with 'keymap' support.
 langmap			Compiled with 'langmap' support.
 libcall			Compiled with |libcall()| support.
-linebreak		Compiled with 'linebreak', 'breakat' and 'showbreak'
-			support.
+linebreak		Compiled with 'linebreak', 'breakat', 'showbreak' and
+			'breakindent' support.
 lispindent		Compiled with support for lisp indenting.
 listcmds		Compiled with commands for the buffer list |:files|
 			and the argument list |arglist|.
Index: runtime/doc/options.txt
===
--- runtime/doc/options.txt	(revision 296)
+++ runtime/doc/options.txt	(working copy)
@@ -1145,6 +1145,39 @@
 	break if 'linebreak' is on.  Only works for ASCII and also for 8-bit
 	characters when 'encoding' is an 8-bit encoding.
 
+	
+		*'breakindent'* *'bri'*
+'breakindent' 'bri'	boolean (default off)
+			local to window
+			{not in Vi}
+			{not available when compiled without the |+linebreak|
+			feature}
+	Every wrapped line will continue visually indented (same amount of
+	space as the beginning of that line), thus preserving horizontal blocks
+	of text.
+
+		*'breakindentmin'* *'brimin'*
+'breakindentmin' 'brimin' number (default 20)
+			local to window
+			{not in Vi}
+			{not available when compiled without the |+linebreak|
+			feature}
+	Minimum text width that will be kept after applying 'breakindent',
+	even if the resulting text should normally be narrower. This prevents
+	text indented almost to the right window border oocupying lot of
+	vertical space when broken.
+
+		*'breakindentshift'* *'brishift'*
+'breakindentshift' 'brishift' number (default 20)
+			local to window
+			{not in Vi}
+			{not available when compiled without the |+linebreak|
+			feature}
+	After applying 'breakindent', wrapped line beginning will be shift by
+	given number of characters. It permits dynamic French paragraph
+	indentation (negative) or emphasizing the line continuation
+	(positive).
+
 		*'browsedir'* *'bsdir'*
 'browsedir' 'bsdir'	string	(default: last)
 			global
@@ -4227,12 +4260,13 @@
 			{not in Vi}
 			{not available when compiled without the  |+linebreak|
 			feature}
-	If on Vim will wrap long lines at a character in 'breakat' rather
+	If on, Vim will wrap long lines at a character in 'breakat' rather
 	than at the last character that fits on the screen.  Unlike
 	'wrapmargin' and 'textwidth', this does not insert EOLs in the file,
-	it only affects the way the file is displayed, not its contents.  The
-	value of 'showbreak' is used to put in front of wrapped lines.
-	This option is not used when the 'wrap' option is off or 'list' is on.
+	it only affects the way the file is displayed, not its contents.
+	If 'breakindent' is set, line is visually indented. Then, the value
+	of 'showbreak' is used to put in front of wrapped lines. This option
+	is not used when the 'wrap' option is off or 'list' is on.
 	Note that Tab characters after an EOL are mostly not displayed
 	with the right amount of white space.
 
Index: runtime/optwin.vim
===
--- runtime/optwin.vim	(revision 296)
+++ runtime/optwin.vim	(working copy)
@@ -329,6 +329,15 @@
 call append($, linebreak\twrap long lines at a character in 'breakat')
 call append($, \t(local to window))
 call SIDBinOptionL(lbr)
+call append($, breakindent\tpreserve indentation in wrapped text)
+call append($, \t(local to window))
+call SIDBinOptionL(bri)
+call append($, breakindentmin\tminimum text width after indent in 'breakindent')
+call append($, \t(local to window))
+call SIDOptionL(brimin)
+call append($, breakindentshift\tshift beginning of 'breakindent'ed line by this number of characters (negative left))
+call append($, \t(local to window))
+call SIDOptionL(brishift)
 call append($, breakat\twhich characters might cause a line break)
 call SIDOptionG(brk, brk)
 call append($, showbreak\tstring to put before wrapped screen lines)
Index: src/ex_cmds.c
===
--- src/ex_cmds.c	(revision 296)
+++ src/ex_cmds.c	(working copy)
@@ -260,7 +260,7 @@
 	;
 save = *last;
 *last = NUL;
-len = linetabsize(line);		/* get line length */
+len = linetabsize(line, curwin-w_cursor.lnum); /* get line length */
 if (has_tab != NULL)		/* check for embedded TAB */
 	*has_tab = (vim_strrchr(first, TAB) != 

[ANN] vimgdb 1.11

2007-05-30 Thread Xavier de Gaye
Hi all

Vimgdb 1.11 is a port of vimgb to Vim 7.1.

Vimgdb is a vim patch implemented as a vim optional feature that
provides full gdb support in the vim editor: breakpoints, watch
variables, gdb command completion, assembly windows, etc.

You can get vimgdb from http://clewn.sourceforge.net.

Xavier


--
http://clewn.sourceforge.net   gdb support in Vim


Re: Tear off this menu in messages-history

2007-05-30 Thread Edward L. Fox

To Yongwei:

Does this patch solve your problem?

To Bram:

Please consider adding this patch. I think it is really a bug.

Index: src/gui_w32.c
===
--- src/gui_w32.c   (revision 296)
+++ src/gui_w32.c   (working copy)
@@ -1051,7 +1051,7 @@
   if (pMenu != NULL  pMenu-strings[MENU_INDEX_TIP] != 0
GetMenuState(s_menuBar, pMenu-id, MF_BYCOMMAND) != -1)
   {
-   msg(pMenu-strings[MENU_INDEX_TIP]);
+   msg_outtrans(pMenu-strings[MENU_INDEX_TIP]);
   setcursor();
   out_flush();
   did_menu_tip = TRUE;


Re: Tear off this menu in messages-history

2007-05-30 Thread Yongwei Wu

Hi Edward,

On 30/05/07, Edward L. Fox [EMAIL PROTECTED] wrote:

To Yongwei:

Does this patch solve your problem?

To Bram:

Please consider adding this patch. I think it is really a bug.

Index: src/gui_w32.c
===
--- src/gui_w32.c   (revision 296)
+++ src/gui_w32.c   (working copy)
@@ -1051,7 +1051,7 @@
if (pMenu != NULL  pMenu-strings[MENU_INDEX_TIP] != 0
 GetMenuState(s_menuBar, pMenu-id, MF_BYCOMMAND) != -1)
{
-   msg(pMenu-strings[MENU_INDEX_TIP]);
+   msg_outtrans(pMenu-strings[MENU_INDEX_TIP]);
setcursor();
out_flush();
did_menu_tip = TRUE;



This patch seems to have solved my problem, and I have not found any
side-effects so far. Thanks!

Best regards,

Yongwei

--
Wu Yongwei
URL: http://wyw.dcweb.cn/