more Subject/From patch header stuff
[nedit-bw.git] / Scrolltip.patch
blob22aea9af94cc79bfbf66898afa437afbd6e8f516
1 From: Thorsten Haude <yoo@vranx.de>
2 Subject: Show the line number while scrolling with the scrollbar
4 ---
6 doc/help.etx | 6 +
7 source/calltips.c | 226 ++++++++++++++++++++++++++++++++++++++++++++-------
8 source/calltips.h | 5 +
9 source/preferences.c | 9 ++
10 source/preferences.h | 1
11 source/text.c | 5 -
12 source/text.h | 2
13 source/textDisp.c | 51 ++++++++++-
14 source/textDisp.h | 8 +
15 source/textP.h | 1
16 source/window.c | 1
17 11 files changed, 274 insertions(+), 41 deletions(-)
19 diff --quilt old/doc/help.etx new/doc/help.etx
20 --- old/doc/help.etx
21 +++ new/doc/help.etx
22 @@ -4609,10 +4609,16 @@ X Resources
24 **nc.timeOut**: 10
26 Basic time-out period used in communication with an NEdit server (seconds).
28 +**nedit.showScrolltip**: True
30 + If this resource is set to True, NEdit will show a tooltip displaying the
31 + line number if the user grabs and moves the scroll handle. Set to False to
32 + switch it off.
34 ----------------------------------------------------------------------
35 ~The following are Selected widget names (to which you may append~
36 ~.background, .foreground, .fontList, etc., to change colors, fonts~
37 ~ and other characteristics):~
39 diff --quilt old/source/calltips.c new/source/calltips.c
40 --- old/source/calltips.c
41 +++ new/source/calltips.c
42 @@ -48,10 +48,23 @@
43 #include "../debug.h"
44 #endif
46 static char *expandAllTabs( char *text, int tab_width );
48 +/* lowlevel tip functions */
49 +static Widget createTip(const char *name, Widget grandfather,
50 + Pixel foreground, Pixel background, unsigned char alignment);
51 +static Widget shellOfTip(Widget tip);
52 +static void setTipText(Widget tip, const char *text);
53 +static void showTip(Widget tip);
54 +static void hideTip(Widget tip);
55 +static void realizeTip(Widget tip);
56 +static void getTipMetrics(Widget tip,
57 + Position *widthPtr, Position *heightPtr,
58 + Position *borderWidthPtr);
59 +static void moveTip(Widget tip, Position x, Position y);
62 ** Pop-down a calltip if one exists, else do nothing
64 void KillCalltip(WindowInfo *window, int calltipID) {
65 textDisp *textD = ((TextWidget)window->lastFocus)->text.textD;
66 @@ -60,11 +73,11 @@ void KillCalltip(WindowInfo *window, int
68 void TextDKillCalltip(textDisp *textD, int calltipID) {
69 if( textD->calltip.ID == 0 )
70 return;
71 if( calltipID == 0 || calltipID == textD->calltip.ID ) {
72 - XtPopdown( textD->calltipShell );
73 + hideTip(textD->calltip.tip);
74 textD->calltip.ID = 0;
79 @@ -129,12 +142,11 @@ void TextDRedrawCalltip(textDisp *textD,
80 return;
82 rel_x = textD->calltip.pos;
85 - XtVaGetValues(textD->calltipShell, XmNwidth, &tipWidth, XmNheight,
86 - &tipHeight, XmNborderWidth, &borderWidth, NULL);
87 + getTipMetrics(textD->calltip.tip, &tipWidth, &tipHeight, &borderWidth);
88 rel_x += borderWidth;
89 rel_y += lineHeight/2 + borderWidth;
91 /* Adjust rel_x for horizontal alignment modes */
92 if (textD->calltip.hAlign == TIP_CENTER)
93 @@ -174,12 +186,12 @@ void TextDRedrawCalltip(textDisp *textD,
94 else if (abs_y >= screenAttr.height)
95 abs_y = screenAttr.height - tipHeight - CALLTIP_EDGE_GUARD;
96 /* If no case applied, just go with the default placement. */
100 - XtVaSetValues( textD->calltipShell, XmNx, abs_x, XmNy, abs_y, NULL );
102 + moveTip(textD->calltip.tip, abs_x, abs_y);
106 ** Returns a new string with each \t replaced with tab_width spaces or
107 ** a pointer to text if there were no tabs. Returns NULL on malloc failure.
108 @@ -243,45 +255,32 @@ int ShowCalltip(WindowInfo *window, char
110 /* Expand any tabs in the calltip and make it an XmString */
111 textCpy = expandAllTabs( text, BufGetTabDistance(textD->buffer) );
112 if( textCpy == NULL )
113 return 0; /* Out of memory */
114 - str = XmStringCreateLtoR(textCpy, XmFONTLIST_DEFAULT_TAG);
115 - if( textCpy != text )
116 - free( textCpy );
118 /* Get the location/dimensions of the text area */
119 XtVaGetValues(textD->w,
120 XmNx, &txtX,
121 XmNy, &txtY,
122 NULL);
124 /* Create the calltip widget on first request */
125 - if (textD->calltipW == NULL) {
126 - Arg args[10];
127 - int argcnt = 0;
128 - XtSetArg(args[argcnt], XmNsaveUnder, True); argcnt++;
129 - XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++;
131 - textD->calltipShell = CreatePopupShellWithBestVis("calltipshell",
132 - overrideShellWidgetClass, textD->w, args, argcnt);
134 - /* Might want to make this a read-only XmText eventually so that
135 - users can copy from it */
136 - textD->calltipW = XtVaCreateManagedWidget(
137 - "calltip", xmLabelWidgetClass, textD->calltipShell,
138 - XmNborderWidth, 1, /* Thin borders */
139 - XmNhighlightThickness, 0,
140 - XmNalignment, XmALIGNMENT_BEGINNING,
141 - XmNforeground, textD->calltipFGPixel,
142 - XmNbackground, textD->calltipBGPixel,
143 - NULL );
144 + if (textD->calltip.tip == NULL) {
145 + textD->calltip.tip = createTip("calltip", textD->w,
146 + textD->calltipFGPixel, textD->calltipBGPixel,
147 + XmALIGNMENT_BEGINNING);
148 + if (textD->calltip.tip == NULL) {
149 + return 0;
153 /* Set the text on the label */
154 - XtVaSetValues( textD->calltipW, XmNlabelString, str, NULL );
155 - XmStringFree( str );
156 + setTipText(textD->calltip.tip, textCpy);
157 + if (textCpy != text) {
158 + free(textCpy);
161 /* Figure out where to put the tip */
162 if (anchored) {
163 /* Put it at the specified position */
164 /* If position is not displayed, return 0 */
165 @@ -315,11 +314,176 @@ int ShowCalltip(WindowInfo *window, char
166 not unsigned, so have to work to keep it > 0 on overflow */
167 if(++StaticCalltipID <= 0)
168 StaticCalltipID = 1;
170 /* Realize the calltip's shell so that its width & height are known */
171 - XtRealizeWidget( textD->calltipShell );
172 + realizeTip(textD->calltip.tip);
173 /* Move the calltip and pop it up */
174 TextDRedrawCalltip(textD, 0);
175 - XtPopup( textD->calltipShell, XtGrabNone );
176 + showTip(textD->calltip.tip);
177 return textD->calltip.ID;
181 +** Pop up a scrolltip.
183 +Boolean TextDShowScrolltip(textDisp *textD, unsigned line, int x, int y,
184 + int align)
186 + Position w = 0;
187 + XmString str;
188 + char lineBuf[TYPE_INT_STR_SIZE(int)];
190 + if (NULL == textD->scrolltip) {
191 + textD->scrolltip = createTip("scrolltip", textD->w,
192 + textD->calltipFGPixel, textD->calltipBGPixel,
193 + XmALIGNMENT_CENTER);
194 + if (NULL == textD->scrolltip) {
195 + return False;
199 + /* Set the text on the tip's label. */
200 + sprintf(lineBuf, "%u", line);
201 + setTipText(textD->scrolltip, lineBuf);
203 + /* Realize the calltip's shell so that its width and height are known */
204 + realizeTip(textD->scrolltip);
206 + /* Get the width of the tip to right align it on the x position */
207 + if (SCROLLTIP_RIGHT == align) {
208 + getTipMetrics(textD->scrolltip, &w, NULL, NULL);
211 + /* Move the tip where it belongs and pop it up. */
212 + moveTip(textD->scrolltip, x - w, y);
213 + showTip(textD->scrolltip);
215 + return True;
219 +** Pop down scrolltip if it exists
221 +void TextDKillScrolltip(textDisp *textD)
223 + if (NULL != textD->scrolltip
224 + && NULL != shellOfTip(textD->scrolltip)) {
225 + hideTip(textD->scrolltip);
230 +** This creates a calltip of class XmLabel and its parent, a shell of class
231 +** OverrideShell (which in turn will be the child of the grandfather
232 +** parameter). The tip will have minimum size but will resize to match
233 +** the text entered (see XmNallowShellResize).
235 +** Color is picked by the two parameters foreground and background.
237 +** The alignment is one of XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER or
238 +** XmALIGNMENT_END, taken from the XmLabel class.
240 +** TODO: Some helper functions are still desirable to make this function
241 +** available from other parts of the code. At the moment the caller must
242 +** use calls to Motif/Intrinsics functions to handle it.
245 +static Widget createTip(const char *name, Widget grandfather,
246 + Pixel foreground, Pixel background, unsigned char alignment)
248 + Widget tip = NULL;
249 + Widget shell = NULL;
250 + Arg args[10];
251 + int argcnt = 0;
252 + char *shellNameBuf;
254 + shellNameBuf = XtMalloc(strlen(name) + strlen("shell") + 1);
255 + if (NULL == shellNameBuf) {
256 + fprintf(stderr, "nedit: Out of heap memory in createTip!\n");
257 + return NULL;
260 + strcpy(shellNameBuf, name);
261 + strcat(shellNameBuf, "shell");
263 + XtSetArg(args[argcnt], XmNsaveUnder, True); argcnt++;
264 + XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++;
266 + shell = CreatePopupShellWithBestVis(shellNameBuf,
267 + overrideShellWidgetClass, grandfather, args, argcnt);
269 + XtFree(shellNameBuf);
271 + /* Might want to make this a read-only XmText eventually so that
272 + users can copy from it */
273 + tip = XtVaCreateManagedWidget(name,
274 + xmLabelWidgetClass, shell,
275 + XmNborderWidth, 1, /* Thin borders */
276 + XmNhighlightThickness, 0,
277 + XmNalignment, XmALIGNMENT_BEGINNING,
278 + XmNforeground, foreground,
279 + XmNbackground, background,
280 + NULL);
282 + return tip;
285 +static Widget shellOfTip(Widget tip)
287 + return tip ? XtParent(tip) : NULL;
290 +static void setTipText(Widget tip, const char *text)
292 + XmString str;
294 + str = XmStringCreateLtoR((char *)text, XmFONTLIST_DEFAULT_TAG);
295 + XtVaSetValues(tip, XmNlabelString, str, NULL);
296 + XmStringFree(str);
299 +static void showTip(Widget tip)
301 + XtPopup(shellOfTip(tip), XtGrabNone);
304 +static void hideTip(Widget tip)
306 + XtPopdown(shellOfTip(tip));
309 +static void realizeTip(Widget tip)
311 + XtRealizeWidget(shellOfTip(tip));
314 +static void getTipMetrics(Widget tip,
315 + Position *widthPtr, Position *heightPtr,
316 + Position *borderWidthPtr)
318 + Position width, height, borderWidth;
320 + XtVaGetValues(shellOfTip(tip),
321 + XmNwidth, &width,
322 + XmNheight, &height,
323 + XmNborderWidth, &borderWidth,
324 + NULL);
326 + if (widthPtr) {
327 + *widthPtr = width;
329 + if (heightPtr) {
330 + *heightPtr = height;
332 + if (borderWidthPtr) {
333 + *borderWidthPtr = borderWidth;
337 +static void moveTip(Widget tip, Position x, Position y)
339 + XtVaSetValues(shellOfTip(tip),
340 + XmNx, x,
341 + XmNy, y,
342 + NULL);
344 diff --quilt old/source/textDisp.c new/source/textDisp.c
345 --- old/source/textDisp.c
346 +++ new/source/textDisp.c
347 @@ -195,11 +195,12 @@ textDisp *TextDCreate(Widget widget, Wid
348 Pixel selectFGPixel, Pixel selectBGPixel, Pixel highlightFGPixel,
349 Pixel highlightBGPixel, Pixel cursorFGPixel, Pixel lineNumFGPixel,
350 int continuousWrap, int wrapMargin, XmString bgClassString,
351 Pixel calltipFGPixel, Pixel calltipBGPixel,
352 Pixel cursorlineBGPixel, Boolean showCursorline,
353 - Pixel wrapMarginFGPixel, Boolean showWrapMargin)
354 + Pixel wrapMarginFGPixel, Boolean showWrapMargin,
355 + Boolean showScrolltip)
357 textDisp *textD;
358 XGCValues gcValues;
359 int i;
361 @@ -258,17 +259,16 @@ textDisp *TextDCreate(Widget widget, Wid
362 textD->nVisibleLines = (height - 1) / (textD->ascent + textD->descent) + 1;
363 gcValues.foreground = cursorFGPixel;
364 textD->cursorFGGC = XtGetGC(widget, GCForeground, &gcValues);
365 textD->lineStarts = (int *)XtMalloc(sizeof(int) * textD->nVisibleLines);
366 textD->lineStarts[0] = 0;
367 - textD->calltipW = NULL;
368 - textD->calltipShell = NULL;
369 + for (i=1; i<textD->nVisibleLines; i++)
370 + textD->lineStarts[i] = -1;
371 + textD->calltip.tip = NULL;
372 textD->calltip.ID = 0;
373 textD->calltipFGPixel = calltipFGPixel;
374 textD->calltipBGPixel = calltipBGPixel;
375 - for (i=1; i<textD->nVisibleLines; i++)
376 - textD->lineStarts[i] = -1;
377 textD->bgClassPixel = NULL;
378 textD->bgClass = NULL;
379 TextDSetupBGClasses(widget, bgClassString, &textD->bgClassPixel,
380 &textD->bgClass, bgPixel);
381 textD->suppressResync = 0;
382 @@ -277,10 +277,12 @@ textDisp *TextDCreate(Widget widget, Wid
383 textD->pointerHidden = False;
384 textD->graphicsExposeQueue = NULL;
385 textD->showCursorline = showCursorline;
386 textD->oldCursorPos = 0;
387 textD->oldLineStart = 0;
388 + textD->showScrolltip = showScrolltip;
389 + textD->scrolltip = NULL;
391 /* Attach an event handler to the widget so we can know the visibility
392 (used for choosing the fastest drawing method) */
393 XtAddEventHandler(widget, VisibilityChangeMask, False,
394 visibilityEH, textD);
395 @@ -3152,13 +3154,50 @@ static void redrawLineNumbers(textDisp *
396 static void vScrollCB(Widget w, XtPointer clientData, XtPointer callData)
398 textDisp *textD = (textDisp *)clientData;
399 int newValue = ((XmScrollBarCallbackStruct *)callData)->value;
400 int lineDelta = newValue - textD->topLineNum;
401 + int reason = ((XmScrollBarCallbackStruct *)callData)->reason;
403 - if (lineDelta == 0)
404 + if (lineDelta == 0) {
405 + TextDKillScrolltip(textD);
406 return;
409 + /* lineDelta is always != 0 for XmCR_DRAG */
410 + /* Scrolltip does not work for continuous wrap. The only way to get the
411 + line number is through textDisp->absTopLineNum, but this value is very
412 + inaccurate for large files. So no tip. */
413 + if (XmCR_DRAG == reason
414 + && !textD->continuousWrap
415 + && textD->showScrolltip) {
416 + /* Display a scrolltip showing the line number about one third down
417 + from the top, the position a search jumps to. */
418 + XEvent *event = ((XmScrollBarCallbackStruct *)callData)->event;
419 + XMotionEvent *motionEvent = (XMotionEvent *)event;
420 + unsigned char placement = -1;
421 + int align = SCROLLTIP_RIGHT;
422 + Dimension w = 0;
423 + Dimension margin = 4;
425 + XtVaGetValues(XtParent(XtParent(textD->w)),
426 + XmNscrollBarPlacement, &placement,
427 + NULL);
428 + if (XmBOTTOM_LEFT == placement || XmTOP_LEFT == placement) {
429 + XtVaGetValues(textD->vScrollBar, XmNwidth, &w, NULL);
430 + align = SCROLLTIP_LEFT;
431 + w += margin;
432 + } else {
433 + /* SCROLLTIP_RIGHT */
434 + w -= margin;
437 + TextDShowScrolltip(textD, newValue + (textD->nVisibleLines / 3),
438 + motionEvent->x_root - motionEvent->x + w,
439 + motionEvent->y_root, align);
442 setScroll(textD, newValue, textD->horizOffset, False, True);
444 static void hScrollCB(Widget w, XtPointer clientData, XtPointer callData)
446 textDisp *textD = (textDisp *)clientData;
447 diff --quilt old/source/textDisp.h new/source/textDisp.h
448 --- old/source/textDisp.h
449 +++ new/source/textDisp.h
450 @@ -65,10 +65,11 @@ typedef struct graphicExposeTranslationE
451 } graphicExposeTranslationEntry;
453 typedef void (*unfinishedStyleCBProc)();
455 typedef struct _calltipStruct {
456 + Widget tip; /* this tip widget */
457 int ID; /* ID of displayed calltip. Equals
458 zero if none is displayed. */
459 Boolean anchored; /* Is it anchored to a position */
460 int pos; /* Position tip is anchored to */
461 int hAlign; /* horizontal alignment */
462 @@ -145,12 +146,10 @@ typedef struct _textDisp {
463 Pixel cursorFGPixel;
464 Pixel cursorlineBGPixel;
465 Pixel *bgClassPixel; /* table of colors for each BG class */
466 unsigned char *bgClass; /* obtains index into bgClassPixel[] */
468 - Widget calltipW; /* The Label widget for the calltip */
469 - Widget calltipShell; /* The Shell that holds the calltip */
470 calltipStruct calltip; /* The info for the calltip itself */
471 Pixel calltipFGPixel;
472 Pixel calltipBGPixel;
473 Pixel wrapMarginFGPixel; /* color for drawing wrap margin */
474 GC wrapMarginGC; /* GC for drawing wrap margin */
475 @@ -166,10 +165,12 @@ typedef struct _textDisp {
476 hidden */
477 graphicExposeTranslationEntry *graphicsExposeQueue;
478 int oldCursorPos;
479 int oldLineStart;
480 Boolean showCursorline;
481 + Boolean showScrolltip;
482 + Widget scrolltip;
483 } textDisp;
485 textDisp *TextDCreate(Widget widget, Widget hScrollBar, Widget vScrollBar,
486 Position left, Position top, Position width, Position height,
487 Position lineNumLeft, Position lineNumWidth, textBuffer *buffer,
488 @@ -177,11 +178,12 @@ textDisp *TextDCreate(Widget widget, Wid
489 Pixel selectFGPixel, Pixel selectBGPixel, Pixel highlightFGPixel,
490 Pixel highlightBGPixel, Pixel cursorFGPixel, Pixel lineNumFGPixel,
491 int continuousWrap, int wrapMargin, XmString bgClassString,
492 Pixel calltipFGPixel, Pixel calltipBGPixel,
493 Pixel cursorlineBGPixel, Boolean showCursorline,
494 - Pixel wrapMarginFGPixel, Boolean showWrapMargin);
495 + Pixel wrapMarginFGPixel, Boolean showWrapMargin,
496 + Boolean showScrolltip);
497 void TextDFree(textDisp *textD);
498 void TextDSetBuffer(textDisp *textD, textBuffer *buffer);
499 void TextDAttachHighlightData(textDisp *textD, textBuffer *styleBuffer,
500 styleTableEntry *styleTable, int nStyles, char unfinishedStyle,
501 unfinishedStyleCBProc unfinishedHighlightCB, void *cbArg);
502 diff --quilt old/source/textP.h new/source/textP.h
503 --- old/source/textP.h
504 +++ new/source/textP.h
505 @@ -77,10 +77,11 @@ typedef struct _TextPart {
506 int rows, columns;
507 int marginWidth, marginHeight;
508 int cursorBlinkRate;
509 int wrapMargin;
510 Boolean showWrapMargin;
511 + Boolean showScrolltip;
512 int emulateTabs;
513 int lineNumCols;
514 char *delimiters;
515 Cardinal cursorVPadding;
516 Widget hScrollBar, vScrollBar;
517 diff --quilt old/source/text.c new/source/text.c
518 --- old/source/text.c
519 +++ new/source/text.c
520 @@ -716,10 +716,12 @@ static XtResource resources[] = {
521 NULL},
522 {textNcursorVPadding, textCCursorVPadding, XtRCardinal, sizeof(Cardinal),
523 XtOffset(TextWidget, text.cursorVPadding), XmRString, "0"},
524 {textNshowCursorline, textCshowCursorline, XmRBoolean, sizeof(Boolean),
525 XtOffset(TextWidget, text.showCursorline), XmRString, "False"},
526 + {textNshowScrolltip, textCshowScrolltip, XmRBoolean, sizeof(Boolean),
527 + XtOffset(TextWidget, text.showScrolltip), XmRString, "False"},
530 static TextClassRec textClassRec = {
531 /* CoreClassPart */
533 @@ -835,11 +837,12 @@ static void initialize(TextWidget reques
534 new->text.lineNumFGPixel,
535 new->text.continuousWrap, new->text.wrapMargin,
536 new->text.backlightCharTypes, new->text.calltipFGPixel,
537 new->text.calltipBGPixel,
538 new->text.cursorlineBGPixel, new->text.showCursorline,
539 - new->text.wrapMarginFGPixel, new->text.showWrapMargin);
540 + new->text.wrapMarginFGPixel, new->text.showWrapMargin,
541 + new->text.showScrolltip);
543 /* Add mandatory delimiters blank, tab, and newline to the list of
544 delimiters. The memory use scheme here is that new values are
545 always copied, and can therefore be safely freed on subsequent
546 set-values calls or destroy */
547 diff --quilt old/source/text.h new/source/text.h
548 --- old/source/text.h
549 +++ new/source/text.h
550 @@ -119,10 +119,12 @@
551 #define textCCursorVPadding "CursorVPadding"
552 #define textNbacklightCharTypes "backlightCharTypes"
553 #define textCBacklightCharTypes "BacklightCharTypes"
554 #define textNshowCursorline "showCursorline"
555 #define textCshowCursorline "ShowCursorline"
556 +#define textNshowScrolltip "showScrolltip"
557 +#define textCshowScrolltip "ShowScrolltip"
560 extern WidgetClass textWidgetClass;
562 struct _TextClassRec;
563 diff --quilt old/source/calltips.h new/source/calltips.h
564 --- old/source/calltips.h
565 +++ new/source/calltips.h
566 @@ -36,14 +36,19 @@
569 enum TipHAlignMode {TIP_LEFT, TIP_CENTER, TIP_RIGHT};
570 enum TipVAlignMode {TIP_ABOVE, TIP_BELOW};
571 enum TipAlignStrict {TIP_SLOPPY, TIP_STRICT};
572 +enum ScrolltipAlignMode {SCROLLTIP_LEFT, SCROLLTIP_RIGHT};
574 int ShowCalltip(WindowInfo *window, char *text, Boolean anchored,
575 int pos, int hAlign, int vAlign, int alignMode);
576 void KillCalltip(WindowInfo *window, int calltipID);
577 void TextDKillCalltip(textDisp *textD, int calltipID);
578 int GetCalltipID(WindowInfo *window, int calltipID);
579 void TextDRedrawCalltip(textDisp *textD, int calltipID);
581 +Boolean TextDShowScrolltip(textDisp *textD, unsigned line, int x, int y,
582 + int align);
583 +void TextDKillScrolltip(textDisp *textD);
585 #endif /* ifndef NEDIT_CALLTIPS_H_INCLUDED */
586 diff --quilt old/source/preferences.c new/source/preferences.c
587 --- old/source/preferences.c
588 +++ new/source/preferences.c
589 @@ -333,10 +333,11 @@ static struct prefData {
590 int showCursorline;
591 int focusOnRaise;
592 Boolean honorSymlinks;
593 int truncSubstitution;
594 Boolean forceOSConversion;
595 + Boolean showScrolltip;
596 } PrefData;
598 /* Temporary storage for preferences strings which are discarded after being
599 read */
600 static struct {
601 @@ -1096,10 +1097,12 @@ static PrefDescripRec PrefDescrip[] = {
602 &PrefData.truncSubstitution, TruncSubstitutionModes, False},
603 {"honorSymlinks", "HonorSymlinks", PREF_BOOLEAN, "True",
604 &PrefData.honorSymlinks, NULL, False},
605 {"showCursorline", "ShowCursorline", PREF_BOOLEAN, "True",
606 &PrefData.showCursorline, NULL, True},
607 +// {"showScrolltip", "ShowScrolltip", PREF_BOOLEAN, "True",
608 +// &PrefData.showScrolltip, NULL, False},
611 static XrmOptionDescRec OpTable[] = {
612 {"-wrap", ".autoWrap", XrmoptionNoArg, (caddr_t)"Continuous"},
613 {"-nowrap", ".autoWrap", XrmoptionNoArg, (caddr_t)"None"},
614 @@ -2237,10 +2240,16 @@ void SetPrefShowCursorline(Boolean value
615 Boolean GetPrefShowCursorline(void)
617 return PrefData.showCursorline;
620 +Boolean GetPrefShowScrolltip(void)
622 + //return PrefData.showScrolltip;
623 + return True;
627 ** If preferences don't get saved, ask the user on exit whether to save
629 void MarkPrefsChanged(void)
631 diff --quilt old/source/window.c new/source/window.c
632 --- old/source/window.c
633 +++ new/source/window.c
634 @@ -2314,10 +2314,11 @@ static Widget createTextArea(Widget pare
635 textNcontinuousWrap, window->wrapMode == CONTINUOUS_WRAP,
636 textNoverstrike, window->overstrike,
637 textNhidePointer, (Boolean) GetPrefTypingHidesPointer(),
638 textNcursorVPadding, GetVerticalAutoScroll(),
639 textNshowCursorline, False,
640 + textNshowScrolltip, GetPrefShowScrolltip(),
641 NULL);
643 XtVaSetValues(sw, XmNworkWindow, frame, XmNhorizontalScrollBar,
644 hScrollBar, XmNverticalScrollBar, vScrollBar, NULL);
646 diff --quilt old/source/preferences.h new/source/preferences.h
647 --- old/source/preferences.h
648 +++ new/source/preferences.h
649 @@ -215,7 +215,8 @@ void SetPrefOpenInTab(int state);
650 Boolean GetPrefUndoModifiesSelection(void);
651 Boolean GetPrefFocusOnRaise(void);
652 Boolean GetPrefHonorSymlinks(void);
653 Boolean GetPrefForceOSConversion(void);
654 void SetPrefFocusOnRaise(Boolean);
655 +Boolean GetPrefShowScrolltip(void);
657 #endif /* NEDIT_PREFERENCES_H_INCLUDED */