refresh InterpretDebug5.diff
[nedit-bw.git] / dont-resize-window.patch
blob6012b3d96450853d670153bd1f9748b0a41eb68a
1 Subject: option for disabling automatic resizing of the window
3 ---
5 source/preferences.c | 8 ++++++++
6 source/preferences.h | 1 +
7 source/window.c | 2 +-
8 3 files changed, 10 insertions(+), 1 deletion(-)
10 diff --quilt old/source/preferences.c new/source/preferences.c
11 --- old/source/preferences.c
12 +++ new/source/preferences.c
13 @@ -371,6 +371,7 @@ static struct prefData {
14 int bgMenuColorLength;
15 char transMenuColor[MAX_COLOR_LENGTH];
16 int transMenuColorLength;
17 + Boolean resizeWindow;
18 } PrefData;
20 /* Temporary storage for preferences strings which are discarded after being
21 @@ -1217,6 +1218,8 @@ static PrefDescripRec PrefDescrip[] = {
22 PrefData.bgMenuColor, (void *)sizeof(PrefData.bgMenuColor), False},
23 {"transientWinMenuColor", "TransientWinMenuColor", PREF_STRING, "yellow",
24 PrefData.transMenuColor, (void *)sizeof(PrefData.transMenuColor), False},
25 + {"resizeWindow", "ResizeWindow", PREF_BOOLEAN, "True",
26 + &PrefData.resizeWindow, NULL, False},
29 static XrmOptionDescRec OpTable[] = {
30 @@ -2449,6 +2452,11 @@ int GetPrefZeroSizedMode(void)
31 return PrefData.zeroSizedMode;
34 +Boolean GetPrefResizeWindow(void)
36 + return (Boolean)PrefData.resizeWindow;
40 ** If preferences don't get saved, ask the user on exit whether to save
42 diff --quilt old/source/preferences.h new/source/preferences.h
43 --- old/source/preferences.h
44 +++ new/source/preferences.h
45 @@ -231,5 +231,6 @@ void SetPrefHardlinkMode(int mode);
46 int GetPrefHardlinkMode(void);
47 void SetPrefZeroSizedMode(int mode);
48 int GetPrefZeroSizedMode(void);
49 +Boolean GetPrefResizeWindow(void);
51 #endif /* NEDIT_PREFERENCES_H_INCLUDED */
52 diff --quilt old/source/window.c new/source/window.c
53 --- old/source/window.c
54 +++ new/source/window.c
55 @@ -2778,7 +2778,7 @@ static int updateGutterWidth(WindowInfo*
59 - if (reqCols != maxCols) {
60 + if (reqCols != maxCols && GetPrefResizeWindow()) {
61 XFontStruct *fs;
62 Dimension windowWidth;
63 short fontWidth;