Hi,

* Thorsten Haude wrote (2007-12-28 19:43):
>* Bert Wesarg wrote (2007-12-27 15:06):
>>Thorsten Haude wrote:
>>> * Bert Wesarg wrote (2007-08-07 22:24):
>>>> is it intended, that the AutoScroll feature do not work, if the target
>>>> position of a goto_matching() command is inside the VPadding area?
>>> 
>>> Nope, and it does work for a similar search selected, so it might be a
>>> bug. OTOH, what if the autoscroll would move the first position in the
>>> autoscroll area? That would make for a jumpy scrolling.
>>> 
>>It looks like I have the following patch in my tree since than:
>
>Looks like an oversight. I added the comment found at similar
>locations, please have a look.

Except that discus@ still does not accept patches.


Thorsten
-- 
"Yields falsehood when preceded by its quotation" yields falsehood when
preceded by its quotation.
Index: source/search.c
===================================================================
RCS file: /cvsroot/nedit/nedit/source/search.c,v
retrieving revision 1.86
diff --unified=5 -p -r1.86 search.c
--- source/search.c	2 Oct 2007 15:47:08 -0000	1.86
+++ source/search.c	28 Dec 2007 18:37:32 -0000
@@ -3419,12 +3419,20 @@ void SelectToMatchingCharacter(WindowInf
 	return;
     }
     startPos = (matchPos > selStart) ? selStart : matchPos;
     endPos = (matchPos > selStart) ? matchPos : selStart;
 
+    /* temporarily shut off autoShowInsertPos before setting the cursor
+       position so MakeSelectionVisible gets a chance to place the cursor
+       string at a pleasing position on the screen (otherwise, the cursor would
+       be automatically scrolled on screen and MakeSelectionVisible would do
+       nothing) */
+    XtVaSetValues(window->lastFocus, textNautoShowInsertPos, False, NULL);
     /* select the text between the matching characters */
     BufSelect(buf, startPos, endPos+1);
+    MakeSelectionVisible(window, window->lastFocus);
+    XtVaSetValues(window->lastFocus, textNautoShowInsertPos, True, NULL);
 }
 
 void GotoMatchingCharacter(WindowInfo *window)
 {
     int selStart, selEnd;

Attachment: pgpvUfXv313kO.pgp
Description: PGP signature

-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to