jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: regexp-replace bug (was: pre-release version of 0.99-17 available)


Another problem: forward_paragraph() function in 0.99-17 does not go to
eol when the last line does not have an newline.  This breaks my 'subpar'
paragraph reformatter.  So here's the patch.

--- jed-B0.99-17-orig/src/text.c	Wed Jun 16 17:08:33 2004
+++ jed-B0.99-17/src/text.c	Tue Jun 29 08:26:16 2004
@@ -219,11 +219,25 @@ int forward_paragraph(void) /*{{{*/
    if (NULL == CBuf->par_sep)
      CBuf->par_sep = SLang_get_function("is_paragraph_separator");
 
+   if (jed_down (1))
+     {
+	if (is_paragraph_sep ())
+	  return(1);
+     }
+   else
+     {
+	eol ();
+	return(1);
+     }
+   
    while (jed_down (1)
 	  && (0 == is_paragraph_sep ()))
      ;
 
    /* was: eol(); */
+   /* if last line has no newline at end, go to eol*/
+   if (CLine == CBuf->end && 0 == is_paragraph_sep ())
+     eol();
    return(1);
 }
 

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]