Re: [PATCH] space on prompt bugfix



Hello Andy, Oswald,

On Wed, 2005-05-25 at 18:13 +0200, Oswald Buddenhagen wrote:
> On Wed, May 25, 2005 at 06:31:15PM +0300, Andy Shevchenko wrote:
> > - why do you not drop tabspaces?
> >
> hmm, indeed, if i go into troubles to press ctrl-q tab, the same issue
> comes up.

I'm attaching the new patch to ignore the tab occurences in the command
prompt as well. Pressing Ctrl-q tab isn't a daily practise for a common
mc user, but it makes the patch more complete anyway, thanks.

Cheers,
Jindrich


-- 
Jindrich Novy <jnovy redhat com>, http://people.redhat.com/jnovy/

The worst evil in the world is refusal to think.
--- mc-4.6.1a/src/main.c.spaceprompt	2005-05-26 15:06:42.285109424 +0200
+++ mc-4.6.1a/src/main.c	2005-05-26 15:15:15.964018360 +0200
@@ -1490,9 +1491,15 @@ midnight_callback (struct Dlg_head *h, d
 	if (parm == '\t')
 	    free_completions (cmdline);
 
-	if (parm == '\n' && cmdline->buffer[0]) {
-	    send_message ((Widget *) cmdline, WIDGET_KEY, parm);
-	    return MSG_HANDLED;
+	if (parm == '\n') {
+	    for (i = 0; cmdline->buffer[i] && 
+	         (cmdline->buffer[i] == ' ' || cmdline->buffer[i] == '\t'); i++);
+	    if (cmdline->buffer[i]) {
+	        send_message ((Widget *) cmdline, WIDGET_KEY, parm);
+		return MSG_HANDLED;
+	    }
+	    stuff (cmdline, "", 0);
+	    cmdline->point = 0;
 	}
 
 	/* Ctrl-Enter and Alt-Enter */
@@ -1527,7 +1534,7 @@ midnight_callback (struct Dlg_head *h, d
 		    reverse_selection_cmd ();
 		    return MSG_HANDLED;
 		}
-	    } else if (!command_prompt || !strlen (cmdline->buffer)) {
+	    } else if (!command_prompt || !cmdline->buffer[0]) {
 		/* Special treatement '+', '-', '\', '*' only when this is 
 		 * first char on input line
 		 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]