• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisione1f4e9d78a6ad3409d6b040a70872492e661864b (tree)
Zeit2019-12-03 07:00:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.1.2383: using old C style comments

Commit: https://github.com/vim/vim/commit/734a867ffe198886da7365b618be67ab8ed9d9f6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 2 22:49:38 2019 +0100

patch 8.1.2383: using old C style comments
Problem: Using old C style comments.
Solution: Use // comments where appropriate.

Ändern Zusammenfassung

Diff

diff -r 06ed2fe62dce -r e1f4e9d78a6a src/gui_mac.c
--- a/src/gui_mac.c Mon Dec 02 21:45:05 2019 +0100
+++ b/src/gui_mac.c Mon Dec 02 23:00:04 2019 +0100
@@ -28,25 +28,26 @@
2828 *
2929 */
3030
31-/* TODO (Jussi)
31+/*
32+ * TODO (Jussi)
3233 * * Clipboard does not work (at least some cases)
3334 * * ATSU font rendering has some problems
3435 * * Investigate and remove dead code (there is still lots of that)
3536 */
3637
37-#include <Devices.h> /* included first to avoid CR problems */
38+#include <Devices.h> // included first to avoid CR problems
3839 #include "vim.h"
3940
4041 #define USE_CARBONIZED
41-#define USE_AEVENT /* Enable AEVENT */
42-#undef USE_OFFSETED_WINDOW /* Debugging feature: start Vim window OFFSETed */
43-
44-/* Compile as CodeWarrior External Editor */
42+#define USE_AEVENT // Enable AEVENT
43+#undef USE_OFFSETED_WINDOW // Debugging feature: start Vim window OFFSETed
44+
45+// Compile as CodeWarrior External Editor
4546 #if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT)
46-# define USE_AEVENT /* Need Apple Event Support */
47+# define USE_AEVENT // Need Apple Event Support
4748 #endif
4849
49-/* Vim's Scrap flavor. */
50+// Vim's Scrap flavor.
5051 #define VIMSCRAPFLAVOR 'VIM!'
5152 #define SCRAPTEXTFLAVOR kScrapFlavorTypeUnicode
5253
@@ -58,7 +59,7 @@
5859
5960 static int im_is_active = FALSE;
6061 # if 0
61- /* TODO: Implement me! */
62+ // TODO: Implement me!
6263 static int im_start_row = 0;
6364 static int im_start_col = 0;
6465 # endif
@@ -86,7 +87,7 @@
8687 #endif
8788
8889
89-/* Include some file. TODO: move into os_mac.h */
90+// Include some file. TODO: move into os_mac.h
9091 #include <Menus.h>
9192 #include <Resources.h>
9293 #include <Processes.h>
@@ -97,13 +98,13 @@
9798 # include <Gestalt.h>
9899 #if UNIVERSAL_INTERFACES_VERSION >= 0x0330
99100 # include <ControlDefinitions.h>
100-# include <Navigation.h> /* Navigation only part of ?? */
101+# include <Navigation.h> // Navigation only part of ??
101102 #endif
102103
103-/* Help Manager (balloon.h, HM prefixed functions) are not supported
104- * under Carbon (Jussi) */
104+// Help Manager (balloon.h, HM prefixed functions) are not supported
105+// under Carbon (Jussi)
105106 # if 0
106-/* New Help Interface for Mac, not implemented yet.*/
107+// New Help Interface for Mac, not implemented yet.
107108 # include <MacHelp.h>
108109 # endif
109110
@@ -112,7 +113,7 @@
112113 * headers? (Jussi)
113114 */
114115 #define kNothing 0
115-#define kCreateEmpty 2 /*1*/
116+#define kCreateEmpty 2 //1
116117 #define kCreateRect 2
117118 #define kDestroy 3
118119
@@ -123,34 +124,33 @@
123124 #define botRight(r) (((Point*)&(r))[1])
124125
125126
126-/* Time of last mouse click, to detect double-click */
127+// Time of last mouse click, to detect double-click
127128 static long lastMouseTick = 0;
128129
129-/* ??? */
130+// ???
130131 static RgnHandle cursorRgn;
131132 static RgnHandle dragRgn;
132133 static Rect dragRect;
133134 static short dragRectEnbl;
134135 static short dragRectControl;
135136
136-/* This variable is set when waiting for an event, which is the only moment
137- * scrollbar dragging can be done directly. It's not allowed while commands
138- * are executed, because it may move the cursor and that may cause unexpected
139- * problems (e.g., while ":s" is working).
140- */
137+// This variable is set when waiting for an event, which is the only moment
138+// scrollbar dragging can be done directly. It's not allowed while commands
139+// are executed, because it may move the cursor and that may cause unexpected
140+// problems (e.g., while ":s" is working).
141141 static int allow_scrollbar = FALSE;
142142
143-/* Last mouse click caused contextual menu, (to provide proper release) */
143+// Last mouse click caused contextual menu, (to provide proper release)
144144 static short clickIsPopup;
145145
146-/* Feedback Action for Scrollbar */
146+// Feedback Action for Scrollbar
147147 ControlActionUPP gScrollAction;
148148 ControlActionUPP gScrollDrag;
149149
150-/* Keeping track of which scrollbar is being dragged */
150+// Keeping track of which scrollbar is being dragged
151151 static ControlHandle dragged_sb = NULL;
152152
153-/* Vector of char_u --> control index for hotkeys in dialogs */
153+// Vector of char_u --> control index for hotkeys in dialogs
154154 static short *gDialogHotKeys;
155155
156156 static struct
@@ -170,23 +170,23 @@
170170 UInt32 useAntialias_cached = 0x0;
171171 #endif
172172
173-/* Colors Macros */
173+// Colors Macros
174174 #define RGB(r,g,b) ((r) << 16) + ((g) << 8) + (b)
175175 #define Red(c) ((c & 0x00FF0000) >> 16)
176176 #define Green(c) ((c & 0x0000FF00) >> 8)
177177 #define Blue(c) ((c & 0x000000FF) >> 0)
178178
179-/* Key mapping */
180-
181-#define vk_Esc 0x35 /* -> 1B */
182-
183-#define vk_F1 0x7A /* -> 10 */
184-#define vk_F2 0x78 /*0x63*/
185-#define vk_F3 0x63 /*0x76*/
186-#define vk_F4 0x76 /*0x60*/
187-#define vk_F5 0x60 /*0x61*/
188-#define vk_F6 0x61 /*0x62*/
189-#define vk_F7 0x62 /*0x63*/ /*?*/
179+// Key mapping
180+
181+#define vk_Esc 0x35 // -> 1B
182+
183+#define vk_F1 0x7A // -> 10
184+#define vk_F2 0x78 //0x63
185+#define vk_F3 0x63 //0x76
186+#define vk_F4 0x76 //0x60
187+#define vk_F5 0x60 //0x61
188+#define vk_F6 0x61 //0x62
189+#define vk_F7 0x62 //0x63 ?
190190 #define vk_F8 0x64
191191 #define vk_F9 0x65
192192 #define vk_F10 0x6D
@@ -196,26 +196,26 @@
196196 #define vk_F14 0x6B
197197 #define vk_F15 0x71
198198
199-#define vk_Clr 0x47 /* -> 1B (ESC) */
200-#define vk_Enter 0x4C /* -> 03 */
201-
202-#define vk_Space 0x31 /* -> 20 */
203-#define vk_Tab 0x30 /* -> 09 */
204-#define vk_Return 0x24 /* -> 0D */
205-/* This is wrong for OSX, what is it for? */
206-#define vk_Delete 0X08 /* -> 08 BackSpace */
207-
208-#define vk_Help 0x72 /* -> 05 */
209-#define vk_Home 0x73 /* -> 01 */
210-#define vk_PageUp 0x74 /* -> 0D */
211-#define vk_FwdDelete 0x75 /* -> 7F */
212-#define vk_End 0x77 /* -> 04 */
213-#define vk_PageDown 0x79 /* -> 0C */
214-
215-#define vk_Up 0x7E /* -> 1E */
216-#define vk_Down 0x7D /* -> 1F */
217-#define vk_Left 0x7B /* -> 1C */
218-#define vk_Right 0x7C /* -> 1D */
199+#define vk_Clr 0x47 // -> 1B (ESC)
200+#define vk_Enter 0x4C // -> 03
201+
202+#define vk_Space 0x31 // -> 20
203+#define vk_Tab 0x30 // -> 09
204+#define vk_Return 0x24 // -> 0D
205+// This is wrong for OSX, what is it for?
206+#define vk_Delete 0X08 // -> 08 BackSpace
207+
208+#define vk_Help 0x72 // -> 05
209+#define vk_Home 0x73 // -> 01
210+#define vk_PageUp 0x74 // -> 0D
211+#define vk_FwdDelete 0x75 // -> 7F
212+#define vk_End 0x77 // -> 04
213+#define vk_PageDown 0x79 // -> 0C
214+
215+#define vk_Up 0x7E // -> 1E
216+#define vk_Down 0x7D // -> 1F
217+#define vk_Left 0x7B // -> 1C
218+#define vk_Right 0x7C // -> 1D
219219
220220 #define vk_Undo vk_F1
221221 #define vk_Cut vk_F2
@@ -258,22 +258,22 @@
258258 {vk_F14, 'F', '4'},
259259 {vk_F15, 'F', '5'},
260260
261-/* {XK_Help, '%', '1'}, */
262-/* {XK_Undo, '&', '8'}, */
263-/* {XK_BackSpace, 'k', 'b'}, */
264-/* {vk_Delete, 'k', 'b'}, */
261+// {XK_Help, '%', '1'},
262+// {XK_Undo, '&', '8'},
263+// {XK_BackSpace, 'k', 'b'},
264+// {vk_Delete, 'k', 'b'},
265265 {vk_Insert, 'k', 'I'},
266266 {vk_FwdDelete, 'k', 'D'},
267267 {vk_Home, 'k', 'h'},
268268 {vk_End, '@', '7'},
269-/* {XK_Prior, 'k', 'P'}, */
270-/* {XK_Next, 'k', 'N'}, */
271-/* {XK_Print, '%', '9'}, */
269+// {XK_Prior, 'k', 'P'},
270+// {XK_Next, 'k', 'N'},
271+// {XK_Print, '%', '9'},
272272
273273 {vk_PageUp, 'k', 'P'},
274274 {vk_PageDown, 'k', 'N'},
275275
276- /* End of list marker: */
276+ // End of list marker:
277277 {(KeySym)0, 0, 0}
278278 };
279279
@@ -321,7 +321,7 @@
321321
322322 len = STRLEN(Cstring);
323323
324- if (len > 255) /* Truncate if necessary */
324+ if (len > 255) // Truncate if necessary
325325 len = 255;
326326
327327 PascalString = alloc(len + 1);
@@ -351,7 +351,7 @@
351351
352352 len = STRLEN(Cstring);
353353
354- if (len > 255) /* Truncate if necessary */
354+ if (len > 255) // Truncate if necessary
355355 len = 255;
356356
357357 PascalString = alloc(len + 1);
@@ -387,8 +387,8 @@
387387 if (macModifiers & (optionKey | rightOptionKey))
388388 vimModifiers |= MOUSE_ALT;
389389 #if 0
390- /* Not yet supported */
391- if (macModifiers & (cmdKey)) /* There's no rightCmdKey */
390+ // Not yet supported
391+ if (macModifiers & (cmdKey)) // There's no rightCmdKey
392392 vimModifiers |= MOUSE_CMD;
393393 #endif
394394 return (vimModifiers);
@@ -410,13 +410,14 @@
410410 if (macModifiers & (optionKey | rightOptionKey))
411411 vimModifiers |= MOD_MASK_ALT;
412412 #ifdef USE_CMD_KEY
413- if (macModifiers & (cmdKey)) /* There's no rightCmdKey */
413+ if (macModifiers & (cmdKey)) // There's no rightCmdKey
414414 vimModifiers |= MOD_MASK_CMD;
415415 #endif
416416 return (vimModifiers);
417417 }
418418
419-/* Convert a string representing a point size into pixels. The string should
419+/*
420+ * Convert a string representing a point size into pixels. The string should
420421 * be a positive decimal number, with an optional decimal point (eg, "12", or
421422 * "10.5"). The pixel value is returned, and a pointer to the next unconverted
422423 * character is stored in *end. The flag "vertical" says whether this
@@ -435,7 +436,7 @@
435436 {
436437 if (*str == '.' && divisor == 0)
437438 {
438- /* Start keeping a divisor, for later */
439+ // Start keeping a divisor, for later
439440 divisor = 1;
440441 continue;
441442 }
@@ -479,8 +480,8 @@
479480
480481 if (name)
481482 {
482- /* Simple mnemonic-removal algorithm, assumes single parenthesized
483- * mnemonic character towards the end of the menu text */
483+ // Simple mnemonic-removal algorithm, assumes single parenthesized
484+ // mnemonic character towards the end of the menu text
484485 mnemonicStart = CFStringFind(name, CFSTR("("), kCFCompareBackwards);
485486 displayLen = CFStringGetLength(name);
486487
@@ -530,33 +531,33 @@
530531 AEKeyword dummyKeyword;
531532 DescType dummyType;
532533
533- /* Get number of files in list */
534+ // Get number of files in list
534535 *error = AECountItems(theList, numFiles);
535536 if (*error)
536537 return fnames;
537538
538- /* Allocate the pointer list */
539+ // Allocate the pointer list
539540 fnames = ALLOC_MULT(char_u *, *numFiles);
540541
541- /* Empty out the list */
542+ // Empty out the list
542543 for (fileCount = 0; fileCount < *numFiles; fileCount++)
543544 fnames[fileCount] = NULL;
544545
545- /* Scan the list of FSSpec */
546+ // Scan the list of FSSpec
546547 for (fileCount = 1; fileCount <= *numFiles; fileCount++)
547548 {
548- /* Get the alias for the nth file, convert to an FSSpec */
549+ // Get the alias for the nth file, convert to an FSSpec
549550 newError = AEGetNthPtr(theList, fileCount, typeFSS,
550551 &dummyKeyword, &dummyType,
551552 (Ptr) &fileToOpen, sizeof(FSSpec), &actualSize);
552553 if (newError)
553554 {
554- /* Caller is able to clean up */
555- /* TODO: Should be clean up or not? For safety. */
555+ // Caller is able to clean up
556+ // TODO: Should be clean up or not? For safety.
556557 return fnames;
557558 }
558559
559- /* Convert the FSSpec to a pathname */
560+ // Convert the FSSpec to a pathname
560561 fnames[fileCount - 1] = FullPathFromFSSpec_save(fileToOpen);
561562 }
562563
@@ -595,7 +596,7 @@
595596 */
596597
597598 typedef struct WindowSearch WindowSearch;
598-struct WindowSearch /* for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar*/
599+struct WindowSearch // for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar
599600 {
600601 FSSpec theFile; // identifies the file
601602 long *theDate; // where to put the modification date/time
@@ -668,7 +669,7 @@
668669 */
669670
670671 typedef struct ModificationInfo ModificationInfo;
671-struct ModificationInfo /* for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList*/
672+struct ModificationInfo // for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList
672673 {
673674 FSSpec theFile; // identifies the file
674675 long theDate; // the date/time the file was last modified
@@ -693,11 +694,11 @@
693694 if (error)
694695 return error;
695696
696- /* Send the reply */
697-/* replyObject.descriptorType = typeNull;
698- replyObject.dataHandle = nil;*/
699-
700-/* AECreateDesc(typeChar, (Ptr)&title[1], title[0], &data) */
697+ // Send the reply
698+// replyObject.descriptorType = typeNull;
699+// replyObject.dataHandle = nil;
700+
701+// AECreateDesc(typeChar, (Ptr)&title[1], title[0], &data)
701702 error = AECreateList(nil, 0, false, &replyList);
702703 if (error)
703704 return error;
@@ -705,22 +706,21 @@
705706 #if 0
706707 error = AECountItems(&replyList, &numFiles);
707708
708- /* AEPutKeyDesc(&replyList, keyAEPnject, &aDesc)
709- * AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType,
710- * sizeof(DescType))
711- */
712-
713- /* AEPutDesc */
709+ // AEPutKeyDesc(&replyList, keyAEPnject, &aDesc)
710+ // AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType,
711+ // sizeof(DescType))
712+
713+ // AEPutDesc
714714 #endif
715715
716716 numFiles = 0;
717717 FOR_ALL_BUFFERS(buf)
718718 if (buf->b_ml.ml_mfp != NULL)
719719 {
720- /* Add this file to the list */
720+ // Add this file to the list
721721 theFile.theFile = buf->b_FSSpec;
722722 theFile.theDate = buf->b_mtime;
723-/* theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0; */
723+// theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0;
724724 error = AEPutPtr(&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile));
725725 };
726726
@@ -728,7 +728,7 @@
728728 error = AECountItems(&replyList, &numFiles);
729729 #endif
730730
731- /* We can add data only if something to reply */
731+ // We can add data only if something to reply
732732 error = AEPutParamDesc(theReply, keyDirectObject, &replyList);
733733
734734 if (replyList.dataHandle)
@@ -764,12 +764,12 @@
764764 */
765765
766766 typedef struct CW_GetText CW_GetText;
767-struct CW_GetText /* for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar*/
768-{
769- FSSpec theFile; /* identifies the file */
770- Handle theText; /* the location where you return the text (must be resized properly) */
771- long *unused; /* 0 (not used) */
772- long *theDate; /* where to put the modification date/time */
767+struct CW_GetText // for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar
768+{
769+ FSSpec theFile; // identifies the file
770+ Handle theText; // the location where you return the text (must be resized properly)
771+ long *unused; // 0 (not used)
772+ long *theDate; // where to put the modification date/time
773773 };
774774
775775 pascal OSErr
@@ -806,19 +806,19 @@
806806
807807 if (foundFile)
808808 {
809- BufferSize = 0; /* GetHandleSize(GetTextData.theText); */
809+ BufferSize = 0; // GetHandleSize(GetTextData.theText);
810810 for (lineno = 0; lineno <= buf->b_ml.ml_line_count; lineno++)
811811 {
812- /* Must use the right buffer */
812+ // Must use the right buffer
813813 line = ml_get_buf(buf, (linenr_T) lineno, FALSE);
814814 linesize = STRLEN(line) + 1;
815815 lineStart = BufferSize;
816816 BufferSize += linesize;
817- /* Resize handle to linesize+1 to include the linefeed */
817+ // Resize handle to linesize+1 to include the linefeed
818818 SetHandleSize(GetTextData.theText, BufferSize);
819819 if (GetHandleSize(GetTextData.theText) != BufferSize)
820820 {
821- break; /* Simple handling for now */
821+ break; // Simple handling for now
822822 }
823823 else
824824 {
@@ -838,7 +838,7 @@
838838 if (foundFile == false)
839839 *GetTextData.theDate = fnfErr;
840840 else
841-/* *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0;*/
841+// *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0;
842842 *GetTextData.theDate = buf->b_mtime;
843843 }
844844
@@ -851,7 +851,9 @@
851851 *
852852 */
853853
854-/* Taken from MoreAppleEvents:ProcessHelpers*/
854+/*
855+ * Taken from MoreAppleEvents:ProcessHelpers
856+ */
855857 pascal OSErr
856858 FindProcessBySignature(
857859 const OSType targetType,
@@ -915,7 +917,7 @@
915917
916918 AEDisposeDesc(&targetAppDesc);
917919
918- /* Add the parms */
920+ // Add the parms
919921 ModData.theFile = buf->b_FSSpec;
920922 ModData.theDate = buf->b_mtime;
921923
@@ -931,12 +933,12 @@
931933 anErr = AESend(&theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil);
932934 if (anErr == noErr && sendMode == kAEWaitReply)
933935 {
934-/* anErr = AEHGetHandlerError(&theReply);*/
936+// anErr = AEHGetHandlerError(&theReply);
935937 }
936938 (void) AEDisposeDesc(&theReply);
937939 }
938940 }
939-#endif /* FEAT_CW_EDITOR */
941+#endif // FEAT_CW_EDITOR
940942
941943 /*
942944 * ------------------------------------------------------------
@@ -957,13 +959,13 @@
957959 DescType dummyType;
958960 AEKeyword missedKeyword;
959961
960- /* Get the "missed keyword" attribute from the AppleEvent. */
962+ // Get the "missed keyword" attribute from the AppleEvent.
961963 error = AEGetAttributePtr(theAEvent, keyMissedKeywordAttr,
962964 typeKeyword, &dummyType,
963965 (Ptr)&missedKeyword, sizeof(missedKeyword),
964966 &actualSize);
965967
966- /* If the descriptor isn't found, then we got the required parameters. */
968+ // If the descriptor isn't found, then we got the required parameters.
967969 if (error == errAEDescNotFound)
968970 {
969971 error = noErr;
@@ -971,7 +973,7 @@
971973 else
972974 {
973975 #if 0
974- /* Why is this removed? */
976+ // Why is this removed?
975977 error = errAEEventNotHandled;
976978 #endif
977979 }
@@ -988,7 +990,7 @@
988990 */
989991
990992 typedef struct SelectionRange SelectionRange;
991-struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar */
993+struct SelectionRange // for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar
992994 {
993995 short unused1; // 0 (not used)
994996 short lineNum; // line to select (<0 to specify range)
@@ -1005,30 +1007,30 @@
10051007 static void
10061008 drop_callback(void *cookie UNUSED)
10071009 {
1008- /* TODO: Handle the goto/select line more cleanly */
1010+ // TODO: Handle the goto/select line more cleanly
10091011 if ((drop_numFiles == 1) & (drop_gotPosition))
10101012 {
10111013 if (drop_thePosition.lineNum >= 0)
10121014 {
10131015 lnum = drop_thePosition.lineNum + 1;
1014- /* oap->motion_type = MLINE;
1015- setpcmark();*/
1016+ // oap->motion_type = MLINE;
1017+ // setpcmark();
10161018 if (lnum < 1L)
10171019 lnum = 1L;
10181020 else if (lnum > curbuf->b_ml.ml_line_count)
10191021 lnum = curbuf->b_ml.ml_line_count;
10201022 curwin->w_cursor.lnum = lnum;
10211023 curwin->w_cursor.col = 0;
1022- /* beginline(BL_SOL | BL_FIX);*/
1024+ // beginline(BL_SOL | BL_FIX);
10231025 }
10241026 else
10251027 goto_byte(drop_thePosition.startRange + 1);
10261028 }
10271029
1028- /* Update the screen display */
1030+ // Update the screen display
10291031 update_screen(NOT_VALID);
10301032
1031- /* Select the text if possible */
1033+ // Select the text if possible
10321034 if (drop_gotPosition)
10331035 {
10341036 VIsual_active = TRUE;
@@ -1047,14 +1049,14 @@
10471049 }
10481050 }
10491051
1050-/* The IDE uses the optional keyAEPosition parameter to tell the ed-
1051- itor the selection range. If lineNum is zero or greater, scroll the text
1052- to the specified line. If lineNum is less than zero, use the values in
1053- startRange and endRange to select the specified characters. Scroll
1054- the text to display the selection. If lineNum, startRange, and
1055- endRange are all negative, there is no selection range specified.
1052+/*
1053+ * The IDE uses the optional keyAEPosition parameter to tell the ed-
1054+ * itor the selection range. If lineNum is zero or greater, scroll the text
1055+ * to the specified line. If lineNum is less than zero, use the values in
1056+ * startRange and endRange to select the specified characters. Scroll
1057+ * the text to display the selection. If lineNum, startRange, and
1058+ * endRange are all negative, there is no selection range specified.
10561059 */
1057-
10581060 pascal OSErr
10591061 HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
10601062 {
@@ -1076,7 +1078,7 @@
10761078 short gotPosition = false;
10771079 long lnum;
10781080
1079- /* the direct object parameter is the list of aliases to files (one or more) */
1081+ // the direct object parameter is the list of aliases to files (one or more)
10801082 error = AEGetParamDesc(theAEvent, keyDirectObject, typeAEList, &theList);
10811083 if (error)
10821084 return error;
@@ -1111,7 +1113,7 @@
11111113
11121114 if (error)
11131115 {
1114- /* TODO: empty fnames[] first */
1116+ // TODO: empty fnames[] first
11151117 vim_free(fnames);
11161118 return (error);
11171119 }
@@ -1122,7 +1124,7 @@
11221124 char_u *p;
11231125 int fnum = -1;
11241126
1125- /* these are the initial files dropped on the Vim icon */
1127+ // these are the initial files dropped on the Vim icon
11261128 for (i = 0 ; i < numFiles; i++)
11271129 {
11281130 if (ga_grow(&global_alist.al_ga, 1) == FAIL
@@ -1134,8 +1136,8 @@
11341136 fnum = GARGLIST[GARGCOUNT - 1].ae_fnum;
11351137 }
11361138
1137- /* If the file name was already in the buffer list we need to switch
1138- * to it. */
1139+ // If the file name was already in the buffer list we need to switch
1140+ // to it.
11391141 if (curbuf->b_fnum != fnum)
11401142 {
11411143 char_u cmd[30];
@@ -1144,7 +1146,7 @@
11441146 do_cmdline_cmd(cmd);
11451147 }
11461148
1147- /* Change directory to the location of the first file. */
1149+ // Change directory to the location of the first file.
11481150 if (GARGCOUNT > 0
11491151 && vim_chdirfile(alist_name(&GARGLIST[0]), "drop") == OK)
11501152 shorten_fnames(TRUE);
@@ -1152,7 +1154,7 @@
11521154 goto finished;
11531155 }
11541156
1155- /* Handle the drop, :edit to get to the file */
1157+ // Handle the drop, :edit to get to the file
11561158 drop_numFiles = numFiles;
11571159 drop_gotPosition = gotPosition;
11581160 drop_thePosition = thePosition;
@@ -1161,11 +1163,11 @@
11611163 setcursor();
11621164 out_flush();
11631165
1164- /* Fake mouse event to wake from stall */
1166+ // Fake mouse event to wake from stall
11651167 PostEvent(mouseUp, 0);
11661168
11671169 finished:
1168- AEDisposeDesc(&theList); /* dispose what we allocated */
1170+ AEDisposeDesc(&theList); // dispose what we allocated
11691171
11701172 error = HandleUnusedParms(theAEvent);
11711173 return error;
@@ -1174,7 +1176,6 @@
11741176 /*
11751177 *
11761178 */
1177-
11781179 pascal OSErr
11791180 Handle_aevt_oapp_AE(
11801181 const AppleEvent *theAEvent,
@@ -1190,7 +1191,6 @@
11901191 /*
11911192 *
11921193 */
1193-
11941194 pascal OSErr
11951195 Handle_aevt_quit_AE(
11961196 const AppleEvent *theAEvent,
@@ -1203,7 +1203,7 @@
12031203 if (error)
12041204 return error;
12051205
1206- /* Need to fake a :confirm qa */
1206+ // Need to fake a :confirm qa
12071207 do_cmdline_cmd((char_u *)"confirm qa");
12081208
12091209 return error;
@@ -1212,7 +1212,6 @@
12121212 /*
12131213 *
12141214 */
1215-
12161215 pascal OSErr
12171216 Handle_aevt_pdoc_AE(
12181217 const AppleEvent *theAEvent,
@@ -1253,30 +1252,31 @@
12531252 {
12541253 OSErr error;
12551254
1256- /* install open application handler */
1255+ // install open application handler
12571256 error = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
12581257 NewAEEventHandlerUPP(Handle_aevt_oapp_AE), 0, false);
12591258 if (error)
12601259 return error;
12611260
1262- /* install quit application handler */
1261+ // install quit application handler
12631262 error = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
12641263 NewAEEventHandlerUPP(Handle_aevt_quit_AE), 0, false);
12651264 if (error)
12661265 return error;
12671266
1268- /* install open document handler */
1267+ // install open document handler
12691268 error = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
12701269 NewAEEventHandlerUPP(HandleODocAE), 0, false);
12711270 if (error)
12721271 return error;
12731272
1274- /* install print document handler */
1273+ // install print document handler
12751274 error = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
12761275 NewAEEventHandlerUPP(Handle_aevt_pdoc_AE), 0, false);
12771276
1278-/* Install Core Suite */
1279-/* error = AEInstallEventHandler(kAECoreSuite, kAEClone,
1277+// Install Core Suite
1278+#if 0
1279+ error = AEInstallEventHandler(kAECoreSuite, kAEClone,
12801280 NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
12811281
12821282 error = AEInstallEventHandler(kAECoreSuite, kAEClose,
@@ -1314,7 +1314,7 @@
13141314
13151315 error = AEInstallEventHandler(kAECoreSuite, kAESetData,
13161316 NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
1317-*/
1317+#endif
13181318
13191319 #ifdef FEAT_CW_EDITOR
13201320 /*
@@ -1335,7 +1335,7 @@
13351335 return error;
13361336
13371337 }
1338-#endif /* USE_AEVENT */
1338+#endif // USE_AEVENT
13391339
13401340
13411341 /*
@@ -1361,7 +1361,7 @@
13611361 FMFontSize newSize;
13621362 FMFontStyle newStyle;
13631363
1364- /* Retrieve the font family ID number. */
1364+ // Retrieve the font family ID number.
13651365 status = GetEventParameter(inEvent, kEventParamFMFontFamily,
13661366 /*inDesiredType=*/typeFMFontFamily, /*outActualType=*/NULL,
13671367 /*inBufferSize=*/sizeof(FMFontFamily), /*outActualSize=*/NULL,
@@ -1369,13 +1369,13 @@
13691369 if (status == noErr)
13701370 gFontPanelInfo.family = newFamily;
13711371
1372- /* Retrieve the font size. */
1372+ // Retrieve the font size.
13731373 status = GetEventParameter(inEvent, kEventParamFMFontSize,
13741374 typeFMFontSize, NULL, sizeof(FMFontSize), NULL, &newSize);
13751375 if (status == noErr)
13761376 gFontPanelInfo.size = newSize;
13771377
1378- /* Retrieve the font style (bold, etc.). Currently unused. */
1378+ // Retrieve the font style (bold, etc.). Currently unused.
13791379 status = GetEventParameter(inEvent, kEventParamFMFontStyle,
13801380 typeFMFontStyle, NULL, sizeof(FMFontStyle), NULL, &newStyle);
13811381 if (status == noErr)
@@ -1390,7 +1390,7 @@
13901390 {
13911391 EventTypeSpec eventTypes[2];
13921392 EventHandlerUPP handlerUPP;
1393- /* EventHandlerRef handlerRef; */
1393+ // EventHandlerRef handlerRef;
13941394
13951395 eventTypes[0].eventClass = kEventClassFont;
13961396 eventTypes[0].eventKind = kEventFontSelection;
@@ -1422,20 +1422,20 @@
14221422
14231423 if (FMGetFontFamilyName(gFontPanelInfo.family, buf) == noErr)
14241424 {
1425- /* Canonicalize localized font names */
1425+ // Canonicalize localized font names
14261426 if (FMGetFontFromFontFamilyInstance(gFontPanelInfo.family,
14271427 gFontPanelInfo.style, &fid, NULL) != noErr)
14281428 return;
14291429
1430- /* Request font name with Mac encoding (otherwise we could
1431- * get an unwanted utf-16 name) */
1430+ // Request font name with Mac encoding (otherwise we could
1431+ // get an unwanted utf-16 name)
14321432 if (ATSUFindFontName(fid, kFontFullName, kFontMacintoshPlatform,
14331433 kFontNoScriptCode, kFontNoLanguageCode,
14341434 255, (char *)outName, &fontNameLen, NULL) != noErr)
14351435 return;
14361436
1437- /* Only encode font size, because style (bold, italic, etc) is
1438- * already part of the font full name */
1437+ // Only encode font size, because style (bold, italic, etc) is
1438+ // already part of the font full name
14391439 vim_snprintf((char *)styleString, FONT_STYLE_BUFFER_SIZE, ":h%d",
14401440 gFontPanelInfo.size/*,
14411441 ((gFontPanelInfo.style & bold)!=0 ? ":b" : ""),
@@ -1463,23 +1463,22 @@
14631463 *
14641464 * Returns the index inside the menu where
14651465 */
1466- short /* Should we return MenuItemIndex? */
1466+ short // Should we return MenuItemIndex?
14671467 gui_mac_get_menu_item_index(vimmenu_T *pMenu)
14681468 {
14691469 short index;
14701470 short itemIndex = -1;
14711471 vimmenu_T *pBrother;
14721472
1473- /* Only menu without parent are the:
1474- * -menu in the menubar
1475- * -popup menu
1476- * -toolbar (guess)
1477- *
1478- * Which are not items anyway.
1479- */
1473+ // Only menu without parent are the:
1474+ // -menu in the menubar
1475+ // -popup menu
1476+ // -toolbar (guess)
1477+ //
1478+ // Which are not items anyway.
14801479 if (pMenu->parent)
14811480 {
1482- /* Start from the Oldest Brother */
1481+ // Start from the Oldest Brother
14831482 pBrother = pMenu->parent->children;
14841483 index = 1;
14851484 while ((pBrother) && (itemIndex == -1))
@@ -1501,13 +1500,12 @@
15011500 vimmenu_T *pElder = pMenu->parent;
15021501
15031502
1504- /* Only menu without parent are the:
1505- * -menu in the menubar
1506- * -popup menu
1507- * -toolbar (guess)
1508- *
1509- * Which are not items anyway.
1510- */
1503+ // Only menu without parent are the:
1504+ // -menu in the menubar
1505+ // -popup menu
1506+ // -toolbar (guess)
1507+ //
1508+ // Which are not items anyway.
15111509
15121510 if ((pElder) && (pElder->submenu_id == menuID))
15131511 {
@@ -1554,12 +1552,12 @@
15541552 if (sb == NULL)
15551553 return;
15561554
1557- /* Need to find value by diff between Old Poss New Pos */
1555+ // Need to find value by diff between Old Poss New Pos
15581556 value = GetControl32BitValue(theControlToUse);
15591557 dragging = (partCode != 0);
15601558
1561- /* When "allow_scrollbar" is FALSE still need to remember the new
1562- * position, but don't actually scroll by setting "dont_scroll". */
1559+ // When "allow_scrollbar" is FALSE still need to remember the new
1560+ // position, but don't actually scroll by setting "dont_scroll".
15631561 dont_scroll = !allow_scrollbar;
15641562 gui_drag_scrollbar(sb, value, dragging);
15651563 dont_scroll = dont_scroll_save;
@@ -1569,7 +1567,7 @@
15691567 void
15701568 gui_mac_scroll_action(ControlHandle theControl, short partCode)
15711569 {
1572- /* TODO: have live support */
1570+ // TODO: have live support
15731571 scrollbar_T *sb, *sb_info;
15741572 long data;
15751573 long value;
@@ -1582,7 +1580,7 @@
15821580 if (sb == NULL)
15831581 return;
15841582
1585- if (sb->wp != NULL) /* Left or right scrollbar */
1583+ if (sb->wp != NULL) // Left or right scrollbar
15861584 {
15871585 /*
15881586 * Careful: need to get scrollbar info out of first (left) scrollbar
@@ -1592,11 +1590,11 @@
15921590 sb_info = &sb->wp->w_scrollbars[0];
15931591
15941592 if (sb_info->size > 5)
1595- page = sb_info->size - 2; /* use two lines of context */
1593+ page = sb_info->size - 2; // use two lines of context
15961594 else
15971595 page = sb_info->size;
15981596 }
1599- else /* Bottom scrollbar */
1597+ else // Bottom scrollbar
16001598 {
16011599 sb_info = sb;
16021600 page = curwin->w_width - 5;
@@ -1612,13 +1610,13 @@
16121610 }
16131611
16141612 value = sb_info->value + data;
1615-/* if (value > sb_info->max)
1616- value = sb_info->max;
1617- else if (value < 0)
1618- value = 0;*/
1619-
1620- /* When "allow_scrollbar" is FALSE still need to remember the new
1621- * position, but don't actually scroll by setting "dont_scroll". */
1613+// if (value > sb_info->max)
1614+// value = sb_info->max;
1615+// else if (value < 0)
1616+// value = 0;
1617+
1618+ // When "allow_scrollbar" is FALSE still need to remember the new
1619+ // position, but don't actually scroll by setting "dont_scroll".
16221620 dont_scroll = !allow_scrollbar;
16231621 gui_drag_scrollbar(sb, value, dragging);
16241622 dont_scroll = dont_scroll_save;
@@ -1626,7 +1624,8 @@
16261624 out_flush();
16271625 gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max);
16281626
1629-/* if (sb_info->wp != NULL)
1627+#if 0
1628+ if (sb_info->wp != NULL)
16301629 {
16311630 win_T *wp;
16321631 int sb_num;
@@ -1642,7 +1641,8 @@
16421641 gui_do_scroll();
16431642 gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max);
16441643 }
1645- }*/
1644+ }
1645+#endif
16461646 }
16471647
16481648 /*
@@ -1676,7 +1676,7 @@
16761676
16771677 if (theControl != NUL)
16781678 {
1679- /* We hit a scrollbar */
1679+ // We hit a scrollbar
16801680
16811681 if (thePortion != kControlIndicatorPart)
16821682 {
@@ -1692,24 +1692,24 @@
16921692 #else
16931693 TrackControl(theControl, thePoint, NULL);
16941694 #endif
1695- /* pass 0 as the part to tell gui_mac_drag_thumb, that the mouse
1696- * button has been released */
1697- gui_mac_drag_thumb(theControl, 0); /* Should it be thePortion ? (Dany) */
1695+ // pass 0 as the part to tell gui_mac_drag_thumb, that the mouse
1696+ // button has been released
1697+ gui_mac_drag_thumb(theControl, 0); // Should it be thePortion ? (Dany)
16981698 dragged_sb = NULL;
16991699 }
17001700 }
17011701 else
17021702 {
1703- /* We are inside the contents */
1704-
1705- /* Convert the CTRL, OPTION, SHIFT and CMD key */
1703+ // We are inside the contents
1704+
1705+ // Convert the CTRL, OPTION, SHIFT and CMD key
17061706 vimModifiers = EventModifiers2VimMouseModifiers(theEvent->modifiers);
17071707
1708- /* Defaults to MOUSE_LEFT as there's only one mouse button */
1708+ // Defaults to MOUSE_LEFT as there's only one mouse button
17091709 vimMouseButton = MOUSE_LEFT;
17101710
1711- /* Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT */
1712- /* TODO: NEEDED? */
1711+ // Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT
1712+ // TODO: NEEDED?
17131713 clickIsPopup = FALSE;
17141714
17151715 if (mouse_model_popup() && IsShowContextualMenuClick(theEvent))
@@ -1719,20 +1719,18 @@
17191719 clickIsPopup = TRUE;
17201720 }
17211721
1722- /* Is it a double click ? */
1722+ // Is it a double click ?
17231723 dblClick = ((theEvent->when - lastMouseTick) < GetDblTime());
17241724
1725- /* Send the mouse click to Vim */
1725+ // Send the mouse click to Vim
17261726 gui_send_mouse_event(vimMouseButton, thePoint.h,
17271727 thePoint.v, dblClick, vimModifiers);
17281728
1729- /* Create the rectangle around the cursor to detect
1730- * the mouse dragging
1731- */
1729+ // Create the rectangle around the cursor to detect
1730+ // the mouse dragging
17321731 #if 0
1733- /* TODO: Do we need to this even for the contextual menu?
1734- * It may be require for popup_setpos, but for popup?
1735- */
1732+ // TODO: Do we need to this even for the contextual menu?
1733+ // It may be require for popup_setpos, but for popup?
17361734 if (vimMouseButton == MOUSE_LEFT)
17371735 #endif
17381736 {
@@ -1756,7 +1754,7 @@
17561754 Rect movingLimits;
17571755 Rect *movingLimitsPtr = &movingLimits;
17581756
1759- /* TODO: may try to prevent move outside screen? */
1757+ // TODO: may try to prevent move outside screen?
17601758 movingLimitsPtr = GetRegionBounds(GetGrayRgn(), &movingLimits);
17611759 DragWindow(whichWindow, where, movingLimitsPtr);
17621760 }
@@ -1777,8 +1775,8 @@
17771775
17781776 resizeLimitsPtr = GetRegionBounds(GetGrayRgn(), &resizeLimits);
17791777
1780- /* Set the minimum size */
1781- /* TODO: Should this come from Vim? */
1778+ // Set the minimum size
1779+ // TODO: Should this come from Vim?
17821780 resizeLimits.top = 100;
17831781 resizeLimits.left = 100;
17841782
@@ -1800,13 +1798,13 @@
18001798 Point p;
18011799 short thePart;
18021800
1803- /* ideal width is current */
1801+ // ideal width is current
18041802 p.h = Columns * gui.char_width + 2 * gui.border_offset;
18051803 if (gui.which_scrollbars[SBAR_LEFT])
18061804 p.h += gui.scrollbar_width;
18071805 if (gui.which_scrollbars[SBAR_RIGHT])
18081806 p.h += gui.scrollbar_width;
1809- /* ideal height is as high as we can get */
1807+ // ideal height is as high as we can get
18101808 p.v = 15 * 1024;
18111809
18121810 thePart = IsWindowInStandardState(whichWindow, &p, &r)
@@ -1815,9 +1813,9 @@
18151813 if (!TrackBox(whichWindow, theEvent->where, thePart))
18161814 return;
18171815
1818- /* use returned width */
1816+ // use returned width
18191817 p.h = r.right - r.left;
1820- /* adjust returned height */
1818+ // adjust returned height
18211819 p.v = r.bottom - r.top - 2 * gui.border_offset;
18221820 if (gui.which_scrollbars[SBAR_BOTTOM])
18231821 p.v -= gui.scrollbar_height;
@@ -1861,46 +1859,42 @@
18611859 if (updateRgn == NULL)
18621860 return;
18631861
1864- /* This could be done by the caller as we
1865- * don't require anything else out of the event
1866- */
1862+ // This could be done by the caller as we
1863+ // don't require anything else out of the event
18671864 whichWindow = (WindowPtr) event->message;
18681865
1869- /* Save Current Port */
1866+ // Save Current Port
18701867 GetPort(&savePort);
18711868
1872- /* Select the Window's Port */
1869+ // Select the Window's Port
18731870 SetPortWindowPort(whichWindow);
18741871
1875- /* Let's update the window */
1872+ // Let's update the window
18761873 BeginUpdate(whichWindow);
1877- /* Redraw the biggest rectangle covering the area
1878- * to be updated.
1879- */
1874+ // Redraw the biggest rectangle covering the area
1875+ // to be updated.
18801876 GetPortVisibleRegion(GetWindowPort(whichWindow), updateRgn);
18811877 # if 0
1882- /* Would be more appropriate to use the following but doesn't
1883- * seem to work under MacOS X (Dany)
1884- */
1878+ // Would be more appropriate to use the following but doesn't
1879+ // seem to work under MacOS X (Dany)
18851880 GetWindowRegion(whichWindow, kWindowUpdateRgn, updateRgn);
18861881 # endif
18871882
1888- /* Use the HLock useless in Carbon? Is it harmful?*/
1883+ // Use the HLock useless in Carbon? Is it harmful?
18891884 HLock((Handle) updateRgn);
18901885
18911886 updateRectPtr = GetRegionBounds(updateRgn, &updateRect);
18921887 # if 0
1893- /* Code from original Carbon Port (using GetWindowRegion.
1894- * I believe the UpdateRgn is already in local (Dany)
1895- */
1896- GlobalToLocal(&topLeft(updateRect)); /* preCarbon? */
1888+ // Code from original Carbon Port (using GetWindowRegion.
1889+ // I believe the UpdateRgn is already in local (Dany)
1890+ GlobalToLocal(&topLeft(updateRect)); // preCarbon?
18971891 GlobalToLocal(&botRight(updateRect));
18981892 # endif
1899- /* Update the content (i.e. the text) */
1893+ // Update the content (i.e. the text)
19001894 gui_redraw(updateRectPtr->left, updateRectPtr->top,
19011895 updateRectPtr->right - updateRectPtr->left,
19021896 updateRectPtr->bottom - updateRectPtr->top);
1903- /* Clear the border areas if needed */
1897+ // Clear the border areas if needed
19041898 gui_mch_set_bg_color(gui.back_pixel);
19051899 if (updateRectPtr->left < FILL_X(0))
19061900 {
@@ -1927,11 +1921,11 @@
19271921 HUnlock((Handle) updateRgn);
19281922 DisposeRgn(updateRgn);
19291923
1930- /* Update scrollbars */
1924+ // Update scrollbars
19311925 DrawControls(whichWindow);
19321926
1933- /* Update the GrowBox */
1934- /* Taken from FAQ 33-27 */
1927+ // Update the GrowBox
1928+ // Taken from FAQ 33-27
19351929 saveRgn = NewRgn();
19361930 GetWindowBounds(whichWindow, kWindowGrowRgn, &growRect);
19371931 GetClip(saveRgn);
@@ -1941,7 +1935,7 @@
19411935 DisposeRgn(saveRgn);
19421936 EndUpdate(whichWindow);
19431937
1944- /* Restore original Port */
1938+ // Restore original Port
19451939 SetPort(savePort);
19461940 }
19471941
@@ -1955,7 +1949,7 @@
19551949 WindowPtr whichWindow;
19561950
19571951 whichWindow = (WindowPtr) event->message;
1958- /* Dim scrollbars */
1952+ // Dim scrollbars
19591953 if (whichWindow == gui.VimWindow)
19601954 {
19611955 ControlRef rootControl;
@@ -1966,7 +1960,7 @@
19661960 DeactivateControl(rootControl);
19671961 }
19681962
1969- /* Activate */
1963+ // Activate
19701964 gui_focus_change((event->modifiers) & activeFlag);
19711965 }
19721966
@@ -1978,20 +1972,18 @@
19781972 void
19791973 gui_mac_doSuspendEvent(EventRecord *event)
19801974 {
1981- /* The frontmost application just changed */
1982-
1983- /* NOTE: the suspend may happen before the deactivate
1984- * seen on MacOS X
1985- */
1986-
1987- /* May not need to change focus as the window will
1988- * get an activate/deactivate event
1989- */
1975+ // The frontmost application just changed
1976+
1977+ // NOTE: the suspend may happen before the deactivate
1978+ // seen on MacOS X
1979+
1980+ // May not need to change focus as the window will
1981+ // get an activate/deactivate event
19901982 if (event->message & 1)
1991- /* Resume */
1983+ // Resume
19921984 gui_focus_change(TRUE);
19931985 else
1994- /* Suspend */
1986+ // Suspend
19951987 gui_focus_change(FALSE);
19961988 }
19971989
@@ -2068,8 +2060,8 @@
20682060 return eventNotHandledErr;
20692061 }
20702062
2071-static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the
2072- keys */
2063+static int dialog_busy = FALSE; // TRUE when gui_mch_dialog() wants the
2064+ // keys
20732065
20742066 # define INLINE_KEY_BUFFER_SIZE 80
20752067 static pascal OSStatus
@@ -2077,7 +2069,7 @@
20772069 EventHandlerCallRef nextHandler,
20782070 EventRef theEvent)
20792071 {
2080- /* Multibyte-friendly key event handler */
2072+ // Multibyte-friendly key event handler
20812073 OSStatus err = -1;
20822074 UInt32 actualSize;
20832075 UniChar *text;
@@ -2093,11 +2085,11 @@
20932085 int i;
20942086 EventRef keyEvent;
20952087
2096- /* Mask the mouse (as per user setting) */
2088+ // Mask the mouse (as per user setting)
20972089 if (p_mh)
20982090 ObscureCursor();
20992091
2100- /* Don't use the keys when the dialog wants them. */
2092+ // Don't use the keys when the dialog wants them.
21012093 if (dialog_busy)
21022094 return eventNotHandledErr;
21032095
@@ -2131,13 +2123,13 @@
21312123
21322124 #ifndef USE_CMD_KEY
21332125 if (modifiers & cmdKey)
2134- goto done; /* Let system handle Cmd+... */
2126+ goto done; // Let system handle Cmd+...
21352127 #endif
21362128
21372129 key_char = charcode;
21382130 vimModifiers = EventModifiers2VimModifiers(modifiers);
21392131
2140- /* Find the special key (eg., for cursor keys) */
2132+ // Find the special key (eg., for cursor keys)
21412133 if (actualSize <= sizeof(UniChar) &&
21422134 ((text[0] < 0x20) || (text[0] == 0x7f)))
21432135 {
@@ -2153,30 +2145,30 @@
21532145 }
21542146 }
21552147
2156- /* Intercept CMD-. and CTRL-c */
2148+ // Intercept CMD-. and CTRL-c
21572149 if (((modifiers & controlKey) && key_char == 'c') ||
21582150 ((modifiers & cmdKey) && key_char == '.'))
21592151 got_int = TRUE;
21602152
21612153 if (!isSpecial)
21622154 {
2163- /* remove SHIFT for keys that are already shifted, e.g.,
2164- * '(' and '*' */
2155+ // remove SHIFT for keys that are already shifted, e.g.,
2156+ // '(' and '*'
21652157 if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char))
21662158 vimModifiers &= ~MOD_MASK_SHIFT;
21672159
2168- /* remove CTRL from keys that already have it */
2160+ // remove CTRL from keys that already have it
21692161 if (key_char < 0x20)
21702162 vimModifiers &= ~MOD_MASK_CTRL;
21712163
2172- /* don't process unicode characters here */
2164+ // don't process unicode characters here
21732165 if (!IS_SPECIAL(key_char))
21742166 {
2175- /* Following code to simplify and consolidate vimModifiers
2176- * taken liberally from gui_w48.c */
2167+ // Following code to simplify and consolidate vimModifiers
2168+ // taken liberally from gui_w48.c
21772169 key_char = simplify_key(key_char, (int *)&vimModifiers);
21782170
2179- /* Interpret META, include SHIFT, etc. */
2171+ // Interpret META, include SHIFT, etc.
21802172 key_char = extract_modifiers(key_char, (int *)&vimModifiers,
21812173 TRUE, NULL);
21822174 if (key_char == CSI)
@@ -2206,7 +2198,7 @@
22062198 to = mac_utf16_to_enc(text, actualSize, &encLen);
22072199 if (to)
22082200 {
2209- /* This is basically add_to_input_buf_csi() */
2201+ // This is basically add_to_input_buf_csi()
22102202 for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i)
22112203 {
22122204 result[len++] = to[i];
@@ -2227,8 +2219,8 @@
22272219 vim_free(text);
22282220 if (err == noErr)
22292221 {
2230- /* Fake event to wake up WNE (required to get
2231- * key repeat working */
2222+ // Fake event to wake up WNE (required to get
2223+ // key repeat working
22322224 PostEvent(keyUp, 0);
22332225 return noErr;
22342226 }
@@ -2239,7 +2231,7 @@
22392231 void
22402232 gui_mac_doKeyEvent(EventRecord *theEvent)
22412233 {
2242- /* TODO: add support for COMMAND KEY */
2234+ // TODO: add support for COMMAND KEY
22432235 long menu;
22442236 unsigned char string[20];
22452237 short num, i;
@@ -2249,16 +2241,16 @@
22492241 int modifiers;
22502242 int simplify = FALSE;
22512243
2252- /* Mask the mouse (as per user setting) */
2244+ // Mask the mouse (as per user setting)
22532245 if (p_mh)
22542246 ObscureCursor();
22552247
2256- /* Get the key code and its ASCII representation */
2248+ // Get the key code and its ASCII representation
22572249 key_sym = ((theEvent->message & keyCodeMask) >> 8);
22582250 key_char = theEvent->message & charCodeMask;
22592251 num = 1;
22602252
2261- /* Intercept CTRL-C */
2253+ // Intercept CTRL-C
22622254 if (theEvent->modifiers & controlKey)
22632255 {
22642256 if (key_char == Ctrl_C && ctrl_c_interrupts)
@@ -2266,7 +2258,7 @@
22662258 else if ((theEvent->modifiers & ~(controlKey|shiftKey)) == 0
22672259 && (key_char == '2' || key_char == '6'))
22682260 {
2269- /* CTRL-^ and CTRL-@ don't work in the normal way. */
2261+ // CTRL-^ and CTRL-@ don't work in the normal way.
22702262 if (key_char == '2')
22712263 key_char = Ctrl_AT;
22722264 else
@@ -2275,16 +2267,16 @@
22752267 }
22762268 }
22772269
2278- /* Intercept CMD-. */
2270+ // Intercept CMD-.
22792271 if (theEvent->modifiers & cmdKey)
22802272 if (key_char == '.')
22812273 got_int = TRUE;
22822274
2283- /* Handle command key as per menu */
2284- /* TODO: should override be allowed? Require YAO or could use 'winaltkey' */
2275+ // Handle command key as per menu
2276+ // TODO: should override be allowed? Require YAO or could use 'winaltkey'
22852277 if (theEvent->modifiers & cmdKey)
2286- /* Only accept CMD alone or with CAPLOCKS and the mouse button.
2287- * Why the mouse button? */
2278+ // Only accept CMD alone or with CAPLOCKS and the mouse button.
2279+ // Why the mouse button?
22882280 if ((theEvent->modifiers & (~(cmdKey | btnState | alphaLock))) == 0)
22892281 {
22902282 menu = MenuKey(key_char);
@@ -2295,23 +2287,23 @@
22952287 }
22962288 }
22972289
2298- /* Convert the modifiers */
2290+ // Convert the modifiers
22992291 modifiers = EventModifiers2VimModifiers(theEvent->modifiers);
23002292
23012293
2302- /* Handle special keys. */
2294+ // Handle special keys.
23032295 #if 0
2304- /* Why has this been removed? */
2296+ // Why has this been removed?
23052297 if (!(theEvent->modifiers & (cmdKey | controlKey | rightControlKey)))
23062298 #endif
23072299 {
2308- /* Find the special key (for non-printable keyt_char) */
2300+ // Find the special key (for non-printable keyt_char)
23092301 if ((key_char < 0x20) || (key_char == 0x7f))
23102302 for (i = 0; special_keys[i].key_sym != (KeySym)0; i++)
23112303 if (special_keys[i].key_sym == key_sym)
23122304 {
23132305 # if 0
2314- /* We currently don't have not so special key */
2306+ // We currently don't have not so special key
23152307 if (special_keys[i].vim_code1 == NUL)
23162308 key_char = special_keys[i].vim_code0;
23172309 else
@@ -2323,12 +2315,12 @@
23232315 }
23242316 }
23252317
2326- /* For some keys the modifier is included in the char itself. */
2318+ // For some keys the modifier is included in the char itself.
23272319 if (simplify || key_char == TAB || key_char == ' ')
23282320 key_char = simplify_key(key_char, &modifiers);
23292321
2330- /* Add the modifier to the input bu if needed */
2331- /* Do not want SHIFT-A or CTRL-A with modifier */
2322+ // Add the modifier to the input bu if needed
2323+ // Do not want SHIFT-A or CTRL-A with modifier
23322324 if (!IS_SPECIAL(key_char)
23332325 && key_sym != vk_Space
23342326 && key_sym != vk_Tab
@@ -2337,7 +2329,7 @@
23372329 && key_sym != vk_Esc)
23382330 {
23392331 #if 1
2340- /* Clear modifiers when only one modifier is set */
2332+ // Clear modifiers when only one modifier is set
23412333 if ((modifiers == MOD_MASK_SHIFT)
23422334 || (modifiers == MOD_MASK_CTRL)
23432335 || (modifiers == MOD_MASK_ALT))
@@ -2366,8 +2358,8 @@
23662358 }
23672359 else
23682360 {
2369- /* Convert characters when needed (e.g., from MacRoman to latin1).
2370- * This doesn't work for the NUL byte. */
2361+ // Convert characters when needed (e.g., from MacRoman to latin1).
2362+ // This doesn't work for the NUL byte.
23712363 if (input_conv.vc_type != CONV_NONE && key_char > 0)
23722364 {
23732365 char_u from[2], *to;
@@ -2400,7 +2392,7 @@
24002392
24012393 if (len == 1 && string[0] == CSI)
24022394 {
2403- /* Turn CSI into K_CSI. */
2395+ // Turn CSI into K_CSI.
24042396 string[ len++ ] = KS_EXTRA;
24052397 string[ len++ ] = KE_CSI;
24062398 }
@@ -2421,8 +2413,8 @@
24212413 thePart = FindWindow(theEvent->where, &whichWindow);
24222414
24232415 #ifdef FEAT_GUI_TABLINE
2424- /* prevent that the vim window size changes if it's activated by a
2425- click into the tab pane */
2416+ // prevent that the vim window size changes if it's activated by a
2417+ // click into the tab pane
24262418 if (whichWindow == drawer)
24272419 return;
24282420 #endif
@@ -2430,7 +2422,7 @@
24302422 switch (thePart)
24312423 {
24322424 case (inDesk):
2433- /* TODO: what to do? */
2425+ // TODO: what to do?
24342426 break;
24352427
24362428 case (inMenuBar):
@@ -2482,7 +2474,7 @@
24822474 gui_send_mouse_event(MOUSE_DRAG, thePoint.h,
24832475 thePoint.v, FALSE, vimModifiers);
24842476
2485- /* Reset the region from which we move in and out */
2477+ // Reset the region from which we move in and out
24862478 SetRect(&dragRect, FILL_X(X_2_COL(thePoint.h)),
24872479 FILL_Y(Y_2_ROW(thePoint.v)),
24882480 FILL_X(X_2_COL(thePoint.h)+1),
@@ -2502,8 +2494,8 @@
25022494 Point thePoint;
25032495 int_u vimModifiers;
25042496
2505- /* TODO: Properly convert the Contextual menu mouse-up */
2506- /* Potential source of the double menu */
2497+ // TODO: Properly convert the Contextual menu mouse-up
2498+ // Potential source of the double menu
25072499 lastMouseTick = theEvent->when;
25082500 dragRectEnbl = FALSE;
25092501 dragRectControl = kCreateEmpty;
@@ -2533,7 +2525,7 @@
25332525 if (noErr == GetEventParameter(theEvent, kEventParamMouseWheelAxis,
25342526 typeMouseWheelAxis, NULL, sizeof(axis), NULL, &axis)
25352527 && axis != kEventMouseWheelAxisY)
2536- goto bail; /* Vim only does up-down scrolling */
2528+ goto bail; // Vim only does up-down scrolling
25372529
25382530 if (noErr != GetEventParameter(theEvent, kEventParamMouseWheelDelta,
25392531 typeSInt32, NULL, sizeof(SInt32), NULL, &delta))
@@ -2562,7 +2554,7 @@
25622554 gui_send_mouse_event((delta > 0) ? MOUSE_4 : MOUSE_5,
25632555 point.h, point.v, FALSE, vim_mod);
25642556
2565- /* post a bogus event to wake up WaitNextEvent */
2557+ // post a bogus event to wake up WaitNextEvent
25662558 PostEvent(keyUp, 0);
25672559
25682560 return noErr;
@@ -2578,7 +2570,7 @@
25782570 void
25792571 gui_mch_mousehide(int hide)
25802572 {
2581- /* TODO */
2573+ // TODO
25822574 }
25832575
25842576 #if 0
@@ -2605,14 +2597,14 @@
26052597
26062598 if (CntxType == kCMMenuItemSelected)
26072599 {
2608- /* Handle the menu CntxMenuID, CntxMenuItem */
2609- /* The submenu can be handle directly by gui_mac_handle_menu */
2610- /* But what about the current menu, is the many changed by ContextualMenuSelect */
2600+ // Handle the menu CntxMenuID, CntxMenuItem
2601+ // The submenu can be handle directly by gui_mac_handle_menu
2602+ // But what about the current menu, is the many changed by ContextualMenuSelect
26112603 gui_mac_handle_menu((CntxMenuID << 16) + CntxMenuItem);
26122604 }
26132605 else if (CntxMenuID == kCMShowHelpSelected)
26142606 {
2615- /* Should come up with the help */
2607+ // Should come up with the help
26162608 }
26172609
26182610 }
@@ -2628,10 +2620,10 @@
26282620 short item = LoWord(menuChoice);
26292621 vimmenu_T *theVimMenu = root_menu;
26302622
2631- if (menu == 256) /* TODO: use constant or gui.xyz */
2623+ if (menu == 256) // TODO: use constant or gui.xyz
26322624 {
26332625 if (item == 1)
2634- gui_mch_beep(); /* TODO: Popup dialog or do :intro */
2626+ gui_mch_beep(); // TODO: Popup dialog or do :intro
26352627 }
26362628 else if (item != 0)
26372629 {
@@ -2652,7 +2644,7 @@
26522644 {
26532645 OSErr error;
26542646
2655- /* Handle contextual menu right now (if needed) */
2647+ // Handle contextual menu right now (if needed)
26562648 if (IsShowContextualMenuClick(event))
26572649 {
26582650 # if 0
@@ -2663,7 +2655,7 @@
26632655 return;
26642656 }
26652657
2666- /* Handle normal event */
2658+ // Handle normal event
26672659 switch (event->what)
26682660 {
26692661 #ifndef USE_CARBONKEYHANDLER
@@ -2673,7 +2665,7 @@
26732665 break;
26742666 #endif
26752667 case (keyUp):
2676- /* We don't care about when the key is released */
2668+ // We don't care about when the key is released
26772669 break;
26782670
26792671 case (mouseDown):
@@ -2689,7 +2681,7 @@
26892681 break;
26902682
26912683 case (diskEvt):
2692- /* We don't need special handling for disk insertion */
2684+ // We don't need special handling for disk insertion
26932685 break;
26942686
26952687 case (activateEvt):
@@ -2699,10 +2691,10 @@
26992691 case (osEvt):
27002692 switch ((event->message >> 24) & 0xFF)
27012693 {
2702- case (0xFA): /* mouseMovedMessage */
2694+ case (0xFA): // mouseMovedMessage
27032695 gui_mac_doMouseMovedEvent(event);
27042696 break;
2705- case (0x01): /* suspendResumeMessage */
2697+ case (0x01): // suspendResumeMessage
27062698 gui_mac_doSuspendEvent(event);
27072699 break;
27082700 }
@@ -2710,8 +2702,8 @@
27102702
27112703 #ifdef USE_AEVENT
27122704 case (kHighLevelEvent):
2713- /* Someone's talking to us, through AppleEvents */
2714- error = AEProcessAppleEvent(event); /* TODO: Error Handling */
2705+ // Someone's talking to us, through AppleEvents
2706+ error = AEProcessAppleEvent(event); // TODO: Error Handling
27152707 break;
27162708 #endif
27172709 }
@@ -2749,7 +2741,7 @@
27492741 pFontName[0] = STRLEN(font_name);
27502742 *p = c;
27512743
2752- /* Get the font name, minus the style suffix (:h, etc) */
2744+ // Get the font name, minus the style suffix (:h, etc)
27532745 char_u fontName[256];
27542746 char_u *styleStart = vim_strchr(font_name, ':');
27552747 size_t fontNameLen = styleStart ? styleStart - font_name : STRLEN(fontName);
@@ -2795,7 +2787,7 @@
27952787 }
27962788
27972789 #else
2798- /* name = C2Pascal_save(menu->dname); */
2790+ // name = C2Pascal_save(menu->dname);
27992791 fontNamePtr = C2Pascal_save_and_remove_backslash(font_name);
28002792
28012793 GetFNum(fontNamePtr, &font_id);
@@ -2804,7 +2796,7 @@
28042796
28052797 if (font_id == 0)
28062798 {
2807- /* Oups, the system font was it the one the user want */
2799+ // Oups, the system font was it the one the user want
28082800
28092801 if (FMGetFontFamilyName(systemFont, systemFontname) != noErr)
28102802 return NOFONT;
@@ -2814,7 +2806,7 @@
28142806 if (*p == ':')
28152807 {
28162808 p++;
2817- /* Set the values found after ':' */
2809+ // Set the values found after ':'
28182810 while (*p)
28192811 {
28202812 switch (*p++)
@@ -2832,7 +2824,7 @@
28322824 }
28332825
28342826 if (size < 1)
2835- size = 1; /* Avoid having a size of 0 with system font */
2827+ size = 1; // Avoid having a size of 0 with system font
28362828
28372829 font = (size << 16) + ((long) font_id & 0xFFFF);
28382830
@@ -2853,7 +2845,7 @@
28532845 void
28542846 gui_mch_prepare(int *argc, char **argv)
28552847 {
2856- /* TODO: Move most of this stuff toward gui_mch_init */
2848+ // TODO: Move most of this stuff toward gui_mch_init
28572849 #ifdef USE_EXE_NAME
28582850 FSSpec applDir;
28592851 # ifndef USE_FIND_BUNDLE_PATH
@@ -2875,7 +2867,7 @@
28752867 (void) InstallAEHandlers();
28762868 #endif
28772869
2878- pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
2870+ pomme = NewMenu(256, "\p\024"); // 0x14= = Apple Menu
28792871
28802872 AppendMenu(pomme, "\pAbout VIM");
28812873
@@ -2901,7 +2893,7 @@
29012893 gui.char_ascent = 6;
29022894 gui.num_rows = 24;
29032895 gui.num_cols = 80;
2904- gui.in_focus = TRUE; /* For the moment -> syn. of front application */
2896+ gui.in_focus = TRUE; // For the moment -> syn. of front application
29052897
29062898 gScrollAction = NewControlActionUPP(gui_mac_scroll_action);
29072899 gScrollDrag = NewControlActionUPP(gui_mac_drag_thumb);
@@ -2914,21 +2906,20 @@
29142906 #ifdef USE_EXE_NAME
29152907 # ifndef USE_FIND_BUNDLE_PATH
29162908 HGetVol(volName, &applVRefNum, &applDirID);
2917- /* TN2015: mention a possible bad VRefNum */
2909+ // TN2015: mention a possible bad VRefNum
29182910 FSMakeFSSpec(applVRefNum, applDirID, "\p", &applDir);
29192911 # else
2920- /* OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr)
2921- * of TN2015
2922- */
2912+ // OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr)
2913+ // of TN2015
29232914 (void)GetCurrentProcess(&psn);
2924- /* if (err != noErr) return err; */
2915+ // if (err != noErr) return err;
29252916
29262917 (void)GetProcessBundleLocation(&psn, &applFSRef);
2927- /* if (err != noErr) return err; */
2918+ // if (err != noErr) return err;
29282919
29292920 (void)FSGetCatalogInfo(&applFSRef, kFSCatInfoNone, NULL, NULL, &applDir, NULL);
29302921
2931- /* This technic return NIL when we disallow_gui */
2922+ // This technic return NIL when we disallow_gui
29322923 # endif
29332924 exe_name = FullPathFromFSSpec_save(applDir);
29342925 #endif
@@ -2942,10 +2933,9 @@
29422933 int
29432934 gui_mch_init_check(void)
29442935 {
2945- /* TODO: For MacOS X find a way to return FAIL, if the user logged in
2946- * using the >console
2947- */
2948- if (disallow_gui) /* see main.c for reason to disallow */
2936+ // TODO: For MacOS X find a way to return FAIL, if the user logged in
2937+ // using the >console
2938+ if (disallow_gui) // see main.c for reason to disallow
29492939 return FAIL;
29502940 return OK;
29512941 }
@@ -2960,7 +2950,7 @@
29602950 int count;
29612951 int i, j;
29622952
2963- /* Get drop position, modifiers and count of items */
2953+ // Get drop position, modifiers and count of items
29642954 {
29652955 Point point;
29662956 SInt16 mouseUpModifiers;
@@ -2980,7 +2970,7 @@
29802970 if (fnames == NULL)
29812971 return dragNotAcceptedErr;
29822972
2983- /* Get file names dropped */
2973+ // Get file names dropped
29842974 for (i = j = 0; i < count; ++i)
29852975 {
29862976 DragItemRef item;
@@ -3003,7 +2993,7 @@
30032993
30042994 gui_handle_drop(x, y, modifiers, fnames, count);
30052995
3006- /* Fake mouse event to wake from stall */
2996+ // Fake mouse event to wake from stall
30072997 PostEvent(mouseUp, 0);
30082998
30092999 return noErr;
@@ -3016,7 +3006,7 @@
30163006 int
30173007 gui_mch_init(void)
30183008 {
3019- /* TODO: Move most of this stuff toward gui_mch_init */
3009+ // TODO: Move most of this stuff toward gui_mch_init
30203010 Rect windRect;
30213011 MenuHandle pomme;
30223012 EventHandlerRef mouseWheelHandlerRef;
@@ -3024,7 +3014,7 @@
30243014 ControlRef rootControl;
30253015
30263016 if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr)
3027- gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */
3017+ gMacSystemVersion = 0x1000; // TODO: Default to minimum sensible value
30283018
30293019 #if 1
30303020 InitCursor();
@@ -3035,7 +3025,7 @@
30353025 (void) InstallAEHandlers();
30363026 #endif
30373027
3038- pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
3028+ pomme = NewMenu(256, "\p\024"); // 0x14= = Apple Menu
30393029
30403030 AppendMenu(pomme, "\pAbout VIM");
30413031
@@ -3063,12 +3053,12 @@
30633053 gui.char_ascent = 6;
30643054 gui.num_rows = 24;
30653055 gui.num_cols = 80;
3066- gui.in_focus = TRUE; /* For the moment -> syn. of front application */
3056+ gui.in_focus = TRUE; // For the moment -> syn. of front application
30673057
30683058 gScrollAction = NewControlActionUPP(gui_mac_scroll_action);
30693059 gScrollDrag = NewControlActionUPP(gui_mac_drag_thumb);
30703060
3071- /* Install Carbon event callbacks. */
3061+ // Install Carbon event callbacks.
30723062 (void)InstallFontPanelHandler();
30733063
30743064 dragRectEnbl = FALSE;
@@ -3076,16 +3066,16 @@
30763066 dragRectControl = kCreateEmpty;
30773067 cursorRgn = NewRgn();
30783068 #endif
3079- /* Display any pending error messages */
3069+ // Display any pending error messages
30803070 display_errors();
30813071
3082- /* Get background/foreground colors from system */
3083- /* TODO: do the appropriate call to get real defaults */
3072+ // Get background/foreground colors from system
3073+ // TODO: do the appropriate call to get real defaults
30843074 gui.norm_pixel = 0x00000000;
30853075 gui.back_pixel = 0x00FFFFFF;
30863076
3087- /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
3088- * file). */
3077+ // Get the colors from the "Normal" group (set in syntax.c or in a vimrc
3078+ // file).
30893079 set_normal_colors();
30903080
30913081 /*
@@ -3096,8 +3086,8 @@
30963086 gui.def_norm_pixel = gui.norm_pixel;
30973087 gui.def_back_pixel = gui.back_pixel;
30983088
3099- /* Get the colors for the highlight groups (gui_check_colors() might have
3100- * changed them) */
3089+ // Get the colors for the highlight groups (gui_check_colors() might have
3090+ // changed them)
31013091 highlight_gui_started();
31023092
31033093 /*
@@ -3106,11 +3096,11 @@
31063096 #ifdef FEAT_MENU
31073097 gui.menu_height = 0;
31083098 #endif
3109- gui.scrollbar_height = gui.scrollbar_width = 15; /* cheat 1 overlap */
3099+ gui.scrollbar_height = gui.scrollbar_width = 15; // cheat 1 overlap
31103100 gui.border_offset = gui.border_width = 2;
31113101
3112- /* If Quartz-style text anti aliasing is available (see
3113- gui_mch_draw_string() below), enable it for all font sizes. */
3102+ // If Quartz-style text anti aliasing is available (see
3103+ // gui_mch_draw_string() below), enable it for all font sizes.
31143104 vim_setenv((char_u *)"QDTEXT_MINSIZE", (char_u *)"1");
31153105
31163106 eventTypeSpec.eventClass = kEventClassMouse;
@@ -3128,10 +3118,10 @@
31283118 InterfaceTypeList supportedServices = { kUnicodeDocument };
31293119 NewTSMDocument(1, supportedServices, &gTSMDocument, 0);
31303120
3131- /* We don't support inline input yet, use input window by default */
3121+ // We don't support inline input yet, use input window by default
31323122 UseInputWindow(gTSMDocument, TRUE);
31333123
3134- /* Should we activate the document by default? */
3124+ // Should we activate the document by default?
31353125 // ActivateTSMDocument(gTSMDocument);
31363126
31373127 EventTypeSpec textEventTypes[] = {
@@ -3155,8 +3145,8 @@
31553145 { kEventClassWindow, kEventWindowDeactivated },
31563146 };
31573147
3158- /* Install window event handler to support TSMDocument activate and
3159- * deactivate */
3148+ // Install window event handler to support TSMDocument activate and
3149+ // deactivate
31603150 winEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_window_activate);
31613151 if (noErr != InstallWindowEventHandler(gui.VimWindow,
31623152 winEventHandlerUPP,
@@ -3175,7 +3165,7 @@
31753165 initialise_tabline();
31763166 #endif
31773167
3178- /* TODO: Load bitmap if using TOOLBAR */
3168+ // TODO: Load bitmap if using TOOLBAR
31793169 return OK;
31803170 }
31813171
@@ -3185,10 +3175,9 @@
31853175 void
31863176 gui_mch_new_colors(void)
31873177 {
3188- /* TODO:
3189- * This proc is called when Normal is set to a value
3190- * so what must be done? I don't know
3191- */
3178+ // TODO:
3179+ // This proc is called when Normal is set to a value
3180+ // so what must be done? I don't know
31923181 }
31933182
31943183 /*
@@ -3229,7 +3218,7 @@
32293218 void
32303219 gui_mch_exit(int rc)
32313220 {
3232- /* TODO: find out all what is missing here? */
3221+ // TODO: find out all what is missing here?
32333222 DisposeRgn(cursorRgn);
32343223
32353224 #ifdef USE_CARBONKEYHANDLER
@@ -3250,7 +3239,7 @@
32503239 DeleteTSMDocument(gTSMDocument);
32513240 #endif
32523241
3253- /* Exit to shell? */
3242+ // Exit to shell?
32543243 exit(rc);
32553244 }
32563245
@@ -3260,11 +3249,11 @@
32603249 int
32613250 gui_mch_get_winpos(int *x, int *y)
32623251 {
3263- /* TODO */
3252+ // TODO
32643253 Rect bounds;
32653254 OSStatus status;
32663255
3267- /* Carbon >= 1.0.2, MacOS >= 8.5 */
3256+ // Carbon >= 1.0.2, MacOS >= 8.5
32683257 status = GetWindowBounds(gui.VimWindow, kWindowStructureRgn, &bounds);
32693258
32703259 if (status != noErr)
@@ -3281,9 +3270,8 @@
32813270 void
32823271 gui_mch_set_winpos(int x, int y)
32833272 {
3284- /* TODO: Should make sure the window is move within range
3285- * e.g.: y > ~16 [Menu bar], x > 0, x < screen width
3286- */
3273+ // TODO: Should make sure the window is move within range
3274+ // e.g.: y > ~16 [Menu bar], x > 0, x < screen width
32873275 MoveWindowStructure(gui.VimWindow, x, y);
32883276 }
32893277
@@ -3304,9 +3292,9 @@
33043292 {
33053293 VimPort = GetWindowPort(gui.VimWindow);
33063294 GetPortBounds(VimPort, &VimBound);
3307- VimBound.left = -gui.scrollbar_width; /* + 1;*/
3295+ VimBound.left = -gui.scrollbar_width; // + 1;
33083296 SetPortBounds(VimPort, &VimBound);
3309- /* GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??*/
3297+ // GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??
33103298 }
33113299 else
33123300 {
@@ -3351,13 +3339,13 @@
33513339 OSStatus status;
33523340 FontSelectionQDStyle curr_font;
33533341
3354- /* Initialize the Font Panel with the current font. */
3342+ // Initialize the Font Panel with the current font.
33553343 curr_font.instance.fontFamily = gui.norm_font & 0xFFFF;
33563344 curr_font.size = (gui.norm_font >> 16);
3357- /* TODO: set fontStyle once styles are supported in gui_mac_find_font() */
3345+ // TODO: set fontStyle once styles are supported in gui_mac_find_font()
33583346 curr_font.instance.fontStyle = 0;
33593347 curr_font.hasColor = false;
3360- curr_font.version = 0; /* version number of the style structure */
3348+ curr_font.version = 0; // version number of the style structure
33613349 status = SetFontInfoForSelection(kFontSelectionQDType,
33623350 /*numStyles=*/1, &curr_font, /*eventTarget=*/NULL);
33633351
@@ -3365,7 +3353,7 @@
33653353 gFontPanelInfo.style = curr_font.instance.fontStyle;
33663354 gFontPanelInfo.size = curr_font.size;
33673355
3368- /* Pop up the Font Panel. */
3356+ // Pop up the Font Panel.
33693357 status = FPShowHideFontPanel();
33703358 if (status == noErr)
33713359 {
@@ -3412,7 +3400,7 @@
34123400 int
34133401 gui_mch_init_font(char_u *font_name, int fontset)
34143402 {
3415- /* TODO: Add support for bold italic underline proportional etc... */
3403+ // TODO: Add support for bold italic underline proportional etc...
34163404 Str255 suggestedFont = "\pMonaco";
34173405 int suggestedSize = 10;
34183406 FontInfo font_info;
@@ -3426,12 +3414,12 @@
34263414
34273415 if (font_name == NULL)
34283416 {
3429- /* First try to get the suggested font */
3417+ // First try to get the suggested font
34303418 GetFNum(suggestedFont, &font_id);
34313419
34323420 if (font_id == 0)
34333421 {
3434- /* Then pickup the standard application font */
3422+ // Then pickup the standard application font
34353423 font_id = GetAppFont();
34363424 STRCPY(used_font_name, "default");
34373425 }
@@ -3447,14 +3435,14 @@
34473435 if (font == NOFONT)
34483436 return FAIL;
34493437
3450- /* Set guifont to the name of the selected font. */
3438+ // Set guifont to the name of the selected font.
34513439 new_p_guifont = alloc(STRLEN(used_font_name) + 1);
34523440 if (new_p_guifont != NULL)
34533441 {
34543442 STRCPY(new_p_guifont, used_font_name);
34553443 vim_free(p_guifont);
34563444 p_guifont = new_p_guifont;
3457- /* Replace spaces in the font name with underscores. */
3445+ // Replace spaces in the font name with underscores.
34583446 for ( ; *new_p_guifont; ++new_p_guifont)
34593447 {
34603448 if (*new_p_guifont == ' ')
@@ -3587,8 +3575,8 @@
35873575
35883576 if (has_mbyte)
35893577 {
3590- /* FIXME: we should use a more mbyte sensitive way to support
3591- * wide font drawing */
3578+ // FIXME: we should use a more mbyte sensitive way to support
3579+ // wide font drawing
35923580 fontWidth = Long2Fix(gui.char_width * 2);
35933581
35943582 if (ATSUSetAttributes(gWideFontStyle,
@@ -3615,7 +3603,7 @@
36153603
36163604 if (p_macatsui && gFontStyle)
36173605 {
3618- /* Avoid setting same font again */
3606+ // Avoid setting same font again
36193607 if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue + 1,
36203608 sizeof(font), &currFont, &actualFontByteCount) == noErr
36213609 && actualFontByteCount == (sizeof font))
@@ -3629,14 +3617,14 @@
36293617
36303618 if (p_macatsui && !gIsFontFallbackSet)
36313619 {
3632- /* Setup automatic font substitution. The user's guifontwide
3633- * is tried first, then the system tries other fonts. */
3634-/*
3620+ // Setup automatic font substitution. The user's guifontwide
3621+ // is tried first, then the system tries other fonts.
3622+#if 0
36353623 ATSUAttributeTag fallbackTags[] = { kATSULineFontFallbacksTag };
36363624 ByteCount fallbackSizes[] = { sizeof(ATSUFontFallbacks) };
36373625 ATSUCreateFontFallbacks(&gFontFallbacks);
36383626 ATSUSetObjFontFallbacks(gFontFallbacks, );
3639-*/
3627+#endif
36403628 if (gui.wide_font)
36413629 {
36423630 ATSUFontID fallbackFonts;
@@ -3652,9 +3640,7 @@
36523640 &fallbackFonts,
36533641 kATSUSequentialFallbacksPreferred);
36543642 }
3655-/*
3656- ATSUAttributeValuePtr fallbackValues[] = { };
3657-*/
3643+// ATSUAttributeValuePtr fallbackValues[] = { };
36583644 }
36593645 }
36603646 #endif
@@ -3684,8 +3670,7 @@
36843670 guicolor_T
36853671 gui_mch_get_color(char_u *name)
36863672 {
3687- /* TODO: Add support for the new named color of MacOS 8
3688- */
3673+ // TODO: Add support for the new named color of MacOS 8
36893674 RGBColor MacColor;
36903675
36913676 if (STRICMP(name, "hilite") == 0)
@@ -3786,7 +3771,7 @@
37863771 */
37873772 if (gMacSystemVersion >= 0x1020)
37883773 {
3789- /* Quartz antialiasing is available only in OS 10.2 and later. */
3774+ // Quartz antialiasing is available only in OS 10.2 and later.
37903775 UInt32 qd_flags = (p_antialias ?
37913776 kQDUseCGTextRendering | kQDUseCGTextMetrics : 0);
37923777 QDSwapTextFlags(qd_flags);
@@ -3808,10 +3793,10 @@
38083793
38093794 rc.left = FILL_X(col);
38103795 rc.top = FILL_Y(row);
3811- /* Multibyte computation taken from gui_w32.c */
3796+ // Multibyte computation taken from gui_w32.c
38123797 if (has_mbyte)
38133798 {
3814- /* Compute the length in display cells. */
3799+ // Compute the length in display cells.
38153800 rc.right = FILL_X(col + mb_string2cells(s, len));
38163801 }
38173802 else
@@ -3831,7 +3816,7 @@
38313816 face |= underline;
38323817 TextFace(face);
38333818
3834- /* Quartz antialiasing works only in srcOr transfer mode. */
3819+ // Quartz antialiasing works only in srcOr transfer mode.
38353820 TextMode(srcOr);
38363821
38373822 MoveTo(TEXT_X(col), TEXT_Y(row));
@@ -3839,11 +3824,11 @@
38393824 }
38403825 else
38413826 {
3842- /* Use old-style, non-antialiased QuickDraw text rendering. */
3827+ // Use old-style, non-antialiased QuickDraw text rendering.
38433828 TextMode(srcCopy);
38443829 TextFace(normal);
38453830
3846- /* SelectFont(hdc, gui.currFont); */
3831+ // SelectFont(hdc, gui.currFont);
38473832
38483833 if (flags & DRAW_TRANSP)
38493834 TextMode(srcOr);
@@ -3881,13 +3866,13 @@
38813866 static void
38823867 draw_string_ATSUI(int row, int col, char_u *s, int len, int flags)
38833868 {
3884- /* ATSUI requires utf-16 strings */
3869+ // ATSUI requires utf-16 strings
38853870 UniCharCount utf16_len;
38863871 UniChar *tofree = mac_enc_to_utf16(s, len, (size_t *)&utf16_len);
38873872 utf16_len /= sizeof(UniChar);
38883873
3889- /* - ATSUI automatically antialiases text (Someone)
3890- * - for some reason it does not work... (Jussi) */
3874+ // - ATSUI automatically antialiases text (Someone)
3875+ // - for some reason it does not work... (Jussi)
38913876 #ifdef MAC_ATSUI_DEBUG
38923877 fprintf(stderr, "row = %d, col = %d, len = %d: '%c'\n",
38933878 row, col, len, len == 1 ? s[0] : ' ');
@@ -3907,10 +3892,10 @@
39073892
39083893 rc.left = FILL_X(col);
39093894 rc.top = FILL_Y(row);
3910- /* Multibyte computation taken from gui_w32.c */
3895+ // Multibyte computation taken from gui_w32.c
39113896 if (has_mbyte)
39123897 {
3913- /* Compute the length in display cells. */
3898+ // Compute the length in display cells.
39143899 rc.right = FILL_X(col + mb_string2cells(s, len));
39153900 }
39163901 else
@@ -3924,7 +3909,7 @@
39243909 TextMode(srcCopy);
39253910 TextFace(normal);
39263911
3927- /* SelectFont(hdc, gui.currFont); */
3912+ // SelectFont(hdc, gui.currFont);
39283913 if (flags & DRAW_TRANSP)
39293914 TextMode(srcOr);
39303915
@@ -3975,14 +3960,14 @@
39753960 ATSUSetRunStyle(textLayout, gFontStyle,
39763961 kATSUFromTextBeginning, kATSUToTextEnd); */
39773962
3978- /* Compute the length in display cells. */
3963+ // Compute the length in display cells.
39793964 for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
39803965 {
39813966 width_in_cell = (*mb_ptr2cells)(s + n);
39823967
3983- /* probably we are switching from single byte character
3984- * to multibyte characters (which requires more than one
3985- * cell to draw) */
3968+ // probably we are switching from single byte character
3969+ // to multibyte characters (which requires more than one
3970+ // cell to draw)
39863971 if (width_in_cell != last_width_in_cell)
39873972 {
39883973 #ifdef MAC_ATSUI_DEBUG
@@ -4007,7 +3992,7 @@
40073992 fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n",
40083993 n, last_width_in_cell, width_in_cell, offset, yet_to_draw);
40093994 #endif
4010- /* finish the rest style */
3995+ // finish the rest style
40113996 textStyle = width_in_cell > 1 ? gWideFontStyle : gFontStyle;
40123997 ATSUSetRunStyle(textLayout, textStyle, offset, kATSUToTextEnd);
40133998 }
@@ -4039,7 +4024,7 @@
40394024 }
40404025 }
40414026
4042- /* drawing is done, now reset bold to normal */
4027+ // drawing is done, now reset bold to normal
40434028 if (gFontStyle && flags & DRAW_BOLD)
40444029 {
40454030 Boolean attValue = false;
@@ -4065,10 +4050,10 @@
40654050 {
40664051 #if defined(USE_ATSUI_DRAWING)
40674052 if (p_macatsui == 0 && p_macatsui_last != 0)
4068- /* switch from macatsui to nomacatsui */
4053+ // switch from macatsui to nomacatsui
40694054 gui_mac_dispose_atsui_style();
40704055 else if (p_macatsui != 0 && p_macatsui_last == 0)
4071- /* switch from nomacatsui to macatsui */
4056+ // switch from nomacatsui to macatsui
40724057 gui_mac_create_atsui_style();
40734058
40744059 if (p_macatsui)
@@ -4096,13 +4081,13 @@
40964081 void
40974082 gui_mch_beep(void)
40984083 {
4099- SysBeep(1); /* Should this be 0? (????) */
4084+ SysBeep(1); // Should this be 0? (????)
41004085 }
41014086
41024087 void
41034088 gui_mch_flash(int msec)
41044089 {
4105- /* Do a visual beep by reversing the foreground and background colors */
4090+ // Do a visual beep by reversing the foreground and background colors
41064091 Rect rc;
41074092
41084093 /*
@@ -4114,7 +4099,7 @@
41144099 rc.bottom = gui.num_rows * gui.char_height;
41154100 InvertRect(&rc);
41164101
4117- ui_delay((long)msec, TRUE); /* wait for some msec */
4102+ ui_delay((long)msec, TRUE); // wait for some msec
41184103
41194104 InvertRect(&rc);
41204105 }
@@ -4143,10 +4128,9 @@
41434128 void
41444129 gui_mch_iconify(void)
41454130 {
4146- /* TODO: find out what could replace iconify
4147- * -window shade?
4148- * -hide application?
4149- */
4131+ // TODO: find out what could replace iconify
4132+ // -window shade?
4133+ // -hide application?
41504134 }
41514135
41524136 #if defined(FEAT_EVAL) || defined(PROTO)
@@ -4156,7 +4140,7 @@
41564140 void
41574141 gui_mch_set_foreground(void)
41584142 {
4159- /* TODO */
4143+ // TODO
41604144 }
41614145 #endif
41624146
@@ -4192,7 +4176,7 @@
41924176 Rect rc;
41934177
41944178 #ifdef FEAT_RIGHTLEFT
4195- /* vertical line should be on the right of current point */
4179+ // vertical line should be on the right of current point
41964180 if (CURSOR_BAR_RIGHT)
41974181 rc.left = FILL_X(gui.col + 1) - w;
41984182 else
@@ -4219,14 +4203,13 @@
42194203 void
42204204 gui_mch_update(void)
42214205 {
4222- /* TODO: find what to do
4223- * maybe call gui_mch_wait_for_chars (0)
4224- * more like look at EventQueue then
4225- * call heart of gui_mch_wait_for_chars;
4226- *
4227- * if (eventther)
4228- * gui_mac_handle_event(&event);
4229- */
4206+ // TODO: find what to do
4207+ // maybe call gui_mch_wait_for_chars (0)
4208+ // more like look at EventQueue then
4209+ // call heart of gui_mch_wait_for_chars;
4210+ //
4211+ // if (eventther)
4212+ // gui_mac_handle_event(&event);
42304213 EventRecord theEvent;
42314214
42324215 if (EventAvail(everyEvent, &theEvent))
@@ -4266,13 +4249,12 @@
42664249 long currentTick;
42674250 long sleeppyTick;
42684251
4269- /* If we are providing life feedback with the scrollbar,
4270- * we don't want to try to wait for an event, or else
4271- * there won't be any life feedback.
4272- */
4252+ // If we are providing life feedback with the scrollbar,
4253+ // we don't want to try to wait for an event, or else
4254+ // there won't be any life feedback.
42734255 if (dragged_sb != NULL)
42744256 return FAIL;
4275- /* TODO: Check if FAIL is the proper return code */
4257+ // TODO: Check if FAIL is the proper return code
42764258
42774259 entryTick = TickCount();
42784260
@@ -4280,12 +4262,15 @@
42804262
42814263 do
42824264 {
4283-/* if (dragRectControl == kCreateEmpty)
4265+#if 0
4266+ if (dragRectControl == kCreateEmpty)
42844267 {
42854268 dragRgn = NULL;
42864269 dragRectControl = kNothing;
42874270 }
4288- else*/ if (dragRectControl == kCreateRect)
4271+ else
4272+#endif
4273+ if (dragRectControl == kCreateRect)
42894274 {
42904275 dragRgn = cursorRgn;
42914276 RectRgn(dragRgn, &dragRect);
@@ -4297,7 +4282,7 @@
42974282 * event arrives. No need to check for input_buf_full because we are
42984283 * returning as soon as it contains a single char.
42994284 */
4300- /* TODO: reduce wtime accordingly??? */
4285+ // TODO: reduce wtime accordingly???
43014286 if (wtime > -1)
43024287 sleeppyTick = 60 * wtime / 1000;
43034288 else
@@ -4324,11 +4309,13 @@
43244309 * Output routines.
43254310 */
43264311
4327-/* Flush any output to the screen */
4312+/*
4313+ * Flush any output to the screen
4314+ */
43284315 void
43294316 gui_mch_flush(void)
43304317 {
4331- /* TODO: Is anything needed here? */
4318+ // TODO: Is anything needed here?
43324319 }
43334320
43344321 /*
@@ -4368,9 +4355,8 @@
43684355
43694356 gui_mch_set_bg_color(gui.back_pixel);
43704357 EraseRect(&rc);
4371-/* gui_mch_set_fg_color(gui.norm_pixel);
4372- FrameRect(&rc);
4373-*/
4358+// gui_mch_set_fg_color(gui.norm_pixel);
4359+// FrameRect(&rc);
43744360 }
43754361
43764362 /*
@@ -4382,7 +4368,7 @@
43824368 {
43834369 Rect rc;
43844370
4385- /* changed without checking! */
4371+ // changed without checking!
43864372 rc.left = FILL_X(gui.scroll_region_left);
43874373 rc.right = FILL_X(gui.scroll_region_right + 1);
43884374 rc.top = FILL_Y(row);
@@ -4414,7 +4400,7 @@
44144400
44154401 ScrollRect(&rc, 0, gui.char_height * num_lines, (RgnHandle) nil);
44164402
4417- /* Update gui.cursor_row if the cursor scrolled or copied over */
4403+ // Update gui.cursor_row if the cursor scrolled or copied over
44184404 if (gui.cursor_row >= gui.row
44194405 && gui.cursor_col >= gui.scroll_region_left
44204406 && gui.cursor_col <= gui.scroll_region_right)
@@ -4474,10 +4460,10 @@
44744460
44754461 ReserveMem(scrapSize);
44764462
4477- /* In CARBON we don't need a Handle, a pointer is good */
4463+ // In CARBON we don't need a Handle, a pointer is good
44784464 textOfClip = NewHandle(scrapSize);
44794465
4480- /* tempclip = alloc(scrapSize+1); */
4466+ // tempclip = alloc(scrapSize+1);
44814467 HLock(textOfClip);
44824468 error = GetScrapFlavorData(scrap,
44834469 flavor ? VIMSCRAPFLAVOR : SCRAPTEXTFLAVOR,
@@ -4495,7 +4481,7 @@
44954481
44964482 #ifdef MACOS_CONVERT
44974483 {
4498- /* Convert from utf-16 (clipboard) */
4484+ // Convert from utf-16 (clipboard)
44994485 size_t encLen = 0;
45004486 char_u *to = mac_utf16_to_enc((UniChar *)tempclip, scrapSize, &encLen);
45014487
@@ -4601,7 +4587,7 @@
46014587 {
46024588 Rect VimBound;
46034589
4604-/* HideWindow(gui.VimWindow); */
4590+// HideWindow(gui.VimWindow);
46054591 GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &VimBound);
46064592
46074593 if (gui.which_scrollbars[SBAR_LEFT])
@@ -4647,33 +4633,33 @@
46474633 * Carbon Help suggest to use only id between 1 and 235
46484634 */
46494635 static long next_avail_id = 128;
4650- long menu_after_me = 0; /* Default to the end */
4636+ long menu_after_me = 0; // Default to the end
46514637 CFStringRef name;
46524638 short index;
46534639 vimmenu_T *parent = menu->parent;
46544640 vimmenu_T *brother = menu->next;
46554641
4656- /* Cannot add a menu if ... */
4642+ // Cannot add a menu if ...
46574643 if ((parent != NULL && parent->submenu_id == 0))
46584644 return;
46594645
4660- /* menu ID greater than 1024 are reserved for ??? */
4646+ // menu ID greater than 1024 are reserved for ???
46614647 if (next_avail_id == 1024)
46624648 return;
46634649
4664- /* My brother could be the PopUp, find my real brother */
4650+ // My brother could be the PopUp, find my real brother
46654651 while ((brother != NULL) && (!menu_is_menubar(brother->name)))
46664652 brother = brother->next;
46674653
4668- /* Find where to insert the menu (for MenuBar) */
4654+ // Find where to insert the menu (for MenuBar)
46694655 if ((parent == NULL) && (brother != NULL))
46704656 menu_after_me = brother->submenu_id;
46714657
4672- /* If the menu is not part of the menubar (and its submenus), add it 'nowhere' */
4658+ // If the menu is not part of the menubar (and its submenus), add it 'nowhere'
46734659 if (!menu_is_menubar(menu->name))
46744660 menu_after_me = hierMenu;
46754661
4676- /* Convert the name */
4662+ // Convert the name
46774663 #ifdef MACOS_CONVERT
46784664 name = menu_title_removing_mnemonic(menu);
46794665 #else
@@ -4682,12 +4668,11 @@
46824668 if (name == NULL)
46834669 return;
46844670
4685- /* Create the menu unless it's the help menu */
4671+ // Create the menu unless it's the help menu
46864672 {
4687- /* Carbon suggest use of
4688- * OSStatus CreateNewMenu(MenuID, MenuAttributes, MenuRef *);
4689- * OSStatus SetMenuTitle(MenuRef, ConstStr255Param title);
4690- */
4673+ // Carbon suggest use of
4674+ // OSStatus CreateNewMenu(MenuID, MenuAttributes, MenuRef *);
4675+ // OSStatus SetMenuTitle(MenuRef, ConstStr255Param title);
46914676 menu->submenu_id = next_avail_id;
46924677 if (CreateNewMenu(menu->submenu_id, 0, (MenuRef *)&menu->submenu_handle) == noErr)
46934678 SetMenuTitleWithCFString((MenuRef)menu->submenu_handle, name);
@@ -4696,29 +4681,27 @@
46964681
46974682 if (parent == NULL)
46984683 {
4699- /* Adding a menu to the menubar, or in the no mans land (for PopUp) */
4700-
4701- /* TODO: Verify if we could only Insert Menu if really part of the
4702- * menubar The Inserted menu are scanned or the Command-key combos
4703- */
4704-
4705- /* Insert the menu */
4706- InsertMenu(menu->submenu_handle, menu_after_me); /* insert before */
4684+ // Adding a menu to the menubar, or in the no mans land (for PopUp)
4685+
4686+ // TODO: Verify if we could only Insert Menu if really part of the
4687+ // menubar The Inserted menu are scanned or the Command-key combos
4688+
4689+ // Insert the menu
4690+ InsertMenu(menu->submenu_handle, menu_after_me); // insert before
47074691 #if 1
4708- /* Vim should normally update it. TODO: verify */
4692+ // Vim should normally update it. TODO: verify
47094693 DrawMenuBar();
47104694 #endif
47114695 }
47124696 else
47134697 {
4714- /* Adding as a submenu */
4698+ // Adding as a submenu
47154699
47164700 index = gui_mac_get_menu_item_index(menu);
47174701
4718- /* Call InsertMenuItem followed by SetMenuItemText
4719- * to avoid special character recognition by InsertMenuItem
4720- */
4721- InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
4702+ // Call InsertMenuItem followed by SetMenuItemText
4703+ // to avoid special character recognition by InsertMenuItem
4704+ InsertMenuItem(parent->submenu_handle, "\p ", idx); // afterItem
47224705 SetMenuItemTextWithCFString(parent->submenu_handle, idx+1, name);
47234706 SetItemCmd(parent->submenu_handle, idx+1, 0x1B);
47244707 SetItemMark(parent->submenu_handle, idx+1, menu->submenu_id);
@@ -4728,7 +4711,7 @@
47284711 CFRelease(name);
47294712
47304713 #if 0
4731- /* Done by Vim later on */
4714+ // Done by Vim later on
47324715 DrawMenuBar();
47334716 #endif
47344717 }
@@ -4743,31 +4726,30 @@
47434726 vimmenu_T *parent = menu->parent;
47444727 int menu_inserted;
47454728
4746- /* Cannot add item, if the menu have not been created */
4729+ // Cannot add item, if the menu have not been created
47474730 if (parent->submenu_id == 0)
47484731 return;
47494732
4750- /* Could call SetMenuRefCon [CARBON] to associate with the Menu,
4751- for older OS call GetMenuItemData (menu, item, isCommandID?, data) */
4752-
4753- /* Convert the name */
4733+ // Could call SetMenuRefCon [CARBON] to associate with the Menu,
4734+ // for older OS call GetMenuItemData (menu, item, isCommandID?, data)
4735+
4736+ // Convert the name
47544737 #ifdef MACOS_CONVERT
47554738 name = menu_title_removing_mnemonic(menu);
47564739 #else
47574740 name = C2Pascal_save(menu->dname);
47584741 #endif
47594742
4760- /* Where are just a menu item, so no handle, no id */
4743+ // Where are just a menu item, so no handle, no id
47614744 menu->submenu_id = 0;
47624745 menu->submenu_handle = NULL;
47634746
47644747 menu_inserted = 0;
47654748 if (menu->actext)
47664749 {
4767- /* If the accelerator text for the menu item looks like it describes
4768- * a command key (e.g., "<D-S-t>" or "<C-7>"), display it as the
4769- * item's command equivalent.
4770- */
4750+ // If the accelerator text for the menu item looks like it describes
4751+ // a command key (e.g., "<D-S-t>" or "<C-7>"), display it as the
4752+ // item's command equivalent.
47714753 int key = 0;
47724754 int modifiers = 0;
47734755 char_u *p_actext;
@@ -4776,39 +4758,36 @@
47764758 key = find_special_key(&p_actext, &modifiers, FALSE, FALSE, FALSE,
47774759 TRUE, NULL);
47784760 if (*p_actext != 0)
4779- key = 0; /* error: trailing text */
4780- /* find_special_key() returns a keycode with as many of the
4781- * specified modifiers as appropriate already applied (e.g., for
4782- * "<D-C-x>" it returns Ctrl-X as the keycode and MOD_MASK_CMD
4783- * as the only modifier). Since we want to display all of the
4784- * modifiers, we need to convert the keycode back to a printable
4785- * character plus modifiers.
4786- * TODO: Write an alternative find_special_key() that doesn't
4787- * apply modifiers.
4788- */
4761+ key = 0; // error: trailing text
4762+ // find_special_key() returns a keycode with as many of the
4763+ // specified modifiers as appropriate already applied (e.g., for
4764+ // "<D-C-x>" it returns Ctrl-X as the keycode and MOD_MASK_CMD
4765+ // as the only modifier). Since we want to display all of the
4766+ // modifiers, we need to convert the keycode back to a printable
4767+ // character plus modifiers.
4768+ // TODO: Write an alternative find_special_key() that doesn't
4769+ // apply modifiers.
47894770 if (key > 0 && key < 32)
47904771 {
4791- /* Convert a control key to an uppercase letter. Note that
4792- * by this point it is no longer possible to distinguish
4793- * between, e.g., Ctrl-S and Ctrl-Shift-S.
4794- */
4772+ // Convert a control key to an uppercase letter. Note that
4773+ // by this point it is no longer possible to distinguish
4774+ // between, e.g., Ctrl-S and Ctrl-Shift-S.
47954775 modifiers |= MOD_MASK_CTRL;
47964776 key += '@';
47974777 }
4798- /* If the keycode is an uppercase letter, set the Shift modifier.
4799- * If it is a lowercase letter, don't set the modifier, but convert
4800- * the letter to uppercase for display in the menu.
4801- */
4778+ // If the keycode is an uppercase letter, set the Shift modifier.
4779+ // If it is a lowercase letter, don't set the modifier, but convert
4780+ // the letter to uppercase for display in the menu.
48024781 else if (key >= 'A' && key <= 'Z')
48034782 modifiers |= MOD_MASK_SHIFT;
48044783 else if (key >= 'a' && key <= 'z')
48054784 key += 'A' - 'a';
4806- /* Note: keycodes below 0x22 are reserved by Apple. */
4785+ // Note: keycodes below 0x22 are reserved by Apple.
48074786 if (key >= 0x22 && vim_isprintc_strict(key))
48084787 {
48094788 int valid = 1;
48104789 char_u mac_mods = kMenuNoModifiers;
4811- /* Convert Vim modifier codes to Menu Manager equivalents. */
4790+ // Convert Vim modifier codes to Menu Manager equivalents.
48124791 if (modifiers & MOD_MASK_SHIFT)
48134792 mac_mods |= kMenuShiftModifier;
48144793 if (modifiers & MOD_MASK_CTRL)
@@ -4816,30 +4795,29 @@
48164795 if (!(modifiers & MOD_MASK_CMD))
48174796 mac_mods |= kMenuNoCommandModifier;
48184797 if (modifiers & MOD_MASK_ALT || modifiers & MOD_MASK_MULTI_CLICK)
4819- valid = 0; /* TODO: will Alt someday map to Option? */
4798+ valid = 0; // TODO: will Alt someday map to Option?
48204799 if (valid)
48214800 {
48224801 char_u item_txt[10];
4823- /* Insert the menu item after idx, with its command key. */
4802+ // Insert the menu item after idx, with its command key.
48244803 item_txt[0] = 3; item_txt[1] = ' '; item_txt[2] = '/';
48254804 item_txt[3] = key;
48264805 InsertMenuItem(parent->submenu_handle, item_txt, idx);
4827- /* Set the modifier keys. */
4806+ // Set the modifier keys.
48284807 SetMenuItemModifiers(parent->submenu_handle, idx+1, mac_mods);
48294808 menu_inserted = 1;
48304809 }
48314810 }
48324811 }
4833- /* Call InsertMenuItem followed by SetMenuItemText
4834- * to avoid special character recognition by InsertMenuItem
4835- */
4812+ // Call InsertMenuItem followed by SetMenuItemText
4813+ // to avoid special character recognition by InsertMenuItem
48364814 if (!menu_inserted)
4837- InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
4838- /* Set the menu item name. */
4815+ InsertMenuItem(parent->submenu_handle, "\p ", idx); // afterItem
4816+ // Set the menu item name.
48394817 SetMenuItemTextWithCFString(parent->submenu_handle, idx+1, name);
48404818
48414819 #if 0
4842- /* Called by Vim */
4820+ // Called by Vim
48434821 DrawMenuBar();
48444822 #endif
48454823
@@ -4849,7 +4827,7 @@
48494827 void
48504828 gui_mch_toggle_tearoffs(int enable)
48514829 {
4852- /* no tearoff menus */
4830+ // no tearoff menus
48534831 }
48544832
48554833 /*
@@ -4865,10 +4843,10 @@
48654843 if (menu->parent)
48664844 {
48674845 {
4868- /* For now just don't delete help menu items. (Huh? Dany) */
4846+ // For now just don't delete help menu items. (Huh? Dany)
48694847 DeleteMenuItem(menu->parent->submenu_handle, index);
48704848
4871- /* Delete the Menu if it was a hierarchical Menu */
4849+ // Delete the Menu if it was a hierarchical Menu
48724850 if (menu->submenu_id != 0)
48734851 {
48744852 DeleteMenu(menu->submenu_id);
@@ -4890,7 +4868,7 @@
48904868 DisposeMenu(menu->submenu_handle);
48914869 }
48924870 }
4893- /* Shouldn't this be already done by Vim. TODO: Check */
4871+ // Shouldn't this be already done by Vim. TODO: Check
48944872 DrawMenuBar();
48954873 }
48964874
@@ -4900,7 +4878,7 @@
49004878 void
49014879 gui_mch_menu_grey(vimmenu_T *menu, int grey)
49024880 {
4903- /* TODO: Check if menu really exists */
4881+ // TODO: Check if menu really exists
49044882 short index = gui_mac_get_menu_item_index(menu);
49054883 /*
49064884 index = menu->index;
@@ -4929,7 +4907,7 @@
49294907 void
49304908 gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
49314909 {
4932- /* There's no hidden mode on MacOS */
4910+ // There's no hidden mode on MacOS
49334911 gui_mch_menu_grey(menu, hidden);
49344912 }
49354913
@@ -4988,7 +4966,8 @@
49884966 int h)
49894967 {
49904968 gui_mch_set_bg_color(gui.back_pixel);
4991-/* if (gui.which_scrollbars[SBAR_LEFT])
4969+#if 0
4970+ if (gui.which_scrollbars[SBAR_LEFT])
49924971 {
49934972 MoveControl(sb->id, x-16, y);
49944973 SizeControl(sb->id, w + 1, h);
@@ -4997,7 +4976,8 @@
49974976 {
49984977 MoveControl(sb->id, x, y);
49994978 SizeControl(sb->id, w + 1, h);
5000- }*/
4979+ }
4980+#endif
50014981 if (sb == &gui.bottom_sbar)
50024982 h += 1;
50034983 else
@@ -5016,7 +4996,7 @@
50164996 void
50174997 gui_mch_create_scrollbar(
50184998 scrollbar_T *sb,
5019- int orient) /* SBAR_VERT or SBAR_HORIZ */
4999+ int orient) // SBAR_VERT or SBAR_HORIZ
50205000 {
50215001 Rect bounds;
50225002
@@ -5029,9 +5009,9 @@
50295009 &bounds,
50305010 "\pScrollBar",
50315011 TRUE,
5032- 0, /* current*/
5033- 0, /* top */
5034- 0, /* bottom */
5012+ 0, // current
5013+ 0, // top
5014+ 0, // bottom
50355015 kControlScrollBarLiveProc,
50365016 (long) sb->ident);
50375017 #ifdef DEBUG_MAC_SB
@@ -5072,10 +5052,12 @@
50725052 void
50735053 gui_mch_set_blinking(long wait, long on, long off)
50745054 {
5075- /* TODO: TODO: TODO: TODO: */
5076-/* blink_waittime = wait;
5055+#if 0
5056+ // TODO: TODO: TODO: TODO:
5057+ blink_waittime = wait;
50775058 blink_ontime = on;
5078- blink_offtime = off;*/
5059+ blink_offtime = off;
5060+#endif
50795061 }
50805062
50815063 /*
@@ -5086,11 +5068,13 @@
50865068 {
50875069 if (may_call_gui_update_cursor)
50885070 gui_update_cursor(TRUE, FALSE);
5089- /* TODO: TODO: TODO: TODO: */
5090-/* gui_w32_rm_blink_timer();
5071+#if 0
5072+ // TODO: TODO: TODO: TODO:
5073+ gui_w32_rm_blink_timer();
50915074 if (blink_state == BLINK_OFF)
50925075 gui_update_cursor(TRUE, FALSE);
5093- blink_state = BLINK_NONE;*/
5076+ blink_state = BLINK_NONE;
5077+#endif
50945078 }
50955079
50965080 /*
@@ -5101,17 +5085,19 @@
51015085 gui_mch_start_blink(void)
51025086 {
51035087 gui_update_cursor(TRUE, FALSE);
5104- /* TODO: TODO: TODO: TODO: */
5105-/* gui_w32_rm_blink_timer(); */
5106-
5107- /* Only switch blinking on if none of the times is zero */
5108-/* if (blink_waittime && blink_ontime && blink_offtime)
5088+ // TODO: TODO: TODO: TODO:
5089+// gui_w32_rm_blink_timer();
5090+
5091+ // Only switch blinking on if none of the times is zero
5092+#if 0
5093+ if (blink_waittime && blink_ontime && blink_offtime)
51095094 {
51105095 blink_timer = SetTimer(NULL, 0, (UINT)blink_waittime,
51115096 (TIMERPROC)_OnBlinkTimer);
51125097 blink_state = BLINK_ON;
51135098 gui_update_cursor(TRUE, FALSE);
5114- }*/
5099+ }
5100+#endif
51155101 }
51165102
51175103 /*
@@ -5153,7 +5139,7 @@
51535139 char_u *initdir,
51545140 char_u *filter)
51555141 {
5156- /* TODO: Add Ammon's safety check (Dany) */
5142+ // TODO: Add Ammon's safety check (Dany)
51575143 NavReplyRecord reply;
51585144 char_u *fname = NULL;
51595145 char_u **fnames = NULL;
@@ -5161,33 +5147,32 @@
51615147 NavDialogOptions navOptions;
51625148 OSErr error;
51635149
5164- /* Get Navigation Service Defaults value */
5150+ // Get Navigation Service Defaults value
51655151 NavGetDefaultDialogOptions(&navOptions);
51665152
51675153
5168- /* TODO: If we get a :browse args, set the Multiple bit. */
5154+ // TODO: If we get a :browse args, set the Multiple bit.
51695155 navOptions.dialogOptionFlags = kNavAllowInvisibleFiles
51705156 | kNavDontAutoTranslate
51715157 | kNavDontAddTranslateItems
5172- /* | kNavAllowMultipleFiles */
5158+ // | kNavAllowMultipleFiles
51735159 | kNavAllowStationery;
51745160
51755161 (void) C2PascalString(title, &navOptions.message);
51765162 (void) C2PascalString(dflt, &navOptions.savedFileName);
5177- /* Could set clientName?
5178- * windowTitle? (there's no title bar?)
5179- */
5163+ // Could set clientName?
5164+ // windowTitle? (there's no title bar?)
51805165
51815166 if (saving)
51825167 {
5183- /* Change first parm AEDesc (typeFSS) *defaultLocation to match dflt */
5168+ // Change first parm AEDesc (typeFSS) *defaultLocation to match dflt
51845169 NavPutFile(NULL, &reply, &navOptions, NULL, 'TEXT', 'VIM!', NULL);
51855170 if (!reply.validRecord)
51865171 return NULL;
51875172 }
51885173 else
51895174 {
5190- /* Change first parm AEDesc (typeFSS) *defaultLocation to match dflt */
5175+ // Change first parm AEDesc (typeFSS) *defaultLocation to match dflt
51915176 NavGetFile(NULL, &reply, &navOptions, NULL, NULL, NULL, NULL, NULL);
51925177 if (!reply.validRecord)
51935178 return NULL;
@@ -5203,10 +5188,10 @@
52035188 vim_free(fnames);
52045189 }
52055190
5206- /* TODO: Shorten the file name if possible */
5191+ // TODO: Shorten the file name if possible
52075192 return fname;
52085193 }
5209-#endif /* FEAT_BROWSE */
5194+#endif // FEAT_BROWSE
52105195
52115196 #ifdef FEAT_GUI_DIALOG
52125197 /*
@@ -5233,9 +5218,9 @@
52335218 typedef struct
52345219 {
52355220 short idx;
5236- short width; /* Size of the text in pixel */
5221+ short width; // Size of the text in pixel
52375222 Rect box;
5238-} vgmDlgItm; /* Vim Gui_Mac.c Dialog Item */
5223+} vgmDlgItm; // Vim Gui_Mac.c Dialog Item
52395224
52405225 #define MoveRectTo(r,x,y) OffsetRect(r,x-r->left,y-r->top)
52415226
@@ -5247,8 +5232,8 @@
52475232 short Y,
52485233 Rect *inBox)
52495234 {
5250-#if 0 /* USE_CARBONIZED */
5251- /* Untested */
5235+#if 0 // USE_CARBONIZED
5236+ // Untested
52525237 MoveDialogItem(theDialog, itemNumber, X, Y);
52535238 if (inBox != nil)
52545239 GetDialogItem(theDialog, itemNumber, &itemType, &itemHandle, inBox);
@@ -5264,9 +5249,9 @@
52645249 GetDialogItem(theDialog, itemNumber, &itemType, &itemHandle, itemBox);
52655250 OffsetRect(itemBox, -itemBox->left, -itemBox->top);
52665251 OffsetRect(itemBox, X, Y);
5267- /* To move a control (like a button) we need to call both
5268- * MoveControl and SetDialogItem. FAQ 6-18 */
5269- if (1) /*(itemType & kControlDialogItem) */
5252+ // To move a control (like a button) we need to call both
5253+ // MoveControl and SetDialogItem. FAQ 6-18
5254+ if (1) //(itemType & kControlDialogItem)
52705255 MoveControl((ControlRef) itemHandle, X, Y);
52715256 SetDialogItem(theDialog, itemNumber, itemType, itemHandle, itemBox);
52725257 #endif
@@ -5285,25 +5270,25 @@
52855270
52865271 GetDialogItem(theDialog, itemNumber, &itemType, &itemHandle, &itemBox);
52875272
5288- /* When width or height is zero do not change it */
5273+ // When width or height is zero do not change it
52895274 if (width == 0)
52905275 width = itemBox.right - itemBox.left;
52915276 if (height == 0)
52925277 height = itemBox.bottom - itemBox.top;
52935278
5294-#if 0 /* USE_CARBONIZED */
5295- SizeDialogItem(theDialog, itemNumber, width, height); /* Untested */
5279+#if 0 // USE_CARBONIZED
5280+ SizeDialogItem(theDialog, itemNumber, width, height); // Untested
52965281 #else
5297- /* Resize the bounding box */
5282+ // Resize the bounding box
52985283 itemBox.right = itemBox.left + width;
52995284 itemBox.bottom = itemBox.top + height;
53005285
5301- /* To resize a control (like a button) we need to call both
5302- * SizeControl and SetDialogItem. (deducted from FAQ 6-18) */
5286+ // To resize a control (like a button) we need to call both
5287+ // SizeControl and SetDialogItem. (deducted from FAQ 6-18)
53035288 if (itemType & kControlDialogItem)
53045289 SizeControl((ControlRef) itemHandle, width, height);
53055290
5306- /* Configure back the item */
5291+ // Configure back the item
53075292 SetDialogItem(theDialog, itemNumber, itemType, itemHandle, &itemBox);
53085293 #endif
53095294 }
@@ -5327,7 +5312,8 @@
53275312 }
53285313
53295314
5330-/* ModalDialog() handler for message dialogs that have hotkey accelerators.
5315+/*
5316+ * ModalDialog() handler for message dialogs that have hotkey accelerators.
53315317 * Expects a mapping of hotkey char to control index in gDialogHotKeys;
53325318 * setting gDialogHotKeys to NULL disables any hotkey handling.
53335319 */
@@ -5350,26 +5336,26 @@
53505336 #endif
53515337 *itemHit = gDialogHotKeys[keyHit];
53525338
5353- /* When handing off to StdFilterProc, pretend that the user
5354- * clicked the control manually. Note that this is also supposed
5355- * to cause the button to hilite briefly (to give some user
5356- * feedback), but this seems not to actually work (or it's too
5357- * fast to be seen).
5358- */
5339+ // When handing off to StdFilterProc, pretend that the user
5340+ // clicked the control manually. Note that this is also supposed
5341+ // to cause the button to hilite briefly (to give some user
5342+ // feedback), but this seems not to actually work (or it's too
5343+ // fast to be seen).
53595344 event->what = kEventControlSimulateHit;
53605345
5361- return true; /* we took care of it */
5346+ return true; // we took care of it
53625347 }
53635348
5364- /* Defer to the OS's standard behavior for this event.
5365- * This ensures that Enter will still activate the default button. */
5349+ // Defer to the OS's standard behavior for this event.
5350+ // This ensures that Enter will still activate the default button.
53665351 return StdFilterProc(theDialog, event, itemHit);
53675352 }
5368- return false; /* Let ModalDialog deal with it */
5353+ return false; // Let ModalDialog deal with it
53695354 }
53705355
53715356
5372-/* TODO: There have been some crashes with dialogs, check your inbox
5357+/*
5358+ * TODO: There have been some crashes with dialogs, check your inbox
53735359 * (Jussi)
53745360 */
53755361 int
@@ -5390,12 +5376,12 @@
53905376 Handle iconHandle;
53915377 DialogPtr theDialog;
53925378 char_u len;
5393- char_u PascalTitle[256]; /* place holder for the title */
5379+ char_u PascalTitle[256]; // place holder for the title
53945380 char_u name[256];
53955381 GrafPtr oldPort;
53965382 short itemHit;
53975383 char_u *buttonChar;
5398- short hotKeys[256]; /* map of hotkey -> control ID */
5384+ short hotKeys[256]; // map of hotkey -> control ID
53995385 char_u aHotKey;
54005386 Rect box;
54015387 short button;
@@ -5403,14 +5389,14 @@
54035389 short itemType;
54045390 short useIcon;
54055391 short width;
5406- short totalButtonWidth = 0; /* the width of all buttons together
5407- including spacing */
5392+ short totalButtonWidth = 0; // the width of all buttons together
5393+ // including spacing
54085394 short widestButton = 0;
5409- short dfltButtonEdge = 20; /* gut feeling */
5410- short dfltElementSpacing = 13; /* from IM:V.2-29 */
5411- short dfltIconSideSpace = 23; /* from IM:V.2-29 */
5412- short maximumWidth = 400; /* gut feeling */
5413- short maxButtonWidth = 175; /* gut feeling */
5395+ short dfltButtonEdge = 20; // gut feeling
5396+ short dfltElementSpacing = 13; // from IM:V.2-29
5397+ short dfltIconSideSpace = 23; // from IM:V.2-29
5398+ short maximumWidth = 400; // gut feeling
5399+ short maxButtonWidth = 175; // gut feeling
54145400
54155401 short vertical;
54165402 short dialogHeight;
@@ -5426,51 +5412,50 @@
54265412
54275413 ModalFilterUPP dialogUPP;
54285414
5429- /* Check 'v' flag in 'guioptions': vertical button placement. */
5415+ // Check 'v' flag in 'guioptions': vertical button placement.
54305416 vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
54315417
5432- /* Create a new Dialog Box from template. */
5418+ // Create a new Dialog Box from template.
54335419 theDialog = GetNewDialog(129, nil, (WindowRef) -1);
54345420
5435- /* Get the WindowRef */
5421+ // Get the WindowRef
54365422 theWindow = GetDialogWindow(theDialog);
54375423
5438- /* Hide the window.
5439- * 1. to avoid seeing slow drawing
5440- * 2. to prevent a problem seen while moving dialog item
5441- * within a visible window. (non-Carbon MacOS 9)
5442- * Could be avoided by changing the resource.
5443- */
5424+ // Hide the window.
5425+ // 1. to avoid seeing slow drawing
5426+ // 2. to prevent a problem seen while moving dialog item
5427+ // within a visible window. (non-Carbon MacOS 9)
5428+ // Could be avoided by changing the resource.
54445429 HideWindow(theWindow);
54455430
5446- /* Change the graphical port to the dialog,
5447- * so we can measure the text with the proper font */
5431+ // Change the graphical port to the dialog,
5432+ // so we can measure the text with the proper font
54485433 GetPort(&oldPort);
54495434 SetPortDialogPort(theDialog);
54505435
5451- /* Get the info about the default text,
5452- * used to calculate the height of the message
5453- * and of the text field */
5436+ // Get the info about the default text,
5437+ // used to calculate the height of the message
5438+ // and of the text field
54545439 GetFontInfo(&textFontInfo);
54555440
5456- /* Set the dialog title */
5441+ // Set the dialog title
54575442 if (title != NULL)
54585443 {
54595444 (void) C2PascalString(title, &PascalTitle);
54605445 SetWTitle(theWindow, PascalTitle);
54615446 }
54625447
5463- /* Creates the buttons and add them to the Dialog Box. */
5448+ // Creates the buttons and add them to the Dialog Box.
54645449 buttonDITL = GetResource('DITL', 130);
54655450 buttonChar = buttons;
54665451 button = 0;
54675452
5468- /* initialize the hotkey mapping */
5453+ // initialize the hotkey mapping
54695454 vim_memset(hotKeys, 0, sizeof(hotKeys));
54705455
54715456 for (;*buttonChar != 0;)
54725457 {
5473- /* Get the name of the button */
5458+ // Get the name of the button
54745459 button++;
54755460 len = 0;
54765461 for (;((*buttonChar != DLG_BUTTON_SEP) && (*buttonChar != 0) && (len < 255)); buttonChar++)
@@ -5493,16 +5478,16 @@
54935478 buttonChar++;
54945479 name[0] = len;
54955480
5496- /* Add the button */
5497- AppendDITL(theDialog, buttonDITL, overlayDITL); /* appendDITLRight); */
5498-
5499- /* Change the button's name */
5481+ // Add the button
5482+ AppendDITL(theDialog, buttonDITL, overlayDITL); // appendDITLRight);
5483+
5484+ // Change the button's name
55005485 macSetDialogItemText(theDialog, button, name);
55015486
5502- /* Resize the button to fit its name */
5487+ // Resize the button to fit its name
55035488 width = StringWidth(name) + 2 * dfltButtonEdge;
5504- /* Limit the size of any button to an acceptable value. */
5505- /* TODO: Should be based on the message width */
5489+ // Limit the size of any button to an acceptable value.
5490+ // TODO: Should be based on the message width
55065491 if (width > maxButtonWidth)
55075492 width = maxButtonWidth;
55085493 macSizeDialogItem(theDialog, button, width, 0);
@@ -5515,7 +5500,7 @@
55155500 ReleaseResource(buttonDITL);
55165501 lastButton = button;
55175502
5518- /* Add the icon to the Dialog Box. */
5503+ // Add the icon to the Dialog Box.
55195504 iconItm.idx = lastButton + 1;
55205505 iconDITL = GetResource('DITL', 131);
55215506 switch (type)
@@ -5530,11 +5515,11 @@
55305515 AppendDITL(theDialog, iconDITL, overlayDITL);
55315516 ReleaseResource(iconDITL);
55325517 GetDialogItem(theDialog, iconItm.idx, &itemType, &itemHandle, &box);
5533- /* TODO: Should the item be freed? */
5518+ // TODO: Should the item be freed?
55345519 iconHandle = GetIcon(useIcon);
55355520 SetDialogItem(theDialog, iconItm.idx, itemType, iconHandle, &box);
55365521
5537- /* Add the message to the Dialog box. */
5522+ // Add the message to the Dialog box.
55385523 messageItm.idx = lastButton + 2;
55395524 messageDITL = GetResource('DITL', 132);
55405525 AppendDITL(theDialog, messageDITL, overlayDITL);
@@ -5544,62 +5529,62 @@
55445529 SetDialogItemText(itemHandle, name);
55455530 messageItm.width = StringWidth(name);
55465531
5547- /* Add the input box if needed */
5532+ // Add the input box if needed
55485533 if (textfield != NULL)
55495534 {
5550- /* Cheat for now reuse the message and convert to text edit */
5535+ // Cheat for now reuse the message and convert to text edit
55515536 inputItm.idx = lastButton + 3;
55525537 inputDITL = GetResource('DITL', 132);
55535538 AppendDITL(theDialog, inputDITL, overlayDITL);
55545539 ReleaseResource(inputDITL);
55555540 GetDialogItem(theDialog, inputItm.idx, &itemType, &itemHandle, &box);
5556-/* SetDialogItem(theDialog, inputItm.idx, kEditTextDialogItem, itemHandle, &box);*/
5541+// SetDialogItem(theDialog, inputItm.idx, kEditTextDialogItem, itemHandle, &box);
55575542 (void) C2PascalString(textfield, &name);
55585543 SetDialogItemText(itemHandle, name);
55595544 inputItm.width = StringWidth(name);
55605545
5561- /* Hotkeys don't make sense if there's a text field */
5546+ // Hotkeys don't make sense if there's a text field
55625547 gDialogHotKeys = NULL;
55635548 }
55645549 else
5565- /* Install hotkey table */
5550+ // Install hotkey table
55665551 gDialogHotKeys = (short *)&hotKeys;
55675552
5568- /* Set the <ENTER> and <ESC> button. */
5553+ // Set the <ENTER> and <ESC> button.
55695554 SetDialogDefaultItem(theDialog, dfltbutton);
55705555 SetDialogCancelItem(theDialog, 0);
55715556
5572- /* Reposition element */
5573-
5574- /* Check if we need to force vertical */
5557+ // Reposition element
5558+
5559+ // Check if we need to force vertical
55755560 if (totalButtonWidth > maximumWidth)
55765561 vertical = TRUE;
55775562
5578- /* Place icon */
5563+ // Place icon
55795564 macMoveDialogItem(theDialog, iconItm.idx, dfltIconSideSpace, dfltElementSpacing, &box);
55805565 iconItm.box.right = box.right;
55815566 iconItm.box.bottom = box.bottom;
55825567
5583- /* Place Message */
5568+ // Place Message
55845569 messageItm.box.left = iconItm.box.right + dfltIconSideSpace;
55855570 macSizeDialogItem(theDialog, messageItm.idx, 0, messageLines * (textFontInfo.ascent + textFontInfo.descent));
55865571 macMoveDialogItem(theDialog, messageItm.idx, messageItm.box.left, dfltElementSpacing, &messageItm.box);
55875572
5588- /* Place Input */
5573+ // Place Input
55895574 if (textfield != NULL)
55905575 {
55915576 inputItm.box.left = messageItm.box.left;
55925577 inputItm.box.top = messageItm.box.bottom + dfltElementSpacing;
55935578 macSizeDialogItem(theDialog, inputItm.idx, 0, textFontInfo.ascent + textFontInfo.descent);
55945579 macMoveDialogItem(theDialog, inputItm.idx, inputItm.box.left, inputItm.box.top, &inputItm.box);
5595- /* Convert the static text into a text edit.
5596- * For some reason this change need to be done last (Dany) */
5580+ // Convert the static text into a text edit.
5581+ // For some reason this change need to be done last (Dany)
55975582 GetDialogItem(theDialog, inputItm.idx, &itemType, &itemHandle, &inputItm.box);
55985583 SetDialogItem(theDialog, inputItm.idx, kEditTextDialogItem, itemHandle, &inputItm.box);
55995584 SelectDialogItemText(theDialog, inputItm.idx, 0, 32767);
56005585 }
56015586
5602- /* Place Button */
5587+ // Place Button
56035588 if (textfield != NULL)
56045589 {
56055590 buttonItm.box.left = inputItm.box.left;
@@ -5615,47 +5600,47 @@
56155600 {
56165601
56175602 macMoveDialogItem(theDialog, button, buttonItm.box.left, buttonItm.box.top, &box);
5618- /* With vertical, it's better to have all buttons the same length */
5603+ // With vertical, it's better to have all buttons the same length
56195604 if (vertical)
56205605 {
56215606 macSizeDialogItem(theDialog, button, widestButton, 0);
56225607 GetDialogItem(theDialog, button, &itemType, &itemHandle, &box);
56235608 }
5624- /* Calculate position of next button */
5609+ // Calculate position of next button
56255610 if (vertical)
56265611 buttonItm.box.top = box.bottom + dfltElementSpacing;
56275612 else
56285613 buttonItm.box.left = box.right + dfltElementSpacing;
56295614 }
56305615
5631- /* Resize the dialog box */
5616+ // Resize the dialog box
56325617 dialogHeight = box.bottom + dfltElementSpacing;
56335618 SizeWindow(theWindow, maximumWidth, dialogHeight, TRUE);
56345619
5635- /* Magic resize */
5620+ // Magic resize
56365621 AutoSizeDialog(theDialog);
5637- /* Need a horizontal resize anyway so not that useful */
5638-
5639- /* Display it */
5622+ // Need a horizontal resize anyway so not that useful
5623+
5624+ // Display it
56405625 ShowWindow(theWindow);
5641-/* BringToFront(theWindow); */
5626+// BringToFront(theWindow);
56425627 SelectWindow(theWindow);
56435628
5644-/* DrawDialog(theDialog); */
5629+// DrawDialog(theDialog);
56455630 #if 0
56465631 GetPort(&oldPort);
56475632 SetPortDialogPort(theDialog);
56485633 #endif
56495634
56505635 #ifdef USE_CARBONKEYHANDLER
5651- /* Avoid that we use key events for the main window. */
5636+ // Avoid that we use key events for the main window.
56525637 dialog_busy = TRUE;
56535638 #endif
56545639
5655- /* Prepare the shortcut-handling filterProc for handing to the dialog */
5640+ // Prepare the shortcut-handling filterProc for handing to the dialog
56565641 dialogUPP = NewModalFilterUPP(DialogHotkeyFilterProc);
56575642
5658- /* Hang until one of the button is hit */
5643+ // Hang until one of the button is hit
56595644 do
56605645 ModalDialog(dialogUPP, &itemHit);
56615646 while ((itemHit < 1) || (itemHit > lastButton));
@@ -5664,26 +5649,26 @@
56645649 dialog_busy = FALSE;
56655650 #endif
56665651
5667- /* Copy back the text entered by the user into the param */
5652+ // Copy back the text entered by the user into the param
56685653 if (textfield != NULL)
56695654 {
56705655 GetDialogItem(theDialog, inputItm.idx, &itemType, &itemHandle, &box);
56715656 GetDialogItemText(itemHandle, (char_u *) &name);
56725657 #if IOSIZE < 256
5673- /* Truncate the name to IOSIZE if needed */
5658+ // Truncate the name to IOSIZE if needed
56745659 if (name[0] > IOSIZE)
56755660 name[0] = IOSIZE - 1;
56765661 #endif
56775662 vim_strncpy(textfield, &name[1], name[0]);
56785663 }
56795664
5680- /* Restore the original graphical port */
5665+ // Restore the original graphical port
56815666 SetPort(oldPort);
56825667
5683- /* Free the modal filterProc */
5668+ // Free the modal filterProc
56845669 DisposeRoutineDescriptor(dialogUPP);
56855670
5686- /* Get ride of the dialog (free memory) */
5671+ // Get ride of the dialog (free memory)
56875672 DisposeDialog(theDialog);
56885673
56895674 return itemHit;
@@ -5696,7 +5681,7 @@
56965681 * AutoSizeDialog(): Magic resize of dialog based on text length
56975682 */
56985683 }
5699-#endif /* FEAT_DIALOG_GUI */
5684+#endif // FEAT_DIALOG_GUI
57005685
57015686 /*
57025687 * Display the saved error message(s).
@@ -5711,7 +5696,7 @@
57115696 if (error_ga.ga_data == NULL)
57125697 return;
57135698
5714- /* avoid putting up a message box with blanks only */
5699+ // avoid putting up a message box with blanks only
57155700 for (p = (char *)error_ga.ga_data; *p; ++p)
57165701 if (!isspace(*p))
57175702 {
@@ -5724,10 +5709,9 @@
57245709 ParamText(pError, nil, nil, nil);
57255710 Alert(128, nil);
57265711 break;
5727- /* TODO: handled message longer than 256 chars
5728- * use auto-sizeable alert
5729- * or dialog with scrollbars (TextEdit zone)
5730- */
5712+ // TODO: handled message longer than 256 chars
5713+ // use auto-sizeable alert
5714+ // or dialog with scrollbars (TextEdit zone)
57315715 }
57325716 ga_clear(&error_ga);
57335717 }
@@ -5750,9 +5734,9 @@
57505734 void
57515735 gui_mch_setmouse(int x, int y)
57525736 {
5753- /* TODO */
5737+ // TODO
57545738 #if 0
5755- /* From FAQ 3-11 */
5739+ // From FAQ 3-11
57565740
57575741 CursorDevicePtr myMouse;
57585742 Point where;
@@ -5760,7 +5744,7 @@
57605744 if ( NGetTrapAddress(_CursorDeviceDispatch, ToolTrap)
57615745 != NGetTrapAddress(_Unimplemented, ToolTrap))
57625746 {
5763- /* New way */
5747+ // New way
57645748
57655749 /*
57665750 * Get first device with one button.
@@ -5773,7 +5757,7 @@
57735757
57745758 do
57755759 {
5776- /* Get the next cursor device */
5760+ // Get the next cursor device
57775761 CursorDeviceNextDevice(&myMouse);
57785762 }
57795763 while ((myMouse != nil) && (myMouse->cntButtons != 1));
@@ -5782,7 +5766,7 @@
57825766 }
57835767 else
57845768 {
5785- /* Old way */
5769+ // Old way
57865770 where.h = x;
57875771 where.v = y;
57885772
@@ -5811,16 +5795,16 @@
58115795 Str255 HelpName = "";
58125796 GrafPtr savePort;
58135797
5814- /* Save Current Port: On MacOS X we seem to lose the port */
5815- GetPort(&savePort); /*OSX*/
5798+ // Save Current Port: On MacOS X we seem to lose the port
5799+ GetPort(&savePort); //OSX
58165800
58175801 GetMouse(&where);
5818- LocalToGlobal(&where); /*OSX*/
5802+ LocalToGlobal(&where); //OSX
58195803 CntxMenu = menu->submenu_handle;
58205804
5821- /* TODO: Get the text selection from Vim */
5822-
5823- /* Call to Handle Popup */
5805+ // TODO: Get the text selection from Vim
5806+
5807+ // Call to Handle Popup
58245808 status = ContextualMenuSelect(CntxMenu, where, false, kCMHelpItemRemoveHelp,
58255809 HelpName, NULL, &CntxType, &CntxMenuID, &CntxMenuItem);
58265810
@@ -5828,24 +5812,24 @@
58285812 {
58295813 if (CntxType == kCMMenuItemSelected)
58305814 {
5831- /* Handle the menu CntxMenuID, CntxMenuItem */
5832- /* The submenu can be handle directly by gui_mac_handle_menu */
5833- /* But what about the current menu, is the menu changed by
5834- * ContextualMenuSelect */
5815+ // Handle the menu CntxMenuID, CntxMenuItem
5816+ // The submenu can be handle directly by gui_mac_handle_menu
5817+ // But what about the current menu, is the menu changed by
5818+ // ContextualMenuSelect
58355819 gui_mac_handle_menu((CntxMenuID << 16) + CntxMenuItem);
58365820 }
58375821 else if (CntxMenuID == kCMShowHelpSelected)
58385822 {
5839- /* Should come up with the help */
5823+ // Should come up with the help
58405824 }
58415825 }
58425826
5843- /* Restore original Port */
5844- SetPort(savePort); /*OSX*/
5827+ // Restore original Port
5828+ SetPort(savePort); //OSX
58455829 }
58465830
58475831 #if defined(FEAT_CW_EDITOR) || defined(PROTO)
5848-/* TODO: Is it need for MACOS_X? (Dany) */
5832+// TODO: Is it need for MACOS_X? (Dany)
58495833 void
58505834 mch_post_buffer_write(buf_T *buf)
58515835 {
@@ -5862,9 +5846,8 @@
58625846 void
58635847 gui_mch_settitle(char_u *title, char_u *icon)
58645848 {
5865- /* TODO: Get vim to make sure maxlen (from p_titlelen) is smaller
5866- * that 256. Even better get it to fit nicely in the titlebar.
5867- */
5849+ // TODO: Get vim to make sure maxlen (from p_titlelen) is smaller
5850+ // that 256. Even better get it to fit nicely in the titlebar.
58685851 #ifdef MACOS_CONVERT
58695852 CFStringRef windowTitle;
58705853 size_t windowTitleLen;
@@ -5872,7 +5855,7 @@
58725855 char_u *pascalTitle;
58735856 #endif
58745857
5875- if (title == NULL) /* nothing to do */
5858+ if (title == NULL) // nothing to do
58765859 return;
58775860
58785861 #ifdef MACOS_CONVERT
@@ -5925,7 +5908,7 @@
59255908 int
59265909 GetFSSpecFromPath(char_u *file, FSSpec *fileFSSpec)
59275910 {
5928- /* From FAQ 8-12 */
5911+ // From FAQ 8-12
59295912 Str255 filePascal;
59305913 CInfoPBRec myCPB;
59315914 OSErr err;
@@ -5939,10 +5922,10 @@
59395922
59405923 err= PBGetCatInfo(&myCPB, false);
59415924
5942- /* vRefNum, dirID, name */
5925+ // vRefNum, dirID, name
59435926 FSMakeFSSpec(0, 0, filePascal, fileFSSpec);
59445927
5945- /* TODO: Use an error code mechanism */
5928+ // TODO: Use an error code mechanism
59465929 return 0;
59475930 }
59485931
@@ -5976,36 +5959,36 @@
59765959 #endif
59775960
59785961 #ifdef USE_UNIXFILENAME
5979- /* Get the default volume */
5980- /* TODO: Remove as this only work if Vim is on the Boot Volume*/
5962+ // Get the default volume
5963+ // TODO: Remove as this only work if Vim is on the Boot Volume
59815964 error=HGetVol(NULL, &dfltVol_vRefNum, &dfltVol_dirID);
59825965
59835966 if (error)
59845967 return NULL;
59855968 #endif
59865969
5987- /* Start filling fname with file.name */
5970+ // Start filling fname with file.name
59885971 vim_strncpy(filenamePtr, &file.name[1], file.name[0]);
59895972
5990- /* Get the info about the file specified in FSSpec */
5973+ // Get the info about the file specified in FSSpec
59915974 theCPB.dirInfo.ioFDirIndex = 0;
59925975 theCPB.dirInfo.ioNamePtr = file.name;
59935976 theCPB.dirInfo.ioVRefNum = file.vRefNum;
5994- /*theCPB.hFileInfo.ioDirID = 0;*/
5977+ //theCPB.hFileInfo.ioDirID = 0;
59955978 theCPB.dirInfo.ioDrDirID = file.parID;
59965979
5997- /* As ioFDirIndex = 0, get the info of ioNamePtr,
5998- which is relative to ioVrefNum, ioDirID */
5980+ // As ioFDirIndex = 0, get the info of ioNamePtr,
5981+ // which is relative to ioVrefNum, ioDirID
59995982 error = PBGetCatInfo(&theCPB, false);
60005983
6001- /* If we are called for a new file we expect fnfErr */
5984+ // If we are called for a new file we expect fnfErr
60025985 if ((error) && (error != fnfErr))
60035986 return NULL;
60045987
6005- /* Check if it's a file or folder */
6006- /* default to file if file don't exist */
5988+ // Check if it's a file or folder
5989+ // default to file if file don't exist
60075990 if (((theCPB.hFileInfo.ioFlAttrib & ioDirMask) == 0) || (error))
6008- folder = 0; /* It's not a folder */
5991+ folder = 0; // It's not a folder
60095992 else
60105993 folder = 1;
60115994
@@ -6016,12 +5999,12 @@
60165999 */
60176000 if (error == fnfErr)
60186001 {
6019- /* If the file to be saved does not already exist, it isn't possible
6020- to convert its FSSpec into an FSRef. But we can construct an
6021- FSSpec for the file's parent folder (since we have its volume and
6022- directory IDs), and since that folder does exist, we can convert
6023- that FSSpec into an FSRef, convert the FSRef in turn into a path,
6024- and, finally, append the filename. */
6002+ // If the file to be saved does not already exist, it isn't possible
6003+ // to convert its FSSpec into an FSRef. But we can construct an
6004+ // FSSpec for the file's parent folder (since we have its volume and
6005+ // directory IDs), and since that folder does exist, we can convert
6006+ // that FSSpec into an FSRef, convert the FSRef in turn into a path,
6007+ // and, finally, append the filename.
60256008 FSSpec dirSpec;
60266009 FSRef dirRef;
60276010 Str255 emptyFilename = "\p";
@@ -6043,8 +6026,8 @@
60436026 }
60446027 else
60456028 {
6046- /* If the file to be saved already exists, we can get its full path
6047- by converting its FSSpec into an FSRef. */
6029+ // If the file to be saved already exists, we can get its full path
6030+ // by converting its FSSpec into an FSRef.
60486031 error=FSpMakeFSRef(&file, &refFile);
60496032 if (error)
60506033 return NULL;
@@ -6054,18 +6037,18 @@
60546037 return NULL;
60556038 }
60566039
6057- /* Add a slash at the end if needed */
6040+ // Add a slash at the end if needed
60586041 if (folder)
60596042 STRCAT(path, "/");
60606043
60616044 return (vim_strsave(path));
60626045 #else
6063- /* TODO: Get rid of all USE_UNIXFILENAME below */
6064- /* Set ioNamePtr, it's the same area which is always reused. */
6046+ // TODO: Get rid of all USE_UNIXFILENAME below
6047+ // Set ioNamePtr, it's the same area which is always reused.
60656048 theCPB.dirInfo.ioNamePtr = directoryName;
60666049
6067- /* Trick for first entry, set ioDrParID to the first value
6068- * we want for ioDrDirID*/
6050+ // Trick for first entry, set ioDrParID to the first value
6051+ // we want for ioDrDirID
60696052 theCPB.dirInfo.ioDrParID = file.parID;
60706053 theCPB.dirInfo.ioDrDirID = file.parID;
60716054
@@ -6073,53 +6056,53 @@
60736056 do
60746057 {
60756058 theCPB.dirInfo.ioFDirIndex = -1;
6076- /* theCPB.dirInfo.ioNamePtr = directoryName; Already done above. */
6059+ // theCPB.dirInfo.ioNamePtr = directoryName; Already done above.
60776060 theCPB.dirInfo.ioVRefNum = file.vRefNum;
6078- /* theCPB.dirInfo.ioDirID = irrelevant when ioFDirIndex = -1 */
6061+ // theCPB.dirInfo.ioDirID = irrelevant when ioFDirIndex = -1
60796062 theCPB.dirInfo.ioDrDirID = theCPB.dirInfo.ioDrParID;
60806063
6081- /* As ioFDirIndex = -1, get the info of ioDrDirID, */
6082- /* *ioNamePtr[0 TO 31] will be updated */
6064+ // As ioFDirIndex = -1, get the info of ioDrDirID,
6065+ // *ioNamePtr[0 TO 31] will be updated
60836066 error = PBGetCatInfo(&theCPB,false);
60846067
60856068 if (error)
60866069 return NULL;
60876070
6088- /* Put the new directoryName in front of the current fname */
6071+ // Put the new directoryName in front of the current fname
60896072 STRCPY(temporaryPtr, filenamePtr);
60906073 vim_strncpy(filenamePtr, &directoryName[1], directoryName[0]);
60916074 STRCAT(filenamePtr, ":");
60926075 STRCAT(filenamePtr, temporaryPtr);
60936076 }
6094-#if 1 /* def USE_UNIXFILENAME */
6095- while ((theCPB.dirInfo.ioDrParID != fsRtDirID) /* && */
6096- /* (theCPB.dirInfo.ioDrDirID != fsRtDirID)*/);
6077+#if 1 // def USE_UNIXFILENAME
6078+ while ((theCPB.dirInfo.ioDrParID != fsRtDirID)
6079+ /* && (theCPB.dirInfo.ioDrDirID != fsRtDirID)*/);
60976080 #else
60986081 while (theCPB.dirInfo.ioDrDirID != fsRtDirID);
60996082 #endif
61006083
6101- /* Get the information about the volume on which the file reside */
6084+ // Get the information about the volume on which the file reside
61026085 theCPB.dirInfo.ioFDirIndex = -1;
6103- /* theCPB.dirInfo.ioNamePtr = directoryName; Already done above. */
6086+ // theCPB.dirInfo.ioNamePtr = directoryName; Already done above.
61046087 theCPB.dirInfo.ioVRefNum = file.vRefNum;
6105- /* theCPB.dirInfo.ioDirID = irrelevant when ioFDirIndex = -1 */
6088+ // theCPB.dirInfo.ioDirID = irrelevant when ioFDirIndex = -1
61066089 theCPB.dirInfo.ioDrDirID = theCPB.dirInfo.ioDrParID;
61076090
6108- /* As ioFDirIndex = -1, get the info of ioDrDirID, */
6109- /* *ioNamePtr[0 TO 31] will be updated */
6091+ // As ioFDirIndex = -1, get the info of ioDrDirID,
6092+ // *ioNamePtr[0 TO 31] will be updated
61106093 error = PBGetCatInfo(&theCPB,false);
61116094
61126095 if (error)
61136096 return NULL;
61146097
6115- /* For MacOS Classic always add the volume name */
6116- /* For MacOS X add the volume name preceded by "Volumes" */
6117- /* when we are not referring to the boot volume */
6098+ // For MacOS Classic always add the volume name
6099+ // For MacOS X add the volume name preceded by "Volumes"
6100+ // when we are not referring to the boot volume
61186101 #ifdef USE_UNIXFILENAME
61196102 if (file.vRefNum != dfltVol_vRefNum)
61206103 #endif
61216104 {
6122- /* Add the volume name */
6105+ // Add the volume name
61236106 STRCPY(temporaryPtr, filenamePtr);
61246107 vim_strncpy(filenamePtr, &directoryName[1], directoryName[0]);
61256108 STRCAT(filenamePtr, ":");
@@ -6127,20 +6110,20 @@
61276110
61286111 #ifdef USE_UNIXFILENAME
61296112 STRCPY(temporaryPtr, filenamePtr);
6130- filenamePtr[0] = 0; /* NULL terminate the string */
6113+ filenamePtr[0] = 0; // NULL terminate the string
61316114 STRCAT(filenamePtr, "Volumes:");
61326115 STRCAT(filenamePtr, temporaryPtr);
61336116 #endif
61346117 }
61356118
6136- /* Append final path separator if it's a folder */
6119+ // Append final path separator if it's a folder
61376120 if (folder)
61386121 STRCAT(fname, ":");
61396122
6140- /* As we use Unix File Name for MacOS X convert it */
6123+ // As we use Unix File Name for MacOS X convert it
61416124 #ifdef USE_UNIXFILENAME
6142- /* Need to insert leading / */
6143- /* TODO: get the above code to use directly the / */
6125+ // Need to insert leading /
6126+ // TODO: get the above code to use directly the /
61446127 STRCPY(&temporaryPtr[1], filenamePtr);
61456128 temporaryPtr[0] = '/';
61466129 STRCPY(filenamePtr, temporaryPtr);
@@ -6168,7 +6151,7 @@
61686151 im_set_position(int row, int col)
61696152 {
61706153 # if 0
6171- /* TODO: Implement me! */
6154+ // TODO: Implement me!
61726155 im_start_row = row;
61736156 im_start_col = col;
61746157 # endif
@@ -6197,7 +6180,7 @@
61976180 {
61986181 im_initialized = 1;
61996182
6200- /* save default TSM component (should be U.S.) to default */
6183+ // save default TSM component (should be U.S.) to default
62016184 GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
62026185 kKeyboardInputMethodClass);
62036186 }
@@ -6250,7 +6233,7 @@
62506233 {
62516234 im_initialized = 1;
62526235
6253- /* save default TSM component (should be U.S.) to default */
6236+ // save default TSM component (should be U.S.) to default
62546237 GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
62556238 kKeyboardInputMethodClass);
62566239 }
@@ -6282,8 +6265,8 @@
62826265 GetDefaultInputMethodOfClass(&gTSCInsert, slptr,
62836266 kKeyboardInputMethodClass);
62846267
6285- /* restore to default when switch to normal mode, so than we could
6286- * enter commands easier */
6268+ // restore to default when switch to normal mode, so than we could
6269+ // enter commands easier
62876270 SetDefaultInputMethodOfClass(gTSCDefault, &gTSLDefault,
62886271 kKeyboardInputMethodClass);
62896272 SetTextServiceLanguage(&gTSLDefault);
diff -r 06ed2fe62dce -r e1f4e9d78a6a src/gui_motif.c
--- a/src/gui_motif.c Mon Dec 02 21:45:05 2019 +0100
+++ b/src/gui_motif.c Mon Dec 02 23:00:04 2019 +0100
@@ -49,7 +49,7 @@
4949 # include <Xm/Notebook.h>
5050 #endif
5151
52-#include "gui_xmebw.h" /* for our Enhanced Button Widget */
52+#include "gui_xmebw.h" // for our Enhanced Button Widget
5353
5454 #if defined(FEAT_GUI_DIALOG) && defined(HAVE_XPM)
5555 # include "../pixmaps/alert.xpm"
@@ -80,7 +80,7 @@
8080 #endif
8181 #ifdef FEAT_MENU
8282 # if (XmVersion >= 1002)
83-/* remember the last set value for the tearoff item */
83+// remember the last set value for the tearoff item
8484 static int tearoff_val = (int)XmTEAR_OFF_ENABLED;
8585 # endif
8686 static Widget menuBar;
@@ -178,10 +178,10 @@
178178 XtVaGetValues(tab_scroll_w, XmNx, &pos_x, XmNy, &pos_y, XmNwidth,
179179 &width, XmNheight, &height, NULL);
180180 if (pos_x >= 0) {
181- /* Tab scroller (next) is visible */
181+ // Tab scroller (next) is visible
182182 if ((event->x >= pos_x) && (event->x <= pos_x + width) &&
183183 (event->y >= pos_y) && (event->y <= pos_y + height)) {
184- /* Clicked on the scroller */
184+ // Clicked on the scroller
185185 return TRUE;
186186 }
187187 }
@@ -238,7 +238,7 @@
238238 if (event->button != Button3)
239239 return;
240240
241- /* When ignoring events don't show the menu. */
241+ // When ignoring events don't show the menu.
242242 if (hold_gui_events
243243 # ifdef FEAT_CMDWIN
244244 || cmdwin_type != 0
@@ -249,7 +249,7 @@
249249 if (event->subwindow != None)
250250 {
251251 tab_w = XtWindowToWidget(XtDisplay(w), event->subwindow);
252- /* LINTED: avoid warning: dubious operation on enum */
252+ // LINTED: avoid warning: dubious operation on enum
253253 if (tab_w != (Widget)0 && XmIsPushButton(tab_w))
254254 XtVaGetValues(tab_w, XmNpageNumber, &tab_idx, NULL);
255255 }
@@ -316,7 +316,7 @@
316316
317317 _XmFontListGetDefaultFont(lw->label.font, &fs);
318318
319- /* FIXME: we should be doing the whole drawing ourself here. */
319+ // FIXME: we should be doing the whole drawing ourself here.
320320 insensitiveGC = lw->label.insensitive_GC;
321321
322322 mask = GCForeground | GCBackground | GCGraphicsExposures;
@@ -407,7 +407,7 @@
407407 XmRepTypeInstallTearOffModelConverter();
408408 #endif
409409
410- /* Make sure the "Quit" menu entry of the window manager is ignored */
410+ // Make sure the "Quit" menu entry of the window manager is ignored
411411 XtVaSetValues(vimShell, XmNdeleteResponse, XmDO_NOTHING, NULL);
412412
413413 vimForm = XtVaCreateManagedWidget("vimForm",
@@ -423,7 +423,7 @@
423423
424424 #ifdef FEAT_MENU
425425 {
426- Arg al[7]; /* Make sure there is enough room for arguments! */
426+ Arg al[7]; // Make sure there is enough room for arguments!
427427 int ac = 0;
428428
429429 # if (XmVersion >= 1002)
@@ -433,14 +433,14 @@
433433 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
434434 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
435435 # ifndef FEAT_TOOLBAR
436- /* Always stick to right hand side. */
436+ // Always stick to right hand side.
437437 XtSetArg(al[ac], XmNrightOffset, 0); ac++;
438438 # endif
439439 XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
440440 menuBar = XmCreateMenuBar(vimForm, "menuBar", al, ac);
441441 XtManageChild(menuBar);
442442
443- /* Remember the default colors, needed for ":hi clear". */
443+ // Remember the default colors, needed for ":hi clear".
444444 XtVaGetValues(menuBar,
445445 XmNbackground, &gui.menu_def_bg_pixel,
446446 XmNforeground, &gui.menu_def_fg_pixel,
@@ -483,7 +483,7 @@
483483 #endif
484484
485485 #ifdef FEAT_GUI_TABLINE
486- /* Create the Vim GUI tabline */
486+ // Create the Vim GUI tabline
487487 n = 0;
488488 XtSetArg(args[n], XmNbindingType, XmNONE); n++;
489489 XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
@@ -603,7 +603,7 @@
603603 */
604604 gui_x11_callbacks(textArea, vimForm);
605605
606- /* Pretend we don't have input focus, we will get an event if we do. */
606+ // Pretend we don't have input focus, we will get an event if we do.
607607 gui.in_focus = FALSE;
608608 }
609609
@@ -627,7 +627,7 @@
627627 int h UNUSED)
628628 {
629629 #ifdef FEAT_TOOLBAR
630- /* Give keyboard focus to the textArea instead of the toolbar. */
630+ // Give keyboard focus to the textArea instead of the toolbar.
631631 reset_focus();
632632 #endif
633633 }
@@ -659,19 +659,19 @@
659659 int x, y, win_x, win_y, maxX, maxY;
660660 Boolean mappedWhenManaged;
661661
662- /* Temporarily set value of XmNmappedWhenManaged
663- to stop the dialog from popping up right away */
662+ // Temporarily set value of XmNmappedWhenManaged
663+ // to stop the dialog from popping up right away
664664 XtVaGetValues(shell, XmNmappedWhenManaged, &mappedWhenManaged, NULL);
665665 XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL);
666666
667667 XtManageChild(dialog_child);
668668
669- /* Get the pointer position (x, y) */
669+ // Get the pointer position (x, y)
670670 XQueryPointer(XtDisplay(shell), XtWindow(shell), &root, &child,
671671 &x, &y, &win_x, &win_y, &mask);
672672
673- /* Translate the pointer position (x, y) into a position for the new
674- window that will place the pointer at its center */
673+ // Translate the pointer position (x, y) into a position for the new
674+ // window that will place the pointer at its center
675675 XGetGeometry(XtDisplay(shell), XtWindow(shell), &root, &win_x, &win_y,
676676 &width, &height, &border_width, &depth);
677677 width += 2 * border_width;
@@ -679,7 +679,7 @@
679679 x -= width / 2;
680680 y -= height / 2;
681681
682- /* Ensure that the dialog remains on screen */
682+ // Ensure that the dialog remains on screen
683683 maxX = XtScreen(shell)->width - width;
684684 maxY = XtScreen(shell)->height - height;
685685 if (x < 0)
@@ -691,13 +691,13 @@
691691 if (y > maxY)
692692 y = maxY;
693693
694- /* Set desired window position in the DialogShell */
694+ // Set desired window position in the DialogShell
695695 XtVaSetValues(shell, XmNx, x, XmNy, y, NULL);
696696
697- /* Map the widget */
697+ // Map the widget
698698 XtMapWidget(shell);
699699
700- /* Restore the value of XmNmappedWhenManaged */
700+ // Restore the value of XmNmappedWhenManaged
701701 XtVaSetValues(shell, XmNmappedWhenManaged, mappedWhenManaged, NULL);
702702 }
703703
@@ -712,10 +712,10 @@
712712 XmFontList font_list;
713713
714714 # if (XmVersion <= 1001)
715- /* Motif 1.1 method */
715+ // Motif 1.1 method
716716 font_list = XmFontListCreate(font, STRING_TAG);
717717 # else
718- /* Motif 1.2 method */
718+ // Motif 1.2 method
719719 XmFontListEntry font_list_entry;
720720
721721 font_list_entry = XmFontListEntryCreate(STRING_TAG, XmFONT_IS_FONT,
@@ -732,7 +732,7 @@
732732 {
733733 XmFontList font_list;
734734
735- /* Motif 1.2 method */
735+ // Motif 1.2 method
736736 XmFontListEntry font_list_entry;
737737
738738 font_list_entry = XmFontListEntryCreate(STRING_TAG,
@@ -770,7 +770,7 @@
770770 #ifdef FEAT_TOOLBAR
771771 if (XtIsManaged(XtParent(toolBar)))
772772 {
773- /* toolBar is attached to top form */
773+ // toolBar is attached to top form
774774 XtVaSetValues(XtParent(toolBar),
775775 XmNtopAttachment, XmATTACH_WIDGET,
776776 XmNtopWidget, menuBar,
@@ -909,8 +909,8 @@
909909 Arg arg[2];
910910 int n = 0;
911911
912- /* Only create the popup menu when it's actually used, otherwise there
913- * is a delay when using the right mouse button. */
912+ // Only create the popup menu when it's actually used, otherwise there
913+ // is a delay when using the right mouse button.
914914 # if (XmVersion <= 1002)
915915 if (mouse_model_popup())
916916 # endif
@@ -940,7 +940,7 @@
940940 XmNlabelString, label,
941941 XmNmnemonic, p_wak[0] == 'n' ? NUL : menu->mnemonic,
942942 #if (XmVersion >= 1002)
943- /* submenu: count the tearoff item (needed for LessTif) */
943+ // submenu: count the tearoff item (needed for LessTif)
944944 XmNpositionIndex, idx + (parent != NULL
945945 && tearoff_val == (int)XmTEAR_OFF_ENABLED ? 1 : 0),
946946 #endif
@@ -949,10 +949,10 @@
949949 gui_motif_menu_fontlist(menu->id);
950950 XmStringFree(label);
951951
952- if (menu->id == (Widget)0) /* failed */
952+ if (menu->id == (Widget)0) // failed
953953 return;
954954
955- /* add accelerator text */
955+ // add accelerator text
956956 gui_motif_add_actext(menu);
957957
958958 shell = XtVaCreateWidget("subMenuShell",
@@ -967,11 +967,11 @@
967967 NULL);
968968 gui_motif_menu_colors(menu->submenu_id);
969969
970- if (menu->submenu_id == (Widget)0) /* failed */
970+ if (menu->submenu_id == (Widget)0) // failed
971971 return;
972972
973973 #if (XmVersion >= 1002)
974- /* Set the colors for the tear off widget */
974+ // Set the colors for the tear off widget
975975 toggle_tearoff(menu->submenu_id);
976976 #endif
977977
@@ -1005,7 +1005,7 @@
10051005 {
10061006 XmString label;
10071007
1008- /* Add accelerator text, if there is one */
1008+ // Add accelerator text, if there is one
10091009 if (menu->actext != NULL && menu->id != (Widget)0)
10101010 {
10111011 label = XmStringCreate((char *)menu->actext, STRING_TAG);
@@ -1077,12 +1077,12 @@
10771077 */
10781078 void
10791079 gui_mch_compute_menu_height(
1080- Widget id) /* can be NULL when deleting menu */
1080+ Widget id) // can be NULL when deleting menu
10811081 {
10821082 Dimension y, maxy;
10831083 Dimension margin, shadow;
10841084 vimmenu_T *mp;
1085- static Dimension height = 21; /* normal height of a menu item */
1085+ static Dimension height = 21; // normal height of a menu item
10861086
10871087 /*
10881088 * Get the height of the new item, before managing it, because it will
@@ -1092,7 +1092,7 @@
10921092 if (id != (Widget)0)
10931093 XtVaGetValues(id, XmNheight, &height, NULL);
10941094
1095- /* Find any menu Widget, to be able to call XtManageChild() */
1095+ // Find any menu Widget, to be able to call XtManageChild()
10961096 else
10971097 for (mp = root_menu; mp != NULL; mp = mp->next)
10981098 if (mp->id != (Widget)0 && menu_is_menubar(mp->name))
@@ -1139,9 +1139,9 @@
11391139 */
11401140 gui.menu_height = maxy + height - 2 * shadow + 2 * margin + 4;
11411141
1142- /* Somehow the menu bar doesn't resize automatically. Set it here,
1143- * even though this is a catch 22. Don't do this when starting up,
1144- * somehow the menu gets very high then. */
1142+ // Somehow the menu bar doesn't resize automatically. Set it here,
1143+ // even though this is a catch 22. Don't do this when starting up,
1144+ // somehow the menu gets very high then.
11451145 if (gui.shell_created)
11461146 XtVaSetValues(menuBar, XmNheight, gui.menu_height, NULL);
11471147 }
@@ -1168,7 +1168,7 @@
11681168
11691169 attrs.valuemask = 0;
11701170
1171- /* Create the "sensitive" pixmap */
1171+ // Create the "sensitive" pixmap
11721172 status = XpmReadFileToPixmap(gui.dpy,
11731173 RootWindow(gui.dpy, DefaultScreen(gui.dpy)),
11741174 (char *)path, &map, &mask, &attrs);
@@ -1189,20 +1189,20 @@
11891189 static char **
11901190 get_toolbar_pixmap(vimmenu_T *menu, char **fname)
11911191 {
1192- char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
1193- char **xpm = NULL; /* xpm array */
1192+ char_u buf[MAXPATHL]; // buffer storing expanded pathname
1193+ char **xpm = NULL; // xpm array
11941194 int res;
11951195
11961196 *fname = NULL;
1197- buf[0] = NUL; /* start with NULL path */
1197+ buf[0] = NUL; // start with NULL path
11981198
11991199 if (menu->iconfile != NULL)
12001200 {
1201- /* Use the "icon=" argument. */
1201+ // Use the "icon=" argument.
12021202 gui_find_iconfile(menu->iconfile, buf, "xpm");
12031203 res = check_xpm(buf);
12041204
1205- /* If it failed, try using the menu name. */
1205+ // If it failed, try using the menu name.
12061206 if (res == FAIL && gui_find_bitmap(menu->name, buf, "xpm") == OK)
12071207 res = check_xpm(buf);
12081208 if (res == OK)
@@ -1245,7 +1245,7 @@
12451245 }
12461246 return n;
12471247 }
1248-#endif /* FEAT_TOOLBAR */
1248+#endif // FEAT_TOOLBAR
12491249
12501250 void
12511251 gui_mch_add_menu_item(vimmenu_T *menu, int idx)
@@ -1258,7 +1258,7 @@
12581258 # endif
12591259
12601260 # if (XmVersion <= 1002)
1261- /* Don't add Popup menu items when the popup menu isn't used. */
1261+ // Don't add Popup menu items when the popup menu isn't used.
12621262 if (menu_is_child_of_popup(menu) && !mouse_model_popup())
12631263 return;
12641264 # endif
@@ -1267,7 +1267,7 @@
12671267 if (menu_is_toolbar(parent->name))
12681268 {
12691269 WidgetClass type;
1270- XmString xms = NULL; /* fallback label if pixmap not found */
1270+ XmString xms = NULL; // fallback label if pixmap not found
12711271 int n;
12721272 Arg args[18];
12731273
@@ -1295,17 +1295,16 @@
12951295 }
12961296 else
12971297 {
1298- /* Without shadows one can't sense whatever the button has been
1299- * pressed or not! However we want to save a bit of space...
1300- * Need the highlightThickness to see the focus.
1301- */
1298+ // Without shadows one can't sense whatever the button has been
1299+ // pressed or not! However we want to save a bit of space...
1300+ // Need the highlightThickness to see the focus.
13021301 XtSetArg(args[n], XmNhighlightThickness, 1); n++;
13031302 XtSetArg(args[n], XmNhighlightOnEnter, True); n++;
13041303 XtSetArg(args[n], XmNmarginWidth, 0); n++;
13051304 XtSetArg(args[n], XmNmarginHeight, 0); n++;
13061305 XtSetArg(args[n], XmNtraversalOn, False); n++;
1307- /* Set the label here, so that we can switch between icons/text
1308- * by changing the XmNlabelType resource. */
1306+ // Set the label here, so that we can switch between icons/text
1307+ // by changing the XmNlabelType resource.
13091308 xms = XmStringCreate((char *)menu->dname, STRING_TAG);
13101309 XtSetArg(args[n], XmNlabelString, xms); n++;
13111310
@@ -1342,28 +1341,28 @@
13421341
13431342 menu->parent = parent;
13441343 menu->submenu_id = NULL;
1345- /* When adding first item to toolbar it might have to be enabled .*/
1344+ // When adding first item to toolbar it might have to be enabled .
13461345 if (!XtIsManaged(XtParent(toolBar))
13471346 && vim_strchr(p_go, GO_TOOLBAR) != NULL)
13481347 gui_mch_show_toolbar(TRUE);
13491348 gui.toolbar_height = gui_mch_compute_toolbar_height();
13501349 return;
1351- } /* toolbar menu item */
1350+ } // toolbar menu item
13521351 # endif
13531352
1354- /* No parent, must be a non-menubar menu */
1353+ // No parent, must be a non-menubar menu
13551354 if (parent->submenu_id == (Widget)0)
13561355 return;
13571356
13581357 menu->submenu_id = (Widget)0;
13591358
1360- /* Add menu separator */
1359+ // Add menu separator
13611360 if (menu_is_separator(menu->name))
13621361 {
13631362 menu->id = XtVaCreateWidget("subMenu",
13641363 xmSeparatorGadgetClass, parent->submenu_id,
13651364 #if (XmVersion >= 1002)
1366- /* count the tearoff item (needed for LessTif) */
1365+ // count the tearoff item (needed for LessTif)
13671366 XmNpositionIndex, idx + (tearoff_val == (int)XmTEAR_OFF_ENABLED
13681367 ? 1 : 0),
13691368 #endif
@@ -1380,7 +1379,7 @@
13801379 XmNlabelString, label,
13811380 XmNmnemonic, menu->mnemonic,
13821381 #if (XmVersion >= 1002)
1383- /* count the tearoff item (needed for LessTif) */
1382+ // count the tearoff item (needed for LessTif)
13841383 XmNpositionIndex, idx + (tearoff_val == (int)XmTEAR_OFF_ENABLED
13851384 ? 1 : 0),
13861385 #endif
@@ -1393,7 +1392,7 @@
13931392 {
13941393 XtAddCallback(menu->id, XmNactivateCallback, gui_x11_menu_cb,
13951394 (XtPointer)menu);
1396- /* add accelerator text */
1395+ // add accelerator text
13971396 gui_motif_add_actext(menu);
13981397 }
13991398 }
@@ -1410,7 +1409,7 @@
14101409 {
14111410 int idx = 0;
14121411
1413- /* When GUI hasn't started the menus have not been created. */
1412+ // When GUI hasn't started the menus have not been created.
14141413 if (!gui.in_use)
14151414 return;
14161415
@@ -1422,13 +1421,13 @@
14221421 {
14231422 if (mouse_model_popup())
14241423 {
1425- /* Popup menu will be used. Create the popup menus. */
1424+ // Popup menu will be used. Create the popup menus.
14261425 gui_mch_add_menu(menu, idx);
14271426 gui_motif_update_mousemodel(menu->children);
14281427 }
14291428 else
14301429 {
1431- /* Popup menu will not be used. Destroy the popup menus. */
1430+ // Popup menu will not be used. Destroy the popup menus.
14321431 gui_motif_update_mousemodel(menu->children);
14331432 gui_mch_destroy_menu(menu);
14341433 }
@@ -1520,7 +1519,7 @@
15201519 static void
15211520 submenu_change(
15221521 vimmenu_T *menu,
1523- int colors) /* TRUE for colors, FALSE for font */
1522+ int colors) // TRUE for colors, FALSE for font
15241523 {
15251524 vimmenu_T *mp;
15261525
@@ -1532,8 +1531,8 @@
15321531 {
15331532 gui_motif_menu_colors(mp->id);
15341533 #ifdef FEAT_TOOLBAR
1535- /* For a toolbar item: Free the pixmap and allocate a new one,
1536- * so that the background color is right. */
1534+ // For a toolbar item: Free the pixmap and allocate a new one,
1535+ // so that the background color is right.
15371536 if (mp->xpm != NULL)
15381537 {
15391538 int n = 0;
@@ -1543,7 +1542,7 @@
15431542 XtSetValues(mp->id, args, n);
15441543 }
15451544 # ifdef FEAT_BEVAL_GUI
1546- /* If we have a tooltip, then we need to change its font */
1545+ // If we have a tooltip, then we need to change its font
15471546 if (mp->tip != NULL)
15481547 {
15491548 Arg args[2];
@@ -1561,7 +1560,7 @@
15611560 {
15621561 gui_motif_menu_fontlist(mp->id);
15631562 #ifdef FEAT_BEVAL_GUI
1564- /* If we have a tooltip, then we need to change its font */
1563+ // If we have a tooltip, then we need to change its font
15651564 if (mp->tip != NULL)
15661565 {
15671566 Arg args[1];
@@ -1578,7 +1577,7 @@
15781577 if (mp->children != NULL)
15791578 {
15801579 #if (XmVersion >= 1002)
1581- /* Set the colors/font for the tear off widget */
1580+ // Set the colors/font for the tear off widget
15821581 if (mp->submenu_id != (Widget)0)
15831582 {
15841583 if (colors)
@@ -1588,7 +1587,7 @@
15881587 toggle_tearoff(mp->submenu_id);
15891588 }
15901589 #endif
1591- /* Set the colors for the children */
1590+ // Set the colors for the children
15921591 submenu_change(mp->children, colors);
15931592 }
15941593 }
@@ -1600,13 +1599,12 @@
16001599 void
16011600 gui_mch_destroy_menu(vimmenu_T *menu)
16021601 {
1603- /* Please be sure to destroy the parent widget first (i.e. menu->id).
1604- * On the other hand, problems have been reported that the submenu must be
1605- * deleted first...
1606- *
1607- * This code should be basically identical to that in the file gui_athena.c
1608- * because they are both Xt based.
1609- */
1602+ // Please be sure to destroy the parent widget first (i.e. menu->id).
1603+ // On the other hand, problems have been reported that the submenu must be
1604+ // deleted first...
1605+ //
1606+ // This code should be basically identical to that in the file gui_athena.c
1607+ // because they are both Xt based.
16101608 if (menu->submenu_id != (Widget)0)
16111609 {
16121610 XtDestroyWidget(menu->submenu_id);
@@ -1621,15 +1619,14 @@
16211619 #if defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL_GUI)
16221620 if (parent == toolBar && menu->tip != NULL)
16231621 {
1624- /* We try to destroy this before the actual menu, because there are
1625- * callbacks, etc. that will be unregistered during the tooltip
1626- * destruction.
1627- *
1628- * If you call "gui_mch_destroy_beval_area()" after destroying
1629- * menu->id, then the tooltip's window will have already been
1630- * deallocated by Xt, and unknown behaviour will ensue (probably
1631- * a core dump).
1632- */
1622+ // We try to destroy this before the actual menu, because there are
1623+ // callbacks, etc. that will be unregistered during the tooltip
1624+ // destruction.
1625+ //
1626+ // If you call "gui_mch_destroy_beval_area()" after destroying
1627+ // menu->id, then the tooltip's window will have already been
1628+ // deallocated by Xt, and unknown behaviour will ensue (probably
1629+ // a core dump).
16331630 gui_mch_destroy_beval_area(menu->tip);
16341631 menu->tip = NULL;
16351632 }
@@ -1643,7 +1640,7 @@
16431640 {
16441641 Cardinal num_children;
16451642
1646- /* When removing last toolbar item, don't display the toolbar. */
1643+ // When removing last toolbar item, don't display the toolbar.
16471644 XtVaGetValues(toolBar, XmNnumChildren, &num_children, NULL);
16481645 if (num_children == 0)
16491646 gui_mch_show_toolbar(FALSE);
@@ -1663,7 +1660,7 @@
16631660 #endif
16641661 }
16651662
1666-#endif /* FEAT_MENU */
1663+#endif // FEAT_MENU
16671664
16681665 /*
16691666 * Set the menu and scrollbar colors to their default values.
@@ -1673,8 +1670,8 @@
16731670 {
16741671 if (gui.in_use)
16751672 {
1676- /* Use the values saved when starting up. These should come from the
1677- * window manager or a resources file. */
1673+ // Use the values saved when starting up. These should come from the
1674+ // window manager or a resources file.
16781675 gui.menu_fg_pixel = gui.menu_def_fg_pixel;
16791676 gui.menu_bg_pixel = gui.menu_def_bg_pixel;
16801677 gui.scroll_fg_pixel = gui.scroll_def_fg_pixel;
@@ -1705,7 +1702,7 @@
17051702 XmNvalue, val,
17061703 XmNsliderSize, size,
17071704 XmNpageIncrement, (size > 2 ? size - 2 : 1),
1708- XmNmaximum, max + 1, /* Motif has max one past the end */
1705+ XmNmaximum, max + 1, // Motif has max one past the end
17091706 NULL);
17101707 }
17111708
@@ -1775,8 +1772,8 @@
17751772 {
17761773 if (!gui.which_scrollbars[sb->type])
17771774 {
1778- /* The scrollbars of this type are all disabled, adjust the
1779- * textArea attachment offset. */
1775+ // The scrollbars of this type are all disabled, adjust the
1776+ // textArea attachment offset.
17801777 switch (sb->type)
17811778 {
17821779 case SBAR_LEFT:
@@ -1801,7 +1798,7 @@
18011798 void
18021799 gui_mch_create_scrollbar(
18031800 scrollbar_T *sb,
1804- int orient) /* SBAR_VERT or SBAR_HORIZ */
1801+ int orient) // SBAR_VERT or SBAR_HORIZ
18051802 {
18061803 Arg args[16];
18071804 int n;
@@ -1835,7 +1832,7 @@
18351832 sb->id = XtCreateWidget("scrollBar",
18361833 xmScrollBarWidgetClass, textAreaForm, args, n);
18371834
1838- /* Remember the default colors, needed for ":hi clear". */
1835+ // Remember the default colors, needed for ":hi clear".
18391836 if (gui.scroll_def_bg_pixel == (guicolor_T)0
18401837 && gui.scroll_def_fg_pixel == (guicolor_T)0)
18411838 XtVaGetValues(sb->id,
@@ -1887,7 +1884,7 @@
18871884 NULL);
18881885 }
18891886
1890- /* This is needed for the rectangle below the vertical scrollbars. */
1887+ // This is needed for the rectangle below the vertical scrollbars.
18911888 if (sb == &gui.bottom_sbar && textAreaForm != (Widget)0)
18921889 gui_motif_scroll_colors(textAreaForm);
18931890 }
@@ -2082,8 +2079,8 @@
20822079 {
20832080 XtUnmanageChild(id);
20842081 XtVaSetValues(id, XmNfontList, fl, NULL);
2085- /* We should force the widget to recalculate its
2086- * geometry now. */
2082+ // We should force the widget to recalculate its
2083+ // geometry now.
20872084 XtManageChild(id);
20882085 }
20892086 else
@@ -2101,8 +2098,8 @@
21012098 {
21022099 XtUnmanageChild(id);
21032100 XtVaSetValues(id, XmNfontList, fl, NULL);
2104- /* We should force the widget to recalculate its
2105- * geometry now. */
2101+ // We should force the widget to recalculate its
2102+ // geometry now.
21062103 XtManageChild(id);
21072104 }
21082105 else
@@ -2125,14 +2122,14 @@
21252122
21262123 typedef struct dialog_callback_arg
21272124 {
2128- char * args; /* not used right now */
2125+ char * args; // not used right now
21292126 int id;
21302127 } dcbarg_T;
21312128
21322129 static Widget dialog_wgt;
21332130 static char *browse_fname = NULL;
21342131 static XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
2135- /* used to set up XmStrings */
2132+ // used to set up XmStrings
21362133
21372134 static void DialogCancelCB(Widget, XtPointer, XtPointer);
21382135 static void DialogAcceptCB(Widget, XtPointer, XtPointer);
@@ -2208,22 +2205,21 @@
22082205 */
22092206 char_u *
22102207 gui_mch_browse(
2211- int saving UNUSED, /* select file to write */
2212- char_u *title, /* title for the window */
2213- char_u *dflt, /* default name */
2214- char_u *ext UNUSED, /* not used (extension added) */
2215- char_u *initdir, /* initial directory, NULL for current dir */
2216- char_u *filter) /* file name filter */
2208+ int saving UNUSED, // select file to write
2209+ char_u *title, // title for the window
2210+ char_u *dflt, // default name
2211+ char_u *ext UNUSED, // not used (extension added)
2212+ char_u *initdir, // initial directory, NULL for current dir
2213+ char_u *filter) // file name filter
22172214 {
22182215 char_u dirbuf[MAXPATHL];
22192216 char_u dfltbuf[MAXPATHL];
22202217 char_u *pattern;
22212218 char_u *tofree = NULL;
22222219
2223- /* There a difference between the resource name and value, Therefore, we
2224- * avoid to (ab-)use the (maybe internationalized!) dialog title as a
2225- * dialog name.
2226- */
2220+ // There a difference between the resource name and value, Therefore, we
2221+ // avoid to (ab-)use the (maybe internationalized!) dialog title as a
2222+ // dialog name.
22272223
22282224 dialog_wgt = XmCreateFileSelectionDialog(vimShell, "browseDialog", NULL, 0);
22292225
@@ -2237,16 +2233,16 @@
22372233 dflt = (char_u *)"";
22382234 else if (STRLEN(initdir) + STRLEN(dflt) + 2 < MAXPATHL)
22392235 {
2240- /* The default selection should be the full path, "dflt" is only the
2241- * file name. */
2236+ // The default selection should be the full path, "dflt" is only the
2237+ // file name.
22422238 STRCPY(dfltbuf, initdir);
22432239 add_pathsep(dfltbuf);
22442240 STRCAT(dfltbuf, dflt);
22452241 dflt = dfltbuf;
22462242 }
22472243
2248- /* Can only use one pattern for a file name. Get the first pattern out of
2249- * the filter. An empty pattern means everything matches. */
2244+ // Can only use one pattern for a file name. Get the first pattern out of
2245+ // the filter. An empty pattern means everything matches.
22502246 if (filter == NULL)
22512247 pattern = (char_u *)"";
22522248 else
@@ -2256,9 +2252,9 @@
22562252 s = filter;
22572253 for (p = filter; *p != NUL; ++p)
22582254 {
2259- if (*p == '\t') /* end of description, start of pattern */
2255+ if (*p == '\t') // end of description, start of pattern
22602256 s = p + 1;
2261- if (*p == ';' || *p == '\n') /* end of (first) pattern */
2257+ if (*p == ';' || *p == '\n') // end of (first) pattern
22622258 break;
22632259 }
22642260 pattern = vim_strnsave(s, p - s);
@@ -2287,9 +2283,8 @@
22872283 set_predefined_label(dialog_wgt, "OK", _("&OK"));
22882284 set_predefined_label(dialog_wgt, "Selection", _("Selection"));
22892285
2290- /* This is to save us from silly external settings using not fixed with
2291- * fonts for file selection.
2292- */
2286+ // This is to save us from silly external settings using not fixed with
2287+ // fonts for file selection.
22932288 set_predefined_fontlist(dialog_wgt, "DirListSW.DirList");
22942289 set_predefined_fontlist(dialog_wgt, "ItemsListSW.ItemsList");
22952290
@@ -2299,14 +2294,14 @@
22992294
23002295 XtAddCallback(dialog_wgt, XmNokCallback, DialogAcceptCB, (XtPointer)0);
23012296 XtAddCallback(dialog_wgt, XmNcancelCallback, DialogCancelCB, (XtPointer)0);
2302- /* We have no help in this window, so hide help button */
2297+ // We have no help in this window, so hide help button
23032298 XtUnmanageChild(XmFileSelectionBoxGetChild(dialog_wgt,
23042299 (unsigned char)XmDIALOG_HELP_BUTTON));
23052300
23062301 manage_centered(dialog_wgt);
23072302 activate_dialog_mnemonics(dialog_wgt);
23082303
2309- /* sit in a loop until the dialog box has gone away */
2304+ // sit in a loop until the dialog box has gone away
23102305 do
23112306 {
23122307 XtAppProcessEvent(XtWidgetToApplicationContext(dialog_wgt),
@@ -2333,9 +2328,9 @@
23332328 */
23342329 static void
23352330 DialogCancelCB(
2336- Widget w UNUSED, /* widget id */
2337- XtPointer client_data UNUSED, /* data from application */
2338- XtPointer call_data UNUSED) /* data from widget class */
2331+ Widget w UNUSED, // widget id
2332+ XtPointer client_data UNUSED, // data from application
2333+ XtPointer call_data UNUSED) // data from widget class
23392334 {
23402335 if (browse_fname != NULL)
23412336 {
@@ -2350,9 +2345,9 @@
23502345 */
23512346 static void
23522347 DialogAcceptCB(
2353- Widget w UNUSED, /* widget id */
2354- XtPointer client_data UNUSED, /* data from application */
2355- XtPointer call_data) /* data from widget class */
2348+ Widget w UNUSED, // widget id
2349+ XtPointer client_data UNUSED, // data from application
2350+ XtPointer call_data) // data from widget class
23562351 {
23572352 XmFileSelectionBoxCallbackStruct *fcb;
23582353
@@ -2363,14 +2358,14 @@
23632358 }
23642359 fcb = (XmFileSelectionBoxCallbackStruct *)call_data;
23652360
2366- /* get the filename from the file selection box */
2361+ // get the filename from the file selection box
23672362 XmStringGetLtoR(fcb->value, charset, &browse_fname);
23682363
2369- /* popdown the file selection box */
2364+ // popdown the file selection box
23702365 XtUnmanageChild(dialog_wgt);
23712366 }
23722367
2373-#endif /* FEAT_BROWSE */
2368+#endif // FEAT_BROWSE
23742369
23752370 #if defined(FEAT_GUI_DIALOG) || defined(PROTO)
23762371
@@ -2483,7 +2478,7 @@
24832478 char_u *message,
24842479 char_u *button_names,
24852480 int dfltbutton,
2486- char_u *textfield, /* buffer of size IOSIZE */
2481+ char_u *textfield, // buffer of size IOSIZE
24872482 int ex_cmd UNUSED)
24882483 {
24892484 char_u *buts;
@@ -2509,15 +2504,15 @@
25092504 if (title == NULL)
25102505 title = (char_u *)_("Vim dialog");
25112506
2512- /* if our pointer is currently hidden, then we should show it. */
2507+ // if our pointer is currently hidden, then we should show it.
25132508 gui_mch_mousehide(FALSE);
25142509
25152510 dialogform = XmCreateFormDialog(vimShell, (char *)"dialog", NULL, 0);
25162511
2517- /* Check 'v' flag in 'guioptions': vertical button placement. */
2512+ // Check 'v' flag in 'guioptions': vertical button placement.
25182513 vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
25192514
2520- /* Set the title of the Dialog window */
2515+ // Set the title of the Dialog window
25212516 label = XmStringCreateSimple((char *)title);
25222517 if (label == NULL)
25232518 return -1;
@@ -2528,12 +2523,12 @@
25282523 NULL);
25292524 XmStringFree(label);
25302525
2531- /* make a copy, so that we can insert NULs */
2526+ // make a copy, so that we can insert NULs
25322527 buts = vim_strsave(button_names);
25332528 if (buts == NULL)
25342529 return -1;
25352530
2536- /* Count the number of buttons and allocate buttons[]. */
2531+ // Count the number of buttons and allocate buttons[].
25372532 butcount = 1;
25382533 for (p = buts; *p; ++p)
25392534 if (*p == DLG_BUTTON_SEP)
@@ -2588,7 +2583,7 @@
25882583 XmStringFree(label);
25892584 gui_motif_menu_fontlist(buttons[butcount]);
25902585
2591- /* Layout properly. */
2586+ // Layout properly.
25922587
25932588 if (butcount > 0)
25942589 {
@@ -2605,7 +2600,7 @@
26052600 XmNrightOffset, 4,
26062601 NULL);
26072602
2608- /* fill in a form as invisible separator */
2603+ // fill in a form as invisible separator
26092604 sep_form = XtVaCreateWidget("separatorForm",
26102605 xmFormWidgetClass, dialogform,
26112606 XmNleftAttachment, XmATTACH_WIDGET,
@@ -2635,7 +2630,7 @@
26352630 XmNrightOffset, 4,
26362631 NULL);
26372632
2638- /* fill in a form as invisible separator */
2633+ // fill in a form as invisible separator
26392634 sep_form = XtVaCreateWidget("separatorForm",
26402635 xmFormWidgetClass, dialogform,
26412636 XmNleftAttachment, XmATTACH_FORM,
@@ -2663,7 +2658,7 @@
26632658 separator = (Widget) 0;
26642659 if (butcount > 0)
26652660 {
2666- /* Create the separator for beauty. */
2661+ // Create the separator for beauty.
26672662 n = 0;
26682663 XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
26692664 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++;
@@ -2699,7 +2694,7 @@
26992694 (XtEventHandler)keyhit_callback, (XtPointer)NULL);
27002695 }
27012696
2702- /* Form holding both message and pixmap labels */
2697+ // Form holding both message and pixmap labels
27032698 form = XtVaCreateWidget("separatorForm",
27042699 xmFormWidgetClass, dialogform,
27052700 XmNleftAttachment, XmATTACH_FORM,
@@ -2709,7 +2704,7 @@
27092704 XtManageChild(form);
27102705
27112706 #ifdef HAVE_XPM
2712- /* Add a pixmap, left of the message. */
2707+ // Add a pixmap, left of the message.
27132708 switch (type)
27142709 {
27152710 case VIM_GENERIC:
@@ -2744,12 +2739,11 @@
27442739 XtManageChild(dialogpixmap);
27452740 #endif
27462741
2747- /* Create the dialog message.
2748- * Since LessTif is apparently having problems with the creation of
2749- * properly localized string, we use LtoR here. The symptom is that the
2750- * string sill not show properly in multiple lines as it does in native
2751- * Motif.
2752- */
2742+ // Create the dialog message.
2743+ // Since LessTif is apparently having problems with the creation of
2744+ // properly localized string, we use LtoR here. The symptom is that the
2745+ // string sill not show properly in multiple lines as it does in native
2746+ // Motif.
27532747 label = XmStringCreateLtoR((char *)message, STRING_TAG);
27542748 if (label == NULL)
27552749 return -1;
@@ -2811,7 +2805,7 @@
28112805
28122806 if (textfield != NULL && *textfield != NUL)
28132807 {
2814- /* This only works after the textfield has been realised. */
2808+ // This only works after the textfield has been realised.
28152809 XmTextFieldSetSelection(dialogtextfield,
28162810 (XmTextPosition)0, (XmTextPosition)STRLEN(textfield),
28172811 XtLastTimestampProcessed(gui.dpy));
@@ -2821,7 +2815,7 @@
28212815
28222816 app = XtWidgetToApplicationContext(dialogform);
28232817
2824- /* Loop until a button is pressed or the dialog is killed somehow. */
2818+ // Loop until a button is pressed or the dialog is killed somehow.
28252819 dialogStatus = -1;
28262820 for (;;)
28272821 {
@@ -2847,17 +2841,17 @@
28472841
28482842 return dialogStatus;
28492843 }
2850-#endif /* FEAT_GUI_DIALOG */
2844+#endif // FEAT_GUI_DIALOG
28512845
28522846 #if defined(FEAT_FOOTER) || defined(PROTO)
28532847
28542848 static int
28552849 gui_mch_compute_footer_height(void)
28562850 {
2857- Dimension height; /* total Toolbar height */
2858- Dimension top; /* XmNmarginTop */
2859- Dimension bottom; /* XmNmarginBottom */
2860- Dimension shadow; /* XmNshadowThickness */
2851+ Dimension height; // total Toolbar height
2852+ Dimension top; // XmNmarginTop
2853+ Dimension bottom; // XmNmarginBottom
2854+ Dimension shadow; // XmNshadowThickness
28612855
28622856 XtVaGetValues(footer,
28632857 XmNheight, &height,
@@ -2905,16 +2899,15 @@
29052899 void
29062900 gui_mch_show_toolbar(int showit)
29072901 {
2908- Cardinal numChildren; /* how many children toolBar has */
2902+ Cardinal numChildren; // how many children toolBar has
29092903
29102904 if (toolBar == (Widget)0)
29112905 return;
29122906 XtVaGetValues(toolBar, XmNnumChildren, &numChildren, NULL);
29132907 if (showit && numChildren > 0)
29142908 {
2915- /* Assume that we want to show the toolbar if p_toolbar contains
2916- * valid option settings, therefore p_toolbar must not be NULL.
2917- */
2909+ // Assume that we want to show the toolbar if p_toolbar contains
2910+ // valid option settings, therefore p_toolbar must not be NULL.
29182911 WidgetList children;
29192912
29202913 XtVaGetValues(toolBar, XmNchildren, &children, NULL);
@@ -2938,12 +2931,11 @@
29382931 for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
29392932 if (menu_is_toolbar(toolbar->dname))
29402933 break;
2941- /* Assumption: toolbar is NULL if there is no toolbar,
2942- * otherwise it contains the toolbar menu structure.
2943- *
2944- * Assumption: "numChildren" == the number of items in the list
2945- * of items beginning with toolbar->children.
2946- */
2934+ // Assumption: toolbar is NULL if there is no toolbar,
2935+ // otherwise it contains the toolbar menu structure.
2936+ //
2937+ // Assumption: "numChildren" == the number of items in the list
2938+ // of items beginning with toolbar->children.
29472939 if (toolbar)
29482940 {
29492941 for (cur = toolbar->children; cur; cur = cur->next)
@@ -2951,8 +2943,8 @@
29512943 Arg args[1];
29522944 int n = 0;
29532945
2954- /* Enable/Disable tooltip (OK to enable while
2955- * currently enabled). */
2946+ // Enable/Disable tooltip (OK to enable while
2947+ // currently enabled).
29562948 if (cur->tip != NULL)
29572949 (*action)(cur->tip);
29582950 if (!menu_is_separator(cur->name))
@@ -3068,16 +3060,16 @@
30683060 gui_mch_compute_toolbar_height(void)
30693061 {
30703062 Dimension borders;
3071- Dimension height; /* total Toolbar height */
3072- Dimension whgt; /* height of each widget */
3073- WidgetList children; /* list of toolBar's children */
3074- Cardinal numChildren; /* how many children toolBar has */
3063+ Dimension height; // total Toolbar height
3064+ Dimension whgt; // height of each widget
3065+ WidgetList children; // list of toolBar's children
3066+ Cardinal numChildren; // how many children toolBar has
30753067 int i;
30763068
30773069 borders = 0;
30783070 height = 0;
30793071 if (toolBar != (Widget)0 && toolBarFrame != (Widget)0)
3080- { /* get height of XmFrame parent */
3072+ { // get height of XmFrame parent
30813073 Dimension fst;
30823074 Dimension fmh;
30833075 Dimension tst;
@@ -3103,7 +3095,7 @@
31033095 }
31043096 }
31053097 #ifdef LESSTIF_VERSION
3106- /* Hack: When starting up we get wrong dimensions. */
3098+ // Hack: When starting up we get wrong dimensions.
31073099 if (height < 10)
31083100 height = 24;
31093101 #endif
@@ -3256,7 +3248,7 @@
32563248 if (tabLine == (Widget)0)
32573249 return;
32583250
3259- /* Add a label for each tab page. They all contain the same text area. */
3251+ // Add a label for each tab page. They all contain the same text area.
32603252 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr)
32613253 {
32623254 if (tp == curtab)
@@ -3266,7 +3258,7 @@
32663258 if (page_status == XmPAGE_INVALID
32673259 || page_info.major_tab_widget == (Widget)0)
32683260 {
3269- /* Add the tab */
3261+ // Add the tab
32703262 n = 0;
32713263 XtSetArg(args[n], XmNnotebookChildType, XmMAJOR_TAB); n++;
32723264 XtSetArg(args[n], XmNtraversalOn, False); n++;
@@ -3309,7 +3301,7 @@
33093301
33103302 XtVaGetValues(tabLine, XmNlastPageNumber, &last_page, NULL);
33113303
3312- /* Remove any old labels. */
3304+ // Remove any old labels.
33133305 while (nr <= last_page)
33143306 {
33153307 if (XmNotebookGetPageInfo(tabLine, nr, &page_info) != XmPAGE_INVALID
@@ -3400,8 +3392,8 @@
34003392 {
34013393 XtUnmanageChild(id);
34023394 XtVaSetValues(id, XmNfontList, fl, NULL);
3403- /* We should force the widget to recalculate its
3404- * geometry now. */
3395+ // We should force the widget to recalculate its
3396+ // geometry now.
34053397 XtManageChild(id);
34063398 }
34073399 else
@@ -3421,8 +3413,8 @@
34213413 {
34223414 XtUnmanageChild(id);
34233415 XtVaSetValues(id, XmNfontList, fl, NULL);
3424- /* We should force the widget to recalculate its
3425- * geometry now. */
3416+ // We should force the widget to recalculate its
3417+ // geometry now.
34263418 XtManageChild(id);
34273419 }
34283420 else
@@ -3441,17 +3433,17 @@
34413433
34423434 typedef struct _SharedFindReplace
34433435 {
3444- Widget dialog; /* the main dialog widget */
3445- Widget wword; /* 'Exact match' check button */
3446- Widget mcase; /* 'match case' check button */
3447- Widget up; /* search direction 'Up' radio button */
3448- Widget down; /* search direction 'Down' radio button */
3449- Widget what; /* 'Find what' entry text widget */
3450- Widget with; /* 'Replace with' entry text widget */
3451- Widget find; /* 'Find Next' action button */
3452- Widget replace; /* 'Replace With' action button */
3453- Widget all; /* 'Replace All' action button */
3454- Widget undo; /* 'Undo' action button */
3436+ Widget dialog; // the main dialog widget
3437+ Widget wword; // 'Exact match' check button
3438+ Widget mcase; // 'match case' check button
3439+ Widget up; // search direction 'Up' radio button
3440+ Widget down; // search direction 'Down' radio button
3441+ Widget what; // 'Find what' entry text widget
3442+ Widget with; // 'Replace with' entry text widget
3443+ Widget find; // 'Find Next' action button
3444+ Widget replace; // 'Replace With' action button
3445+ Widget all; // 'Replace All' action button
3446+ Widget undo; // 'Undo' action button
34553447
34563448 Widget cancel;
34573449 } SharedFindReplace;
@@ -3468,7 +3460,7 @@
34683460 SharedFindReplace *cd = (SharedFindReplace *)client_data;
34693461
34703462 if (cd != NULL)
3471- /* suppress_dialog_mnemonics(cd->dialog); */
3463+ // suppress_dialog_mnemonics(cd->dialog);
34723464 cd->dialog = (Widget)0;
34733465 }
34743466
@@ -3510,7 +3502,7 @@
35103502 {
35113503 char_u *save_cpo = p_cpo;
35123504
3513- /* No need to be Vi compatible here. */
3505+ // No need to be Vi compatible here.
35143506 p_cpo = (char_u *)"";
35153507 u_undo(1);
35163508 p_cpo = save_cpo;
@@ -3518,7 +3510,7 @@
35183510 return;
35193511 }
35203512
3521- /* Get the search/replace strings from the dialog */
3513+ // Get the search/replace strings from the dialog
35223514 if (flags == FRD_FINDNEXT)
35233515 {
35243516 repl_text = NULL;
@@ -3560,7 +3552,7 @@
35603552
35613553 keysym = XLookupKeysym(event, 0);
35623554
3563- /* the scape key pops the whole dialog down */
3555+ // the scape key pops the whole dialog down
35643556 if (keysym == XK_Escape)
35653557 XtUnmanageChild(frdp->dialog);
35663558 }
@@ -3625,15 +3617,15 @@
36253617
36263618 frdp = do_replace ? &repl_widgets : &find_widgets;
36273619
3628- /* Get the search string to use. */
3620+ // Get the search string to use.
36293621 entry_text = get_find_dialog_text(arg, &wword, &mcase);
36303622
3631- /* If the dialog already exists, just raise it. */
3623+ // If the dialog already exists, just raise it.
36323624 if (frdp->dialog)
36333625 {
36343626 gui_motif_synch_fonts();
36353627
3636- /* If the window is already up, just pop it to the top */
3628+ // If the window is already up, just pop it to the top
36373629 if (XtIsManaged(frdp->dialog))
36383630 XMapRaised(XtDisplay(frdp->dialog),
36393631 XtWindow(XtParent(frdp->dialog)));
@@ -3650,7 +3642,7 @@
36503642 return;
36513643 }
36523644
3653- /* Create a fresh new dialog window */
3645+ // Create a fresh new dialog window
36543646 if (do_replace)
36553647 str = XmStringCreateSimple(_("VIM - Search and Replace..."));
36563648 else
@@ -3832,8 +3824,7 @@
38323824 (XtEventHandler)find_replace_keypress,
38333825 (XtPointer)frdp);
38343826
3835- /* Get the maximum width between the label widgets and line them up.
3836- */
3827+ // Get the maximum width between the label widgets and line them up.
38373828 n = 0;
38383829 XtSetArg(args[n], XmNwidth, &width); n++;
38393830 XtGetValues(label_what, args, n);
@@ -3990,15 +3981,15 @@
39903981 XFontStruct *font;
39913982 XmFontList font_list;
39923983
3993- /* FIXME: Unless we find out how to create a XmFontList from a XFontSet,
3994- * we just give up here on font synchronization. */
3984+ // FIXME: Unless we find out how to create a XmFontList from a XFontSet,
3985+ // we just give up here on font synchronization.
39953986 font = (XFontStruct *)gui.norm_font;
39963987 if (font == NULL)
39973988 return;
39983989
39993990 font_list = gui_motif_create_fontlist(font);
40003991
4001- /* OK this loop is a bit tricky... */
3992+ // OK this loop is a bit tricky...
40023993 for (do_replace = 0; do_replace <= 1; ++do_replace)
40033994 {
40043995 frdp = (do_replace) ? (&repl_widgets) : (&find_widgets);
diff -r 06ed2fe62dce -r e1f4e9d78a6a src/gui_photon.c
--- a/src/gui_photon.c Mon Dec 02 21:45:05 2019 +0100
+++ b/src/gui_photon.c Mon Dec 02 23:00:04 2019 +0100
@@ -13,7 +13,7 @@
1313
1414 #include "vim.h"
1515
16-/* cproto fails on missing include files */
16+// cproto fails on missing include files
1717 #ifndef PROTO
1818 # ifdef FEAT_TOOLBAR
1919 # include <photon/PxImage.h>
@@ -21,7 +21,7 @@
2121 #endif
2222
2323 #if !defined(__QNX__)
24-/* Used when generating prototypes. */
24+// Used when generating prototypes.
2525 # define PgColor_t int
2626 # define PhEvent_t int
2727 # define PhPoint_t int
@@ -39,11 +39,11 @@
3939
4040 #define EVENT_BUFFER_SIZE sizeof(PhEvent_t) + 1000
4141
42-/* Some defines for gui_mch_mousehide() */
42+// Some defines for gui_mch_mousehide()
4343 #define MOUSE_HIDE TRUE
4444 #define MOUSE_SHOW FALSE
4545
46-/* Optional support for using a PtPanelGroup widget, needs work */
46+// Optional support for using a PtPanelGroup widget, needs work
4747 #undef USE_PANEL_GROUP
4848
4949 #ifdef USE_PANEL_GROUP
@@ -53,15 +53,15 @@
5353 static short pg_margin_left, pg_margin_right, pg_margin_top, pg_margin_bottom;
5454 #endif
5555
56-#define GUI_PH_MARGIN 4 /* Size of the bevel */
56+#define GUI_PH_MARGIN 4 // Size of the bevel
5757
5858 #define GUI_PH_MOUSE_TYPE Ph_CURSOR_INSERT
5959 static PgColor_t gui_ph_mouse_color = Pg_BLACK;
6060
6161 static PhPoint_t gui_ph_raw_offset;
62-static PtWidget_t *gui_ph_timer_cursor; /* handle cursor blinking */
63-static PtWidget_t *gui_ph_timer_timeout; /* used in gui_mch_wait_for_chars */
64-static short is_timeout; /* Has the timeout occurred? */
62+static PtWidget_t *gui_ph_timer_cursor; // handle cursor blinking
63+static PtWidget_t *gui_ph_timer_timeout; // used in gui_mch_wait_for_chars
64+static short is_timeout; // Has the timeout occurred?
6565
6666 /*
6767 * This is set inside the mouse callback for a right mouse
@@ -69,10 +69,10 @@
6969 */
7070 static PhPoint_t abs_mouse;
7171
72-/* Try and avoid redraws while a resize is in progress */
72+// Try and avoid redraws while a resize is in progress
7373 static int is_ignore_draw = FALSE;
7474
75-/* Used for converting to/from utf-8 and other charsets */
75+// Used for converting to/from utf-8 and other charsets
7676 static struct PxTransCtrl *charset_translate;
7777
7878 /*
@@ -160,23 +160,23 @@
160160 {Pk_KP_Multiply,'K', '9'},
161161 {Pk_KP_Enter, 'K', 'A'},
162162
163- {Pk_KP_0, KS_EXTRA, KE_KINS}, /* Insert */
164- {Pk_KP_Decimal, KS_EXTRA, KE_KDEL}, /* Delete */
165-
166- {Pk_KP_4, 'k', 'l'}, /* Left */
167- {Pk_KP_6, 'k', 'r'}, /* Right */
168- {Pk_KP_8, 'k', 'u'}, /* Up */
169- {Pk_KP_2, 'k', 'd'}, /* Down */
170-
171- {Pk_KP_7, 'K', '1'}, /* Home */
172- {Pk_KP_1, 'K', '4'}, /* End */
173-
174- {Pk_KP_9, 'K', '3'}, /* Page Up */
175- {Pk_KP_3, 'K', '5'}, /* Page Down */
176-
177- {Pk_KP_5, '&', '8'}, /* Undo */
178-
179- /* Keys that we want to be able to use any modifier with: */
163+ {Pk_KP_0, KS_EXTRA, KE_KINS}, // Insert
164+ {Pk_KP_Decimal, KS_EXTRA, KE_KDEL}, // Delete
165+
166+ {Pk_KP_4, 'k', 'l'}, // Left
167+ {Pk_KP_6, 'k', 'r'}, // Right
168+ {Pk_KP_8, 'k', 'u'}, // Up
169+ {Pk_KP_2, 'k', 'd'}, // Down
170+
171+ {Pk_KP_7, 'K', '1'}, // Home
172+ {Pk_KP_1, 'K', '4'}, // End
173+
174+ {Pk_KP_9, 'K', '3'}, // Page Up
175+ {Pk_KP_3, 'K', '5'}, // Page Down
176+
177+ {Pk_KP_5, '&', '8'}, // Undo
178+
179+ // Keys that we want to be able to use any modifier with:
180180 {Pk_Return, CAR, NUL},
181181 {Pk_space, ' ', NUL},
182182 {Pk_Tab, TAB, NUL},
@@ -184,12 +184,12 @@
184184 {NL, NL, NUL},
185185 {CAR, CAR, NUL},
186186
187- /* End of list marker: */
187+ // End of list marker:
188188 {0, 0, 0}
189189 };
190190
191191
192-/****************************************************************************/
192+////////////////////////////////////////////////////////////////////////////
193193
194194 static PtCallbackF_t gui_ph_handle_timer_cursor;
195195 static PtCallbackF_t gui_ph_handle_timer_timeout;
@@ -201,11 +201,11 @@
201201 static PtCallbackF_t gui_ph_handle_mouse;
202202 static PtCallbackF_t gui_ph_handle_pulldown_menu;
203203 static PtCallbackF_t gui_ph_handle_menu;
204-static PtCallbackF_t gui_ph_handle_focus; /* focus change of text area */
204+static PtCallbackF_t gui_ph_handle_focus; // focus change of text area
205205
206206 static PtCallbackF_t gui_ph_handle_menu_resize;
207207
208-/* When a menu is unrealized, give focus back to vimTextArea */
208+// When a menu is unrealized, give focus back to vimTextArea
209209 static PtCallbackF_t gui_ph_handle_menu_unrealized;
210210
211211 #ifdef USE_PANEL_GROUP
@@ -215,7 +215,7 @@
215215 static void gui_ph_draw_start(void);
216216 static void gui_ph_draw_end(void);
217217
218-/* Set the text for the balloon */
218+// Set the text for the balloon
219219 static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window,
220220 PtWidget_t *widget,
221221 int position,
@@ -224,7 +224,7 @@
224224 PgColor_t fill_color,
225225 PgColor_t text_color);
226226
227-/****************************************************************************/
227+////////////////////////////////////////////////////////////////////////////
228228
229229 static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window,
230230 PtWidget_t *widget,
@@ -241,7 +241,7 @@
241241 PtSetArg(&arg, Pt_ARG_POINTER, &menu, 0);
242242 PtGetResources(widget, 1, &arg);
243243
244- /* Override the text and position */
244+ // Override the text and position
245245
246246 tooltip = text;
247247 if (menu != NULL)
@@ -254,8 +254,8 @@
254254 return PtInflateBalloon(
255255 window,
256256 widget,
257- /* Don't put the balloon at the bottom,
258- * it gets drawn over by gfx done in the PtRaw */
257+ // Don't put the balloon at the bottom,
258+ // it gets drawn over by gfx done in the PtRaw
259259 Pt_BALLOON_TOP,
260260 tooltip,
261261 font,
@@ -287,9 +287,9 @@
287287
288288 height = sizes->new_dim.h;
289289
290- /* Because vim treats the toolbar and menubar separately,
291- * and here they're lumped together into a PtToolbarGroup,
292- * we only need either menu_height or toolbar_height set at once */
290+ // Because vim treats the toolbar and menubar separately,
291+ // and here they're lumped together into a PtToolbarGroup,
292+ // we only need either menu_height or toolbar_height set at once
293293 if (gui.menu_is_active)
294294 {
295295 gui.menu_height = height;
@@ -368,7 +368,7 @@
368368 break;
369369
370370 case Ph_WM_FOCUS:
371- /* Just in case it's hidden and needs to be shown */
371+ // Just in case it's hidden and needs to be shown
372372 gui_mch_mousehide(MOUSE_SHOW);
373373
374374 if (we->event_state == Ph_WM_EVSTATE_FOCUS)
@@ -424,7 +424,7 @@
424424 break;
425425
426426 case Pt_SCROLL_SET:
427- /* FIXME: return straight away here? */
427+ // FIXME: return straight away here?
428428 return Pt_CONTINUE;
429429 break;
430430 }
@@ -449,7 +449,7 @@
449449 if (p_mh)
450450 gui_mch_mousehide(MOUSE_HIDE);
451451
452- /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
452+ // We're a good lil photon program, aren't we? yes we are, yeess wee arrr
453453 if (key->key_flags & Pk_KF_Compose)
454454 return Pt_CONTINUE;
455455
@@ -469,7 +469,7 @@
469469 (*p_wak == 'm' &&
470470 gui_is_menu_shortcut(key->key_cap))))
471471 {
472- /* Fallthrough and let photon look for the hotkey */
472+ // Fallthrough and let photon look for the hotkey
473473 return Pt_CONTINUE;
474474 }
475475 #endif
@@ -483,13 +483,13 @@
483483 ch = special_keys[i].vim_code0;
484484 else
485485 {
486- /* Detect if a keypad number key has been pressed
487- * and change the key if Num Lock is on */
486+ // Detect if a keypad number key has been pressed
487+ // and change the key if Num Lock is on
488488 if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
489489 && (key->key_mods & Pk_KM_Num_Lock))
490490 {
491- /* FIXME: For now, just map the key to a ascii value
492- * (see <photon/PkKeyDef.h>) */
491+ // FIXME: For now, just map the key to a ascii value
492+ // (see <photon/PkKeyDef.h>)
493493 ch = key->key_cap - 0xf080;
494494 }
495495 else
@@ -507,7 +507,7 @@
507507 if (key->key_mods & Pk_KM_Shift)
508508 modifiers |= MOD_MASK_SHIFT;
509509
510- /* Is this not a special key? */
510+ // Is this not a special key?
511511 if (special_keys[i].key_sym == 0)
512512 {
513513 ch = PhTo8859_1(key);
@@ -542,7 +542,7 @@
542542 ch = key->key_cap;
543543 if (ch < 0xff)
544544 {
545- /* FIXME: is this the right thing to do? */
545+ // FIXME: is this the right thing to do?
546546 if (modifiers & MOD_MASK_CTRL)
547547 {
548548 modifiers &= ~MOD_MASK_CTRL;
@@ -605,7 +605,7 @@
605605
606606 if (len == 1 && string[0] == CSI)
607607 {
608- /* Turn CSI into K_CSI. */
608+ // Turn CSI into K_CSI.
609609 string[ len++ ] = KS_EXTRA;
610610 string[ len++ ] = KE_CSI;
611611 }
@@ -663,7 +663,7 @@
663663 if (pointer->buttons & Ph_BUTTON_MENU)
664664 {
665665 button = MOUSE_RIGHT;
666- /* Need the absolute coordinates for the popup menu */
666+ // Need the absolute coordinates for the popup menu
667667 abs_mouse.x = pointer->pos.x;
668668 abs_mouse.y = pointer->pos.y;
669669 }
@@ -671,7 +671,7 @@
671671 if (pointer->buttons & Ph_BUTTON_ADJUST)
672672 button = MOUSE_MIDDLE;
673673
674- /* Catch a real release (not phantom or other releases */
674+ // Catch a real release (not phantom or other releases
675675 if (info->event->type == Ph_EV_BUT_RELEASE)
676676 button = MOUSE_RELEASE;
677677
@@ -679,12 +679,12 @@
679679 button = MOUSE_DRAG;
680680
681681 #if 0
682- /* Vim doesn't use button repeats */
682+ // Vim doesn't use button repeats
683683 if (info->event->type & Ph_EV_BUT_REPEAT)
684684 button = MOUSE_DRAG;
685685 #endif
686686
687- /* Don't do anything if it is one of the phantom mouse release events */
687+ // Don't do anything if it is one of the phantom mouse release events
688688 if ((button != MOUSE_RELEASE) ||
689689 (info->event->subtype == Ph_EV_RELEASE_REAL))
690690 {
@@ -696,7 +696,9 @@
696696 return Pt_CONTINUE;
697697 }
698698
699-/* Handle a focus change of the PtRaw widget */
699+/*
700+ * Handle a focus change of the PtRaw widget
701+ */
700702 static int
701703 gui_ph_handle_focus(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
702704 {
@@ -745,7 +747,7 @@
745747 PhTranslatePoint(&offset, PtWidgetPos(gui.vimTextArea, NULL));
746748
747749 #if 1
748- /* Redraw individual damage regions */
750+ // Redraw individual damage regions
749751 if (damage->next != NULL)
750752 damage = damage->next;
751753
@@ -759,7 +761,7 @@
759761 damage = damage->next;
760762 }
761763 #else
762- /* Redraw the rectangle that covers all the damaged regions */
764+ // Redraw the rectangle that covers all the damaged regions
763765 r = &damage->rect;
764766 gui_redraw(
765767 r->ul.x - offset.x, r->ul.y - offset.y,
@@ -787,7 +789,9 @@
787789 return Pt_CONTINUE;
788790 }
789791
790-/* This is used for pulldown/popup menus and also toolbar buttons */
792+/*
793+ * This is used for pulldown/popup menus and also toolbar buttons
794+ */
791795 static int
792796 gui_ph_handle_menu(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
793797 {
@@ -799,7 +803,9 @@
799803 return Pt_CONTINUE;
800804 }
801805
802-/* Stop focus from disappearing into the menubar... */
806+/*
807+ * Stop focus from disappearing into the menubar...
808+ */
803809 static int
804810 gui_ph_handle_menu_unrealized(
805811 PtWidget_t *widget,
@@ -820,12 +826,14 @@
820826 return Pt_CONTINUE;
821827 }
822828
823-/****************************************************************************/
829+////////////////////////////////////////////////////////////////////////////
824830
825831 #define DRAW_START gui_ph_draw_start()
826832 #define DRAW_END gui_ph_draw_end()
827833
828-/* TODO: Set a clipping rect? */
834+/*
835+ * TODO: Set a clipping rect?
836+ */
829837 static void
830838 gui_ph_draw_start(void)
831839 {
@@ -888,8 +896,8 @@
888896
889897 for (i = 0; i < num_panels; i++)
890898 {
891- /* find the last "(" in the panel title and see if the buffer
892- * number in the title matches the one we're looking for */
899+ // find the last "(" in the panel title and see if the buffer
900+ // number in the title matches the one we're looking for
893901 mark = STRRCHR(panel_titles[ i ], '(');
894902 if (mark != NULL && STRCMP(mark, search) == 0)
895903 {
@@ -948,7 +956,9 @@
948956 *right = *margin_right;
949957 }
950958
951-/* Used for the tabs for PtPanelGroup */
959+/*
960+ * Used for the tabs for PtPanelGroup
961+ */
952962 static int
953963 gui_ph_is_buffer_item(vimmenu_T *menu, vimmenu_T *parent)
954964 {
@@ -956,7 +966,7 @@
956966
957967 if (STRCMP(parent->dname, "Buffers") == 0)
958968 {
959- /* Look for '(' digits ')' */
969+ // Look for '(' digits ')'
960970 mark = vim_strchr(menu->dname, '(');
961971 if (mark != NULL)
962972 {
@@ -998,14 +1008,14 @@
9981008 int i;
9991009 char **new_titles = NULL;
10001010
1001- /* If there is only 1 panel, we just use the temporary place holder */
1011+ // If there is only 1 panel, we just use the temporary place holder
10021012 if (num_panels > 1)
10031013 {
10041014 new_titles = ALLOC_MULT(char *, num_panels - 1);
10051015 if (new_titles != NULL)
10061016 {
10071017 char **s = new_titles;
1008- /* Copy all the titles except the one we're removing */
1018+ // Copy all the titles except the one we're removing
10091019 for (i = 0; i < num_panels; i++)
10101020 {
10111021 if (STRCMP(panel_titles[ i ], name) != 0)
@@ -1030,7 +1040,9 @@
10301040 }
10311041 }
10321042
1033-/* When a buffer item is deleted from the buffer menu */
1043+/*
1044+ * When a buffer item is deleted from the buffer menu
1045+ */
10341046 static int
10351047 gui_ph_handle_buffer_remove(
10361048 PtWidget_t *widget,
@@ -1062,12 +1074,12 @@
10621074 return Pt_CONTINUE;
10631075 }
10641076
1065-/****************************************************************************/
1077+////////////////////////////////////////////////////////////////////////////
10661078
10671079 void
10681080 gui_ph_encoding_changed(int new_encoding)
10691081 {
1070- /* Default encoding is latin1 */
1082+ // Default encoding is latin1
10711083 char *charset = "latin1";
10721084 int i;
10731085
@@ -1090,8 +1102,7 @@
10901102 charset_translate = PxTranslateSet(charset_translate, charset);
10911103 }
10921104
1093-/****************************************************************************/
1094-/****************************************************************************/
1105+////////////////////////////////////////////////////////////////////////////
10951106
10961107 void
10971108 gui_mch_prepare(int *argc, char **argv)
@@ -1105,20 +1116,20 @@
11051116 PtArg_t args[10];
11061117 int flags = 0, n = 0;
11071118
1108- PhDim_t window_size = {100, 100}; /* Arbitrary values */
1119+ PhDim_t window_size = {100, 100}; // Arbitrary values
11091120 PhPoint_t pos = {0, 0};
11101121
11111122 gui.event_buffer = alloc(EVENT_BUFFER_SIZE);
11121123 if (gui.event_buffer == NULL)
11131124 return FAIL;
11141125
1115- /* Get a translation so we can convert from ISO Latin-1 to UTF */
1126+ // Get a translation so we can convert from ISO Latin-1 to UTF
11161127 charset_translate = PxTranslateSet(NULL, "latin1");
11171128
1118- /* The +2 is for the 1 pixel dark line on each side */
1129+ // The +2 is for the 1 pixel dark line on each side
11191130 gui.border_offset = gui.border_width = GUI_PH_MARGIN + 2;
11201131
1121- /* Handle close events ourselves */
1132+ // Handle close events ourselves
11221133 PtSetArg(&args[ n++ ], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE);
11231134 PtSetArg(&args[ n++ ], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE,
11241135 Ph_WM_CLOSE | Ph_WM_RESIZE | Ph_WM_FOCUS);
@@ -1137,7 +1148,7 @@
11371148 PtSetArg(&args[ n++ ], Pt_ARG_POS, &pos, 0);
11381149
11391150 #ifdef USE_PANEL_GROUP
1140- /* Put in a temporary place holder title */
1151+ // Put in a temporary place holder title
11411152 PtSetArg(&args[ n++ ], Pt_ARG_PG_PANEL_TITLES, &empty_title, 1);
11421153
11431154 gui.vimPanelGroup = PtCreateWidget(PtPanelGroup, gui.vimWindow, n, args);
@@ -1147,7 +1158,7 @@
11471158 PtAddCallback(gui.vimPanelGroup, Pt_CB_PG_PANEL_SWITCHING,
11481159 gui_ph_handle_pg_change, NULL);
11491160 #else
1150- /* Turn off all edge decorations */
1161+ // Turn off all edge decorations
11511162 PtSetArg(&args[ n++ ], Pt_ARG_BASIC_FLAGS, Pt_FALSE, Pt_ALL);
11521163 PtSetArg(&args[ n++ ], Pt_ARG_BEVEL_WIDTH, 0, 0);
11531164 PtSetArg(&args[ n++ ], Pt_ARG_MARGIN_WIDTH, 0, 0);
@@ -1161,7 +1172,7 @@
11611172 PtAddCallback(gui.vimContainer, Pt_CB_RESIZE, gui_ph_pane_resize, NULL);
11621173 #endif
11631174
1164- /* Size for the text area is set in gui_mch_set_text_area_pos */
1175+ // Size for the text area is set in gui_mch_set_text_area_pos
11651176 n = 0;
11661177
11671178 PtSetArg(&args[ n++ ], Pt_ARG_RAW_DRAW_F, gui_ph_handle_raw_draw, 1);
@@ -1181,8 +1192,8 @@
11811192 if (gui.vimTextArea == NULL)
11821193 return FAIL;
11831194
1184- /* TODO: use PtAddEventHandlers instead? */
1185- /* Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway */
1195+ // TODO: use PtAddEventHandlers instead?
1196+ // Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway
11861197 PtAddEventHandler(gui.vimTextArea,
11871198 Ph_EV_BUT_PRESS | Ph_EV_BUT_RELEASE | Ph_EV_PTR_MOTION_BUTTON,
11881199 gui_ph_handle_mouse, NULL);
@@ -1311,11 +1322,13 @@
13111322 #endif
13121323 }
13131324
1314-/****************************************************************************/
1315-/* events */
1316-
1317-/* When no events are available, photon will call this function, working is
1318- * set to FALSE, and the gui_mch_update loop will exit. */
1325+////////////////////////////////////////////////////////////////////////////
1326+// events
1327+
1328+/*
1329+ * When no events are available, photon will call this function, working is
1330+ * set to FALSE, and the gui_mch_update loop will exit.
1331+ */
13191332 static int
13201333 exit_gui_mch_update(void *data)
13211334 {
@@ -1388,12 +1401,12 @@
13881401 {
13891402 if (saving == TRUE)
13901403 {
1391- /* Don't need Pt_FSR_CONFIRM_EXISTING, vim will ask anyway */
1404+ // Don't need Pt_FSR_CONFIRM_EXISTING, vim will ask anyway
13921405 flags |= Pt_FSR_NO_FCHECK;
13931406 open_text = "&Save";
13941407 }
13951408
1396- /* combine the directory and filename into a single path */
1409+ // combine the directory and filename into a single path
13971410 if (initdir == NULL || *initdir == NUL)
13981411 {
13991412 mch_dirname(default_path, MAXPATHL);
@@ -1413,7 +1426,7 @@
14131426 STRCAT(default_path, default_name);
14141427 }
14151428
1416- /* TODO: add a filter? */
1429+ // TODO: add a filter?
14171430 PtFileSelection(
14181431 gui.vimWindow,
14191432 NULL,
@@ -1496,18 +1509,18 @@
14961509 int i, len;
14971510 int dialog_result = -1;
14981511
1499- /* FIXME: the vertical option in guioptions is blatantly ignored */
1500- /* FIXME: so is the type */
1512+ // FIXME: the vertical option in guioptions is blatantly ignored
1513+ // FIXME: so is the type
15011514
15021515 button_count = len = i = 0;
15031516
15041517 if (buttons == NULL || *buttons == NUL)
15051518 return -1;
15061519
1507- /* There is one less separator than buttons, so bump up the button count */
1520+ // There is one less separator than buttons, so bump up the button count
15081521 button_count = 1;
15091522
1510- /* Count string length and number of separators */
1523+ // Count string length and number of separators
15111524 for (str = buttons; *str; str++)
15121525 {
15131526 len++;
@@ -1550,8 +1563,8 @@
15501563 button_count, (const char **) button_array, NULL,
15511564 default_button, 0, Pt_MODAL);
15521565 #else
1553- /* Writing the dialog ourselves lets us add extra features, like
1554- * trapping the escape key and returning 0 to vim */
1566+ // Writing the dialog ourselves lets us add extra features, like
1567+ // trapping the escape key and returning 0 to vim
15551568 {
15561569 int n;
15571570 PtArg_t args[5];
@@ -1593,8 +1606,8 @@
15931606 di.buttons = (const char **) button_array;
15941607 di.nbtns = button_count;
15951608 di.def_btn = default_button;
1596- /* This is just to give the dialog the close button.
1597- * We check for the Escape key ourselves and return 0 */
1609+ // This is just to give the dialog the close button.
1610+ // We check for the Escape key ourselves and return 0
15981611 di.esc_btn = button_count;
15991612 di.callback = gui_ph_dialog_close;
16001613 di.data = &modal_ctrl;
@@ -1606,7 +1619,7 @@
16061619 if (gui_ph_dialog_text != NULL)
16071620 PtGiveFocus(gui_ph_dialog_text, NULL);
16081621
1609- /* Open dialog, block the vim window and wait for the dialog to close */
1622+ // Open dialog, block the vim window and wait for the dialog to close
16101623 PtRealizeWidget(dialog);
16111624 PtMakeModal(dialog, Ph_CURSOR_NOINPUT, Ph_CURSOR_DEFAULT_COLOR);
16121625 dialog_result = (int) PtModalBlock(&modal_ctrl, 0);
@@ -1623,8 +1636,8 @@
16231636 return dialog_result;
16241637 }
16251638 #endif
1626-/****************************************************************************/
1627-/* window size/position/state */
1639+////////////////////////////////////////////////////////////////////////////
1640+// window size/position/state
16281641
16291642 int
16301643 gui_mch_get_winpos(int *x, int *y)
@@ -1719,11 +1732,11 @@
17191732 gui_ph_pg_set_buffer_num(curwin->w_buffer->b_fnum);
17201733 #endif
17211734 PtSetResource(gui.vimWindow, Pt_ARG_WINDOW_TITLE, title, 0);
1722- /* Not sure what to do with the icon text, set balloon text somehow? */
1735+ // Not sure what to do with the icon text, set balloon text somehow?
17231736 }
17241737
1725-/****************************************************************************/
1726-/* Scrollbar */
1738+////////////////////////////////////////////////////////////////////////////
1739+// Scrollbar
17271740
17281741 void
17291742 gui_mch_set_scrollbar_thumb(scrollbar_T *sb, int val, int size, int max)
@@ -1749,7 +1762,7 @@
17491762 gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
17501763 {
17511764 int n = 0;
1752-/* int anchor_flags = 0;*/
1765+// int anchor_flags = 0;
17531766 PtArg_t args[4];
17541767
17551768 /*
@@ -1762,7 +1775,7 @@
17621775 Pt_DELAY_REALIZE | Pt_GETS_FOCUS);
17631776 PtSetArg(&args[ n++ ], Pt_ARG_SCROLLBAR_FLAGS, Pt_SCROLLBAR_SHOW_ARROWS, 0);
17641777 #if 0
1765- /* Don't need this anchoring for the scrollbars */
1778+ // Don't need this anchoring for the scrollbars
17661779 if (orient == SBAR_HORIZ)
17671780 {
17681781 anchor_flags = Pt_BOTTOM_ANCHORED_BOTTOM |
@@ -1808,35 +1821,35 @@
18081821 sb->id = NULL;
18091822 }
18101823
1811-/****************************************************************************/
1812-/* Mouse functions */
1824+////////////////////////////////////////////////////////////////////////////
1825+// Mouse functions
18131826
18141827 #if defined(FEAT_MOUSESHAPE) || defined(PROTO)
1815-/* The last set mouse pointer shape is remembered, to be used when it goes
1816- * from hidden to not hidden. */
1828+// The last set mouse pointer shape is remembered, to be used when it goes
1829+// from hidden to not hidden.
18171830 static int last_shape = 0;
18181831
1819-/* Table for shape IDs. Keep in sync with the mshape_names[] table in
1820- * misc2.c! */
1832+// Table for shape IDs. Keep in sync with the mshape_names[] table in
1833+// misc2.c!
18211834 static int mshape_ids[] =
18221835 {
1823- Ph_CURSOR_POINTER, /* arrow */
1824- Ph_CURSOR_NONE, /* blank */
1825- Ph_CURSOR_INSERT, /* beam */
1826- Ph_CURSOR_DRAG_VERTICAL, /* updown */
1827- Ph_CURSOR_DRAG_VERTICAL, /* udsizing */
1828- Ph_CURSOR_DRAG_HORIZONTAL, /* leftright */
1829- Ph_CURSOR_DRAG_HORIZONTAL, /* lrsizing */
1830- Ph_CURSOR_WAIT, /* busy */
1831- Ph_CURSOR_DONT, /* no */
1832- Ph_CURSOR_CROSSHAIR, /* crosshair */
1833- Ph_CURSOR_FINGER, /* hand1 */
1834- Ph_CURSOR_FINGER, /* hand2 */
1835- Ph_CURSOR_FINGER, /* pencil */
1836- Ph_CURSOR_QUESTION_POINT, /* question */
1837- Ph_CURSOR_POINTER, /* right-arrow */
1838- Ph_CURSOR_POINTER, /* up-arrow */
1839- Ph_CURSOR_POINTER /* last one */
1836+ Ph_CURSOR_POINTER, // arrow
1837+ Ph_CURSOR_NONE, // blank
1838+ Ph_CURSOR_INSERT, // beam
1839+ Ph_CURSOR_DRAG_VERTICAL, // updown
1840+ Ph_CURSOR_DRAG_VERTICAL, // udsizing
1841+ Ph_CURSOR_DRAG_HORIZONTAL, // leftright
1842+ Ph_CURSOR_DRAG_HORIZONTAL, // lrsizing
1843+ Ph_CURSOR_WAIT, // busy
1844+ Ph_CURSOR_DONT, // no
1845+ Ph_CURSOR_CROSSHAIR, // crosshair
1846+ Ph_CURSOR_FINGER, // hand1
1847+ Ph_CURSOR_FINGER, // hand2
1848+ Ph_CURSOR_FINGER, // pencil
1849+ Ph_CURSOR_QUESTION_POINT, // question
1850+ Ph_CURSOR_POINTER, // right-arrow
1851+ Ph_CURSOR_POINTER, // up-arrow
1852+ Ph_CURSOR_POINTER // last one
18401853 };
18411854
18421855 void
@@ -1890,8 +1903,8 @@
18901903 PhCursorInfo_t info;
18911904 short ix, iy;
18921905
1893- /* FIXME: does this return the correct position,
1894- * with respect to the border? */
1906+ // FIXME: does this return the correct position,
1907+ // with respect to the border?
18951908 PhQueryCursor(PhInputGroup(NULL), &info);
18961909 PtGetAbsPosition(gui.vimTextArea , &ix, &iy);
18971910
@@ -1905,12 +1918,12 @@
19051918 short abs_x, abs_y;
19061919
19071920 PtGetAbsPosition(gui.vimTextArea, &abs_x, &abs_y);
1908- /* Add the border offset? */
1921+ // Add the border offset?
19091922 PhMoveCursorAbs(PhInputGroup(NULL), abs_x + x, abs_y + y);
19101923 }
19111924
1912-/****************************************************************************/
1913-/* Colours */
1925+////////////////////////////////////////////////////////////////////////////
1926+// Colours
19141927
19151928 /*
19161929 * Return the RGB value of a pixel as a long.
@@ -1925,7 +1938,7 @@
19251938 void
19261939 gui_mch_new_colors(void)
19271940 {
1928-#if 0 /* Don't bother changing the cursor colour */
1941+#if 0 // Don't bother changing the cursor colour
19291942 short color_diff;
19301943
19311944 /*
@@ -1938,7 +1951,7 @@
19381951 if (abs(color_diff) < 64)
19391952 {
19401953 short r, g, b;
1941- /* not a great algorithm... */
1954+ // not a great algorithm...
19421955 r = PgRedValue(gui_ph_mouse_color) ^ 255;
19431956 g = PgGreenValue(gui_ph_mouse_color) ^ 255;
19441957 b = PgBlueValue(gui_ph_mouse_color) ^ 255;
@@ -1999,7 +2012,7 @@
19992012 rect.ul.x = FILL_X(col);
20002013 rect.ul.y = FILL_Y(row);
20012014
2002- /* FIXME: This has an off by one pixel problem */
2015+ // FIXME: This has an off by one pixel problem
20032016 rect.lr.x = rect.ul.x + nc * gui.char_width;
20042017 rect.lr.y = rect.ul.y + nr * gui.char_height;
20052018 if (nc > 0)
@@ -2132,7 +2145,7 @@
21322145 {
21332146 int src_taken, dst_made;
21342147
2135- /* Use a static buffer to avoid large amounts of de/allocations */
2148+ // Use a static buffer to avoid large amounts of de/allocations
21362149 if (utf8_len < len)
21372150 {
21382151 utf8_buffer = realloc(utf8_buffer, len * MB_LEN_MAX);
@@ -2155,12 +2168,12 @@
21552168
21562169 if (flags & DRAW_BOLD)
21572170 {
2158- /* FIXME: try and only calculate these values once... */
2171+ // FIXME: try and only calculate these values once...
21592172 rect.ul.x = FILL_X(col) + 1;
21602173 rect.ul.y = FILL_Y(row);
21612174 rect.lr.x = FILL_X(col + len) - 1;
21622175 rect.lr.y = FILL_Y(row + 1) - 1;
2163- /* PgSetUserClip(NULL) causes the scrollbar to not redraw... */
2176+ // PgSetUserClip(NULL) causes the scrollbar to not redraw...
21642177 #if 0
21652178 pos.x++;
21662179
@@ -2169,7 +2182,7 @@
21692182 PgSetUserClip(NULL);
21702183 #else
21712184 rect.lr.y -= (p_linespace + 1) / 2;
2172- /* XXX: DrawTextArea doesn't work with phditto */
2185+ // XXX: DrawTextArea doesn't work with phditto
21732186 PgDrawTextArea(s, len, &rect, Pg_TEXT_BOTTOM);
21742187 #endif
21752188 }
@@ -2180,15 +2193,15 @@
21802193 DRAW_END;
21812194 }
21822195
2183-/****************************************************************************/
2184-/* Cursor */
2196+////////////////////////////////////////////////////////////////////////////
2197+// Cursor
21852198
21862199 void
21872200 gui_mch_draw_hollow_cursor(guicolor_T color)
21882201 {
21892202 PhRect_t r;
21902203
2191- /* FIXME: Double width characters */
2204+ // FIXME: Double width characters
21922205
21932206 r.ul.x = FILL_X(gui.col);
21942207 r.ul.y = FILL_Y(gui.row);
@@ -2240,7 +2253,7 @@
22402253 void
22412254 gui_mch_start_blink(void)
22422255 {
2243- /* Only turn on the timer on if none of the times are zero */
2256+ // Only turn on the timer on if none of the times are zero
22442257 if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
22452258 {
22462259 PtSetResource(gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
@@ -2261,8 +2274,8 @@
22612274 blink_state = BLINK_NONE;
22622275 }
22632276
2264-/****************************************************************************/
2265-/* miscellaneous functions */
2277+////////////////////////////////////////////////////////////////////////////
2278+// miscellaneous functions
22662279
22672280 void
22682281 gui_mch_beep(void)
@@ -2311,8 +2324,8 @@
23112324 return FAIL;
23122325 }
23132326
2314-/****************************************************************************/
2315-/* Menu */
2327+////////////////////////////////////////////////////////////////////////////
2328+// Menu
23162329
23172330 #ifdef FEAT_TOOLBAR
23182331 #include "toolbar.phi"
@@ -2360,8 +2373,8 @@
23602373 temp_phi = PxLoadImage(iconfile, NULL);
23612374 if (temp_phi != NULL)
23622375 {
2363- /* The label widget will free the image/palette/etc. for us when
2364- * it's destroyed */
2376+ // The label widget will free the image/palette/etc. for us when
2377+ // it's destroyed
23652378 temp_phi->flags |= Ph_RELEASE_IMAGE_ALL;
23662379 memcpy(&external_icon, temp_phi, sizeof(external_icon));
23672380 free(temp_phi);
@@ -2387,10 +2400,10 @@
23872400 if (menu->icon_builtin == FALSE)
23882401 {
23892402 if (menu->iconfile != NULL)
2390- /* TODO: use gui_find_iconfile() */
2403+ // TODO: use gui_find_iconfile()
23912404 icon = gui_ph_toolbar_load_icon(menu->iconfile);
23922405
2393- /* TODO: Restrict loading to just .png? Search for any format? */
2406+ // TODO: Restrict loading to just .png? Search for any format?
23942407 if ((icon == NULL) &&
23952408 ((gui_find_bitmap(menu->name, full_pathname, "gif") == OK) ||
23962409 (gui_find_bitmap(menu->name, full_pathname, "png") == OK)))
@@ -2421,10 +2434,12 @@
24212434 void
24222435 gui_mch_set_menu_pos(int x, int y, int w, int h)
24232436 {
2424- /* Nothing */
2437+ // Nothing
24252438 }
24262439
2427-/* Change the position of a menu button in the parent */
2440+/*
2441+ * Change the position of a menu button in the parent
2442+ */
24282443 static void
24292444 gui_ph_position_menu(PtWidget_t *widget, int priority)
24302445 {
@@ -2433,9 +2448,9 @@
24332448
24342449 traverse = PtWidgetChildBack(PtWidgetParent(widget));
24352450
2436- /* Iterate through the list of widgets in traverse, until
2437- * we find the position we want to insert our widget into */
2438- /* TODO: traverse from front to back, possible speedup? */
2451+ // Iterate through the list of widgets in traverse, until
2452+ // we find the position we want to insert our widget into
2453+ // TODO: traverse from front to back, possible speedup?
24392454 while (traverse != NULL)
24402455 {
24412456 PtGetResource(traverse, Pt_ARG_POINTER, &menu, 0);
@@ -2444,7 +2459,7 @@
24442459 priority < menu->priority &&
24452460 widget != traverse)
24462461 {
2447- /* Insert the widget before the current traverse widget */
2462+ // Insert the widget before the current traverse widget
24482463 PtWidgetInsert(widget, traverse, 1);
24492464 return;
24502465 }
@@ -2453,7 +2468,9 @@
24532468 }
24542469 }
24552470
2456-/* the index is ignored because it's not useful for our purposes */
2471+/*
2472+ * the index is ignored because it's not useful for our purposes
2473+ */
24572474 void
24582475 gui_mch_add_menu(vimmenu_T *menu, int index)
24592476 {
@@ -2475,7 +2492,7 @@
24752492 mnemonic_str[1] = NUL;
24762493 }
24772494
2478- /* Create the menu button */
2495+ // Create the menu button
24792496 n = 0;
24802497 PtSetArg(&args[ n++ ], Pt_ARG_TEXT_STRING, menu->dname, 0);
24812498 PtSetArg(&args[ n++ ], Pt_ARG_ACCEL_TEXT, menu->actext, 0);
@@ -2492,7 +2509,7 @@
24922509
24932510 PtAddCallback(menu->id, Pt_CB_ARM, gui_ph_handle_pulldown_menu, menu);
24942511
2495- /* Create the actual menu */
2512+ // Create the actual menu
24962513 n = 0;
24972514 if (parent != NULL)
24982515 PtSetArg(&args[ n++ ], Pt_ARG_MENU_FLAGS, Pt_TRUE, Pt_MENU_CHILD);
@@ -2513,7 +2530,7 @@
25132530
25142531 gui_ph_position_menu(menu->id, menu->priority);
25152532
2516- /* Redraw menubar here instead of gui_mch_draw_menubar */
2533+ // Redraw menubar here instead of gui_mch_draw_menubar
25172534 if (gui.menu_is_active)
25182535 PtRealizeWidget(menu->id);
25192536 }
@@ -2583,7 +2600,7 @@
25832600
25842601 PtAddCallback(menu->id, Pt_CB_ACTIVATE, gui_ph_handle_menu, menu);
25852602 }
2586- /* Update toolbar if it's open */
2603+ // Update toolbar if it's open
25872604 if (PtWidgetIsRealized(gui.vimToolBar))
25882605 PtRealizeWidget(menu->id);
25892606 }
@@ -2669,16 +2686,15 @@
26692686 void
26702687 gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
26712688 {
2672- /* TODO: [un]realize the widget? */
2689+ // TODO: [un]realize the widget?
26732690 }
26742691
26752692 void
26762693 gui_mch_draw_menubar(void)
26772694 {
2678- /* The only time a redraw is needed is when a menu button
2679- * is added to the menubar, and that is detected and the bar
2680- * redrawn in gui_mch_add_menu_item
2681- */
2695+ // The only time a redraw is needed is when a menu button
2696+ // is added to the menubar, and that is detected and the bar
2697+ // redrawn in gui_mch_add_menu_item
26822698 }
26832699
26842700 void
@@ -2691,7 +2707,7 @@
26912707 void
26922708 gui_mch_toggle_tearoffs(int enable)
26932709 {
2694- /* No tearoffs yet */
2710+ // No tearoffs yet
26952711 }
26962712
26972713 #endif
@@ -2707,16 +2723,16 @@
27072723 }
27082724 #endif
27092725
2710-/****************************************************************************/
2711-/* Fonts */
2726+////////////////////////////////////////////////////////////////////////////
2727+// Fonts
27122728
27132729 static GuiFont
27142730 gui_ph_get_font(
27152731 char_u *font_name,
27162732 int_u font_flags,
27172733 int_u font_size,
2718- /* Check whether the resulting font has the font flags and size that
2719- * was asked for */
2734+ // Check whether the resulting font has the font flags and size that
2735+ // was asked for
27202736 int_u enforce
27212737 )
27222738 {
@@ -2730,7 +2746,7 @@
27302746 if (PfGenerateFontName(font_name, font_flags, font_size,
27312747 font_tag) != NULL)
27322748 {
2733- /* Enforce some limits on the font used */
2749+ // Enforce some limits on the font used
27342750 style = PHFONT_INFO_FIXED;
27352751
27362752 if (enforce & PF_STYLE_BOLD)
@@ -2745,8 +2761,8 @@
27452761 if (info.size == 0)
27462762 font_size = 0;
27472763
2748- /* Make sure font size matches, and that the font style
2749- * at least has the bits we're checking for */
2764+ // Make sure font size matches, and that the font style
2765+ // at least has the bits we're checking for
27502766 if (font_size == info.size &&
27512767 style == (info.style & style))
27522768 return (GuiFont)font_tag;
@@ -2799,7 +2815,7 @@
27992815
28002816 case 's':
28012817 size = getdigits(&mark);
2802- /* Restrict the size to some vague limits */
2818+ // Restrict the size to some vague limits
28032819 if (size < 1 || size > 100)
28042820 size = 8;
28052821
@@ -2829,7 +2845,7 @@
28292845
28302846 if (vim_font_name == NULL)
28312847 {
2832- /* Default font */
2848+ // Default font
28332849 vim_font_name = "PC Terminal";
28342850 }
28352851
@@ -2872,7 +2888,7 @@
28722888 gui.ital_font = gui_ph_get_font(font_name, font_flags | PF_STYLE_ITALIC,
28732889 font_size, PF_STYLE_ITALIC);
28742890
2875- /* This extent was brought to you by the letter 'g' */
2891+ // This extent was brought to you by the letter 'g'
28762892 PfExtentText(&extent, NULL, font_tag, "g", 1);
28772893
28782894 gui.char_width = extent.lr.x - extent.ul.x + 1;
diff -r 06ed2fe62dce -r e1f4e9d78a6a src/gui_w32.c
--- a/src/gui_w32.c Mon Dec 02 21:45:05 2019 +0100
+++ b/src/gui_w32.c Mon Dec 02 23:00:04 2019 +0100
@@ -58,7 +58,7 @@
5858 int dx_renmode = 0;
5959 int dx_taamode = 0;
6060
61- /* parse string as rendering options. */
61+ // parse string as rendering options.
6262 for (p = s; p != NULL && *p != NUL; )
6363 {
6464 char_u item[256];
@@ -119,16 +119,16 @@
119119 }
120120 else if (STRCMP(name, "scrlines") == 0)
121121 {
122- /* Deprecated. Simply ignore it. */
122+ // Deprecated. Simply ignore it.
123123 }
124124 else
125125 return FAIL;
126126 }
127127
128128 if (!gui.in_use)
129- return OK; /* only checking the syntax of the value */
130-
131- /* Enable DirectX/DirectWrite */
129+ return OK; // only checking the syntax of the value
130+
131+ // Enable DirectX/DirectWrite
132132 if (dx_enable)
133133 {
134134 if (!directx_enabled())
@@ -179,12 +179,12 @@
179179 #endif
180180
181181
182-#include "version.h" /* used by dialog box routine for default title */
182+#include "version.h" // used by dialog box routine for default title
183183 #ifdef DEBUG
184184 # include <tchar.h>
185185 #endif
186186
187-/* cproto fails on missing include files */
187+// cproto fails on missing include files
188188 #ifndef PROTO
189189
190190 # ifndef __MINGW32__
@@ -199,18 +199,18 @@
199199 # include "glbl_ime.h"
200200 # endif
201201
202-#endif /* PROTO */
202+#endif // PROTO
203203
204204 #ifdef FEAT_MENU
205-# define MENUHINTS /* show menu hints in command line */
206-#endif
207-
208-/* Some parameters for dialog boxes. All in pixels. */
205+# define MENUHINTS // show menu hints in command line
206+#endif
207+
208+// Some parameters for dialog boxes. All in pixels.
209209 #define DLG_PADDING_X 10
210210 #define DLG_PADDING_Y 10
211211 #define DLG_OLD_STYLE_PADDING_X 5
212212 #define DLG_OLD_STYLE_PADDING_Y 5
213-#define DLG_VERT_PADDING_X 4 /* For vertical buttons */
213+#define DLG_VERT_PADDING_X 4 // For vertical buttons
214214 #define DLG_VERT_PADDING_Y 4
215215 #define DLG_ICON_WIDTH 34
216216 #define DLG_ICON_HEIGHT 34
@@ -220,9 +220,9 @@
220220 #define DLG_MIN_MAX_WIDTH 400
221221 #define DLG_MIN_MAX_HEIGHT 400
222222
223-#define DLG_NONBUTTON_CONTROL 5000 /* First ID of non-button controls */
224-
225-#ifndef WM_XBUTTONDOWN /* For Win2K / winME ONLY */
223+#define DLG_NONBUTTON_CONTROL 5000 // First ID of non-button controls
224+
225+#ifndef WM_XBUTTONDOWN // For Win2K / winME ONLY
226226 # define WM_XBUTTONDOWN 0x020B
227227 # define WM_XBUTTONUP 0x020C
228228 # define WM_XBUTTONDBLCLK 0x020D
@@ -295,22 +295,22 @@
295295 static void fill_rect(const RECT *rcp, HBRUSH hbr, COLORREF color);
296296 static void clear_rect(RECT *rcp);
297297
298-static WORD s_dlgfntheight; /* height of the dialog font */
299-static WORD s_dlgfntwidth; /* width of the dialog font */
298+static WORD s_dlgfntheight; // height of the dialog font
299+static WORD s_dlgfntwidth; // width of the dialog font
300300
301301 #ifdef FEAT_MENU
302302 static HMENU s_menuBar = NULL;
303303 #endif
304304 #ifdef FEAT_TEAROFF
305305 static void rebuild_tearoff(vimmenu_T *menu);
306-static HBITMAP s_htearbitmap; /* bitmap used to indicate tearoff */
307-#endif
308-
309-/* Flag that is set while processing a message that must not be interrupted by
310- * processing another message. */
306+static HBITMAP s_htearbitmap; // bitmap used to indicate tearoff
307+#endif
308+
309+// Flag that is set while processing a message that must not be interrupted by
310+// processing another message.
311311 static int s_busy_processing = FALSE;
312312
313-static int destroying = FALSE; /* call DestroyWindow() ourselves */
313+static int destroying = FALSE; // call DestroyWindow() ourselves
314314
315315 #ifdef MSWIN_FIND_REPLACE
316316 static UINT s_findrep_msg = 0; // set in gui_w[16/32].c
@@ -344,15 +344,14 @@
344344 static HWND s_textArea = NULL;
345345 static UINT s_uMsg = 0;
346346
347-static char_u *s_textfield; /* Used by dialogs to pass back strings */
347+static char_u *s_textfield; // Used by dialogs to pass back strings
348348
349349 static int s_need_activate = FALSE;
350350
351-/* This variable is set when waiting for an event, which is the only moment
352- * scrollbar dragging can be done directly. It's not allowed while commands
353- * are executed, because it may move the cursor and that may cause unexpected
354- * problems (e.g., while ":s" is working).
355- */
351+// This variable is set when waiting for an event, which is the only moment
352+// scrollbar dragging can be done directly. It's not allowed while commands
353+// are executed, because it may move the cursor and that may cause unexpected
354+// problems (e.g., while ":s" is working).
356355 static int allow_scrollbar = FALSE;
357356
358357 #ifdef GLOBAL_IME
@@ -369,7 +368,7 @@
369368 return 1;
370369 else if (s_directx_load_attempted)
371370 return 0;
372- /* load DirectX */
371+ // load DirectX
373372 DWrite_Init();
374373 s_directx_load_attempted = 1;
375374 s_dwc = DWriteContext_Open();
@@ -389,10 +388,10 @@
389388 }
390389 #endif
391390
392-/* use of WindowProc depends on Global IME */
391+// use of WindowProc depends on Global IME
393392 #define MyWindowProc vim_WindowProc
394393
395-extern int current_font_height; /* this is in os_mswin.c */
394+extern int current_font_height; // this is in os_mswin.c
396395
397396 static struct
398397 {
@@ -430,11 +429,11 @@
430429
431430 {VK_F21, 'F', 'B'},
432431 #ifdef FEAT_NETBEANS_INTG
433- {VK_PAUSE, 'F', 'B'}, /* Pause == F21 (see gui_gtk_x11.c) */
432+ {VK_PAUSE, 'F', 'B'}, // Pause == F21 (see gui_gtk_x11.c)
434433 #endif
435434 {VK_F22, 'F', 'C'},
436435 {VK_F23, 'F', 'D'},
437- {VK_F24, 'F', 'E'}, /* winuser.h defines up to F24 */
436+ {VK_F24, 'F', 'E'}, // winuser.h defines up to F24
438437
439438 {VK_HELP, '%', '1'},
440439 {VK_BACK, 'k', 'b'},
@@ -449,7 +448,7 @@
449448 {VK_SUBTRACT, 'K', '7'},
450449 {VK_DIVIDE, 'K', '8'},
451450 {VK_MULTIPLY, 'K', '9'},
452- {VK_SEPARATOR, 'K', 'A'}, /* Keypad Enter */
451+ {VK_SEPARATOR, 'K', 'A'}, // Keypad Enter
453452 {VK_DECIMAL, 'K', 'B'},
454453
455454 {VK_NUMPAD0, 'K', 'C'},
@@ -463,22 +462,22 @@
463462 {VK_NUMPAD8, 'K', 'K'},
464463 {VK_NUMPAD9, 'K', 'L'},
465464
466- /* Keys that we want to be able to use any modifier with: */
465+ // Keys that we want to be able to use any modifier with:
467466 {VK_SPACE, ' ', NUL},
468467 {VK_TAB, TAB, NUL},
469468 {VK_ESCAPE, ESC, NUL},
470469 {NL, NL, NUL},
471470 {CAR, CAR, NUL},
472471
473- /* End of list marker: */
472+ // End of list marker:
474473 {0, 0, 0}
475474 };
476475
477-/* Local variables */
476+// Local variables
478477 static int s_button_pending = -1;
479478
480-/* s_getting_focus is set when we got focus but didn't see mouse-up event yet,
481- * so don't reset s_button_pending. */
479+// s_getting_focus is set when we got focus but didn't see mouse-up event yet,
480+// so don't reset s_button_pending.
482481 static int s_getting_focus = FALSE;
483482
484483 static int s_x_pending;
@@ -491,7 +490,7 @@
491490 // else a high surrogate
492491
493492 #ifdef FEAT_BEVAL_GUI
494-/* balloon-eval WM_NOTIFY_HANDLER */
493+// balloon-eval WM_NOTIFY_HANDLER
495494 static void Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh);
496495 static void TrackUserActivity(UINT uMsg);
497496 #endif
@@ -502,11 +501,11 @@
502501 * These LOGFONTW used for IME.
503502 */
504503 #if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
505-/* holds LOGFONTW for 'guifontwide' if available, otherwise 'guifont' */
504+// holds LOGFONTW for 'guifontwide' if available, otherwise 'guifont'
506505 static LOGFONTW norm_logfont;
507506 #endif
508507 #ifdef FEAT_MBYTE_IME
509-/* holds LOGFONTW for 'guifont' always. */
508+// holds LOGFONTW for 'guifont' always.
510509 static LOGFONTW sub_logfont;
511510 #endif
512511
@@ -590,7 +589,7 @@
590589
591590 KillTimer(NULL, idEvent);
592591
593- /* Eat spurious WM_TIMER messages */
592+ // Eat spurious WM_TIMER messages
594593 while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
595594 ;
596595
@@ -619,7 +618,7 @@
619618 if (blink_timer != 0)
620619 {
621620 KillTimer(NULL, blink_timer);
622- /* Eat spurious WM_TIMER messages */
621+ // Eat spurious WM_TIMER messages
623622 while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
624623 ;
625624 blink_timer = 0;
@@ -650,7 +649,7 @@
650649 {
651650 gui_mswin_rm_blink_timer();
652651
653- /* Only switch blinking on if none of the times is zero */
652+ // Only switch blinking on if none of the times is zero
654653 if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
655654 {
656655 blink_timer = (UINT)SetTimer(NULL, 0, (UINT)blink_waittime,
@@ -680,7 +679,7 @@
680679 KillTimer(NULL, idEvent);
681680 s_timed_out = TRUE;
682681
683- /* Eat spurious WM_TIMER messages */
682+ // Eat spurious WM_TIMER messages
684683 while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
685684 ;
686685 if (idEvent == s_wait_timer)
@@ -717,17 +716,17 @@
717716
718717 if (surrogate_pending_ch != 0)
719718 {
720- /* We don't guarantee ch is a low surrogate to match the high surrogate
721- * we already have; it should be, but if it isn't, tough luck. */
719+ // We don't guarantee ch is a low surrogate to match the high surrogate
720+ // we already have; it should be, but if it isn't, tough luck.
722721 wstring[0] = surrogate_pending_ch;
723722 wstring[1] = ch;
724723 surrogate_pending_ch = 0;
725724 len = 2;
726725 }
727- else if (ch >= 0xD800 && ch <= 0xDBFF) /* high surrogate */
728- {
729- /* We don't have the entire code point yet, only the first UTF-16 code
730- * unit; so just remember it and use it in the next call. */
726+ else if (ch >= 0xD800 && ch <= 0xDBFF) // high surrogate
727+ {
728+ // We don't have the entire code point yet, only the first UTF-16 code
729+ // unit; so just remember it and use it in the next call.
731730 surrogate_pending_ch = ch;
732731 return 0;
733732 }
@@ -737,23 +736,23 @@
737736 len = 1;
738737 }
739738
740- /* "ch" is a UTF-16 character. Convert it to a string of bytes. When
741- * "enc_codepage" is non-zero use the standard Win32 function,
742- * otherwise use our own conversion function (e.g., for UTF-8). */
739+ // "ch" is a UTF-16 character. Convert it to a string of bytes. When
740+ // "enc_codepage" is non-zero use the standard Win32 function,
741+ // otherwise use our own conversion function (e.g., for UTF-8).
743742 if (enc_codepage > 0)
744743 {
745744 len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
746745 (LPSTR)string, slen, 0, NULL);
747- /* If we had included the ALT key into the character but now the
748- * upper bit is no longer set, that probably means the conversion
749- * failed. Convert the original character and set the upper bit
750- * afterwards. */
746+ // If we had included the ALT key into the character but now the
747+ // upper bit is no longer set, that probably means the conversion
748+ // failed. Convert the original character and set the upper bit
749+ // afterwards.
751750 if (had_alt && len == 1 && ch >= 0x80 && string[0] < 0x80)
752751 {
753752 wstring[0] = ch & 0x7f;
754753 len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
755754 (LPSTR)string, slen, 0, NULL);
756- if (len == 1) /* safety check */
755+ if (len == 1) // safety check
757756 string[0] |= 0x80;
758757 }
759758 }
@@ -764,7 +763,7 @@
764763 len = 0;
765764 else
766765 {
767- if (len > slen) /* just in case */
766+ if (len > slen) // just in case
768767 len = slen;
769768 mch_memmove(string, ws, len);
770769 vim_free(ws);
@@ -780,7 +779,7 @@
780779 for (i = 0; i < len; ++i)
781780 if (string[i] == CSI && len <= slen - 2)
782781 {
783- /* Insert CSI as K_CSI. */
782+ // Insert CSI as K_CSI.
784783 mch_memmove(string + i + 3, string + i + 1, len - i - 1);
785784 string[++i] = KS_EXTRA;
786785 string[++i] = (int)KE_CSI;
@@ -823,20 +822,19 @@
823822 UINT cch,
824823 int cRepeat UNUSED)
825824 {
826- char_u string[40]; /* Enough for multibyte character */
825+ char_u string[40]; // Enough for multibyte character
827826 int len;
828827 int modifiers;
829- int ch = cch; /* special keys are negative */
828+ int ch = cch; // special keys are negative
830829
831830 dead_key = 0;
832831
833- /* TRACE("OnSysChar(%d, %c)\n", ch, ch); */
834-
835- /* OK, we have a character key (given by ch) which was entered with the
836- * ALT key pressed. Eg, if the user presses Alt-A, then ch == 'A'. Note
837- * that the system distinguishes Alt-a and Alt-A (Alt-Shift-a unless
838- * CAPSLOCK is pressed) at this point.
839- */
832+ // TRACE("OnSysChar(%d, %c)\n", ch, ch);
833+
834+ // OK, we have a character key (given by ch) which was entered with the
835+ // ALT key pressed. Eg, if the user presses Alt-A, then ch == 'A'. Note
836+ // that the system distinguishes Alt-a and Alt-A (Alt-Shift-a unless
837+ // CAPSLOCK is pressed) at this point.
840838 modifiers = MOD_MASK_ALT;
841839 if (GetKeyState(VK_SHIFT) & 0x8000)
842840 modifiers |= MOD_MASK_SHIFT;
@@ -844,12 +842,12 @@
844842 modifiers |= MOD_MASK_CTRL;
845843
846844 ch = simplify_key(ch, &modifiers);
847- /* remove the SHIFT modifier for keys where it's already included, e.g.,
848- * '(' and '*' */
845+ // remove the SHIFT modifier for keys where it's already included, e.g.,
846+ // '(' and '*'
849847 if (ch < 0x100 && !isalpha(ch) && isprint(ch))
850848 modifiers &= ~MOD_MASK_SHIFT;
851849
852- /* Interpret the ALT key as making the key META, include SHIFT, etc. */
850+ // Interpret the ALT key as making the key META, include SHIFT, etc.
853851 ch = extract_modifiers(ch, &modifiers, TRUE, NULL);
854852 if (ch == CSI)
855853 ch = K_CSI;
@@ -870,8 +868,8 @@
870868 }
871869 else
872870 {
873- /* Although the documentation isn't clear about it, we assume "ch" is
874- * a Unicode character. */
871+ // Although the documentation isn't clear about it, we assume "ch" is
872+ // a Unicode character.
875873 len += char_to_string(ch, string + len, 40 - len, TRUE);
876874 }
877875
@@ -914,7 +912,7 @@
914912 int button = -1;
915913 int repeated_click;
916914
917- /* Give main window the focus: this is so the cursor isn't hollow. */
915+ // Give main window the focus: this is so the cursor isn't hollow.
918916 (void)SetFocus(s_hwnd);
919917
920918 if (s_uMsg == WM_LBUTTONDOWN || s_uMsg == WM_LBUTTONDBLCLK)
@@ -932,8 +930,8 @@
932930 }
933931 else if (s_uMsg == WM_CAPTURECHANGED)
934932 {
935- /* on W95/NT4, somehow you get in here with an odd Msg
936- * if you press one button while holding down the other..*/
933+ // on W95/NT4, somehow you get in here with an odd Msg
934+ // if you press one button while holding down the other..
937935 if (s_button_pending == MOUSE_LEFT)
938936 button = MOUSE_RIGHT;
939937 else
@@ -970,7 +968,7 @@
970968 _OnMouseEvent(s_button_pending, x, y, FALSE, keyFlags);
971969 s_button_pending = -1;
972970 }
973- /* TRACE("Button down at x %d, y %d\n", x, y); */
971+ // TRACE("Button down at x %d, y %d\n", x, y);
974972 _OnMouseEvent(button, x, y, repeated_click, keyFlags);
975973 }
976974 else
@@ -1010,7 +1008,7 @@
10101008 s_getting_focus = FALSE;
10111009 if (s_button_pending > -1)
10121010 {
1013- /* Delayed action for mouse down event */
1011+ // Delayed action for mouse down event
10141012 _OnMouseEvent(s_button_pending, s_x_pending,
10151013 s_y_pending, FALSE, s_kFlags_pending);
10161014 s_button_pending = -1;
@@ -1034,13 +1032,13 @@
10341032 */
10351033 SetCapture(s_textArea);
10361034 button = MOUSE_DRAG;
1037- /* TRACE(" move at x %d, y %d\n", x, y); */
1035+ // TRACE(" move at x %d, y %d\n", x, y);
10381036 }
10391037 else
10401038 {
10411039 ReleaseCapture();
10421040 button = MOUSE_RELEASE;
1043- /* TRACE(" up at x %d, y %d\n", x, y); */
1041+ // TRACE(" up at x %d, y %d\n", x, y);
10441042 }
10451043
10461044 _OnMouseEvent(button, x, y, FALSE, keyFlags);
@@ -1114,23 +1112,23 @@
11141112 int down;
11151113
11161114 if (s_findrep_struct.Flags & FR_DIALOGTERM)
1117- /* Give main window the focus back. */
1115+ // Give main window the focus back.
11181116 (void)SetFocus(s_hwnd);
11191117
11201118 if (s_findrep_struct.Flags & FR_FINDNEXT)
11211119 {
11221120 flags = FRD_FINDNEXT;
11231121
1124- /* Give main window the focus back: this is so the cursor isn't
1125- * hollow. */
1122+ // Give main window the focus back: this is so the cursor isn't
1123+ // hollow.
11261124 (void)SetFocus(s_hwnd);
11271125 }
11281126 else if (s_findrep_struct.Flags & FR_REPLACE)
11291127 {
11301128 flags = FRD_REPLACE;
11311129
1132- /* Give main window the focus back: this is so the cursor isn't
1133- * hollow. */
1130+ // Give main window the focus back: this is so the cursor isn't
1131+ // hollow.
11341132 (void)SetFocus(s_hwnd);
11351133 }
11361134 else if (s_findrep_struct.Flags & FR_REPLACEALL)
@@ -1142,7 +1140,7 @@
11421140 {
11431141 char_u *p, *q;
11441142
1145- /* Call the generic GUI function to do the actual work. */
1143+ // Call the generic GUI function to do the actual work.
11461144 if (s_findrep_struct.Flags & FR_WHOLEWORD)
11471145 flags |= FRD_WHOLE_WORD;
11481146 if (s_findrep_struct.Flags & FR_MATCHCASE)
@@ -1163,7 +1161,7 @@
11631161 {
11641162 static LPARAM last_lParam = 0L;
11651163
1166- /* We sometimes get a mousemove when the mouse didn't move... */
1164+ // We sometimes get a mousemove when the mouse didn't move...
11671165 if (uMsg == WM_MOUSEMOVE || uMsg == WM_NCMOUSEMOVE)
11681166 {
11691167 if (lParam == last_lParam)
@@ -1171,10 +1169,9 @@
11711169 last_lParam = lParam;
11721170 }
11731171
1174- /* Handle specially, to centralise coding. We need to be sure we catch all
1175- * possible events which should cause us to restore the cursor (as it is a
1176- * shared resource, we take full responsibility for it).
1177- */
1172+ // Handle specially, to centralise coding. We need to be sure we catch all
1173+ // possible events which should cause us to restore the cursor (as it is a
1174+ // shared resource, we take full responsibility for it).
11781175 switch (uMsg)
11791176 {
11801177 case WM_KEYUP:
@@ -1186,9 +1183,9 @@
11861183 gui_mch_mousehide(TRUE);
11871184 break;
11881185
1189- case WM_SYSKEYUP: /* show the pointer when a system-key is pressed */
1186+ case WM_SYSKEYUP: // show the pointer when a system-key is pressed
11901187 case WM_SYSCHAR:
1191- case WM_MOUSEMOVE: /* show the pointer on any mouse action */
1188+ case WM_MOUSEMOVE: // show the pointer on any mouse action
11921189 case WM_LBUTTONDOWN:
11931190 case WM_LBUTTONUP:
11941191 case WM_MBUTTONDOWN:
@@ -1309,14 +1306,14 @@
13091306 int
13101307 gui_mch_open(void)
13111308 {
1312- /* Actually open the window, if not already visible
1313- * (may be done already in gui_mch_set_shellsize) */
1309+ // Actually open the window, if not already visible
1310+ // (may be done already in gui_mch_set_shellsize)
13141311 if (!IsWindowVisible(s_hwnd))
13151312 ShowWindow(s_hwnd, SW_SHOWDEFAULT);
13161313
13171314 #ifdef MSWIN_FIND_REPLACE
1318- /* Init replace string here, so that we keep it when re-opening the
1319- * dialog. */
1315+ // Init replace string here, so that we keep it when re-opening the
1316+ // dialog.
13201317 s_findrep_struct.lpstrReplaceWith[0] = NUL;
13211318 #endif
13221319
@@ -1375,9 +1372,9 @@
13751372 }
13761373 #endif
13771374
1378- /* When side scroll bar is unshown, the size of window will change.
1379- * then, the text area move left or right. thus client rect should be
1380- * forcedly redrawn. (Yasuhiro Matsumoto) */
1375+ // When side scroll bar is unshown, the size of window will change.
1376+ // then, the text area move left or right. thus client rect should be
1377+ // forcedly redrawn. (Yasuhiro Matsumoto)
13811378 if (oldx != x || oldy != y)
13821379 {
13831380 InvalidateRect(s_hwnd, NULL, FALSE);
@@ -1398,9 +1395,9 @@
13981395 {
13991396 ShowScrollBar(sb->id, SB_CTL, flag);
14001397
1401- /* TODO: When the window is maximized, the size of the window stays the
1402- * same, thus the size of the text area changes. On Win98 it's OK, on Win
1403- * NT 4.0 it's not... */
1398+ // TODO: When the window is maximized, the size of the window stays the
1399+ // same, thus the size of the text area changes. On Win98 it's OK, on Win
1400+ // NT 4.0 it's not...
14041401 }
14051402
14061403 void
@@ -1418,13 +1415,13 @@
14181415 void
14191416 gui_mch_create_scrollbar(
14201417 scrollbar_T *sb,
1421- int orient) /* SBAR_VERT or SBAR_HORIZ */
1418+ int orient) // SBAR_VERT or SBAR_HORIZ
14221419 {
14231420 sb->id = CreateWindow(
14241421 "SCROLLBAR", "Scrollbar",
14251422 WS_CHILD | ((orient == SBAR_VERT) ? SBS_VERT : SBS_HORZ), 0, 0,
1426- 10, /* Any value will do for now */
1427- 10, /* Any value will do for now */
1423+ 10, // Any value will do for now
1424+ 10, // Any value will do for now
14281425 s_hwnd, NULL,
14291426 g_hinst, NULL);
14301427 }
@@ -1491,7 +1488,7 @@
14911488 {
14921489 HFONT font = NULL;
14931490
1494- /* Load the font */
1491+ // Load the font
14951492 font = CreateFontIndirectW(lf);
14961493
14971494 if (font == NULL)
@@ -1722,7 +1719,7 @@
17221719 */
17231720 rc.left =
17241721 #ifdef FEAT_RIGHTLEFT
1725- /* vertical line should be on the right of current point */
1722+ // vertical line should be on the right of current point
17261723 CURSOR_BAR_RIGHT ? FILL_X(gui.col + 1) - w :
17271724 #endif
17281725 FILL_X(gui.col);
@@ -1748,14 +1745,14 @@
17481745
17491746 dead_key = 0;
17501747
1751- /* Make Windows generate the dead key's character */
1748+ // Make Windows generate the dead key's character
17521749 deadCharExpel.message = originalMsg.message;
17531750 deadCharExpel.hwnd = originalMsg.hwnd;
17541751 deadCharExpel.wParam = VK_SPACE;
17551752
17561753 MyTranslateMessage(&deadCharExpel);
17571754
1758- /* re-generate the current character free of the dead char influence */
1755+ // re-generate the current character free of the dead char influence
17591756 PostMessage(originalMsg.hwnd, originalMsg.message, originalMsg.wParam,
17601757 originalMsg.lParam);
17611758 }
@@ -1769,7 +1766,7 @@
17691766 process_message(void)
17701767 {
17711768 MSG msg;
1772- UINT vk = 0; /* Virtual key */
1769+ UINT vk = 0; // Virtual key
17731770 char_u string[40];
17741771 int i;
17751772 int modifiers = 0;
@@ -1781,27 +1778,27 @@
17811778 pGetMessage(&msg, NULL, 0, 0);
17821779
17831780 #ifdef FEAT_OLE
1784- /* Look after OLE Automation commands */
1781+ // Look after OLE Automation commands
17851782 if (msg.message == WM_OLE)
17861783 {
17871784 char_u *str = (char_u *)msg.lParam;
17881785 if (str == NULL || *str == NUL)
17891786 {
1790- /* Message can't be ours, forward it. Fixes problem with Ultramon
1791- * 3.0.4 */
1787+ // Message can't be ours, forward it. Fixes problem with Ultramon
1788+ // 3.0.4
17921789 pDispatchMessage(&msg);
17931790 }
17941791 else
17951792 {
17961793 add_to_input_buf(str, (int)STRLEN(str));
1797- vim_free(str); /* was allocated in CVim::SendKeys() */
1794+ vim_free(str); // was allocated in CVim::SendKeys()
17981795 }
17991796 return;
18001797 }
18011798 #endif
18021799
18031800 #ifdef MSWIN_FIND_REPLACE
1804- /* Don't process messages used by the dialog */
1801+ // Don't process messages used by the dialog
18051802 if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg))
18061803 {
18071804 HandleMouseHide(msg.message, msg.lParam);
@@ -1851,8 +1848,8 @@
18511848 MyTranslateMessage(&msg);
18521849 return;
18531850 }
1854- /* In modes where we are not typing, dead keys should behave
1855- * normally */
1851+ // In modes where we are not typing, dead keys should behave
1852+ // normally
18561853 else if (!(get_real_state() & (INSERT | CMDLINE | SELECTMODE)))
18571854 {
18581855 outputDeadKey_rePost(msg);
@@ -1860,7 +1857,7 @@
18601857 }
18611858 }
18621859
1863- /* Check for CTRL-BREAK */
1860+ // Check for CTRL-BREAK
18641861 if (vk == VK_CANCEL)
18651862 {
18661863 trash_input_buf();
@@ -1872,7 +1869,7 @@
18721869
18731870 for (i = 0; special_keys[i].key_sym != 0; i++)
18741871 {
1875- /* ignore VK_SPACE when ALT key pressed: system menu */
1872+ // ignore VK_SPACE when ALT key pressed: system menu
18761873 if (special_keys[i].key_sym == vk
18771874 && (vk != VK_SPACE || !(GetKeyState(VK_MENU) & 0x8000)))
18781875 {
@@ -1890,8 +1887,8 @@
18901887 }
18911888
18921889 #ifdef FEAT_MENU
1893- /* Check for <F10>: Windows selects the menu. When <F10> is
1894- * mapped we want to use the mapping instead. */
1890+ // Check for <F10>: Windows selects the menu. When <F10> is
1891+ // mapped we want to use the mapping instead.
18951892 if (vk == VK_F10
18961893 && gui.menu_is_active
18971894 && check_map(k10, State, FALSE, TRUE, FALSE,
@@ -1942,7 +1939,7 @@
19421939 {
19431940 int len;
19441941
1945- /* Handle "key" as a Unicode character. */
1942+ // Handle "key" as a Unicode character.
19461943 len = char_to_string(key, string, 40, FALSE);
19471944 add_to_input_buf(string, len);
19481945 }
@@ -1951,27 +1948,27 @@
19511948 }
19521949 if (special_keys[i].key_sym == 0)
19531950 {
1954- /* Some keys need C-S- where they should only need C-.
1955- * Ignore 0xff, Windows XP sends it when NUMLOCK has changed since
1956- * system startup (Helmut Stiegler, 2003 Oct 3). */
1951+ // Some keys need C-S- where they should only need C-.
1952+ // Ignore 0xff, Windows XP sends it when NUMLOCK has changed since
1953+ // system startup (Helmut Stiegler, 2003 Oct 3).
19571954 if (vk != 0xff
19581955 && (GetKeyState(VK_CONTROL) & 0x8000)
19591956 && !(GetKeyState(VK_SHIFT) & 0x8000)
19601957 && !(GetKeyState(VK_MENU) & 0x8000))
19611958 {
1962- /* CTRL-6 is '^'; Japanese keyboard maps '^' to vk == 0xDE */
1959+ // CTRL-6 is '^'; Japanese keyboard maps '^' to vk == 0xDE
19631960 if (vk == '6' || MapVirtualKey(vk, 2) == (UINT)'^')
19641961 {
19651962 string[0] = Ctrl_HAT;
19661963 add_to_input_buf(string, 1);
19671964 }
1968- /* vk == 0xBD AZERTY for CTRL-'-', but CTRL-[ for * QWERTY! */
1969- else if (vk == 0xBD) /* QWERTY for CTRL-'-' */
1965+ // vk == 0xBD AZERTY for CTRL-'-', but CTRL-[ for * QWERTY!
1966+ else if (vk == 0xBD) // QWERTY for CTRL-'-'
19701967 {
19711968 string[0] = Ctrl__;
19721969 add_to_input_buf(string, 1);
19731970 }
1974- /* CTRL-2 is '@'; Japanese keyboard maps '@' to vk == 0xC0 */
1971+ // CTRL-2 is '@'; Japanese keyboard maps '@' to vk == 0xC0
19751972 else if (vk == '2' || MapVirtualKey(vk, 2) == (UINT)'@')
19761973 {
19771974 string[0] = Ctrl_AT;
@@ -1988,11 +1985,11 @@
19881985 else if (msg.message == WM_IME_NOTIFY)
19891986 _OnImeNotify(msg.hwnd, (DWORD)msg.wParam, (DWORD)msg.lParam);
19901987 else if (msg.message == WM_KEYUP && im_get_status())
1991- /* added for non-MS IME (Yasuhiro Matsumoto) */
1988+ // added for non-MS IME (Yasuhiro Matsumoto)
19921989 MyTranslateMessage(&msg);
19931990 #endif
19941991 #if !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
1995-/* GIME_TEST */
1992+// GIME_TEST
19961993 else if (msg.message == WM_IME_STARTCOMPOSITION)
19971994 {
19981995 POINT point;
@@ -2006,9 +2003,9 @@
20062003 #endif
20072004
20082005 #ifdef FEAT_MENU
2009- /* Check for <F10>: Default effect is to select the menu. When <F10> is
2010- * mapped we need to stop it here to avoid strange effects (e.g., for the
2011- * key-up event) */
2006+ // Check for <F10>: Default effect is to select the menu. When <F10> is
2007+ // mapped we need to stop it here to avoid strange effects (e.g., for the
2008+ // key-up event)
20122009 if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
20132010 NULL, NULL) == NULL)
20142011 #endif
@@ -2041,7 +2038,7 @@
20412038 {
20422039 KillTimer(NULL, s_wait_timer);
20432040
2044- /* Eat spurious WM_TIMER messages */
2041+ // Eat spurious WM_TIMER messages
20452042 while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
20462043 ;
20472044 s_wait_timer = 0;
@@ -2213,7 +2210,7 @@
22132210 int w UNUSED,
22142211 int h UNUSED)
22152212 {
2216- /* It will be in the right place anyway */
2213+ // It will be in the right place anyway
22172214 }
22182215
22192216 #if defined(FEAT_MENU) || defined(PROTO)
@@ -2245,7 +2242,7 @@
22452242 {
22462243 DrawMenuBar(s_hwnd);
22472244 }
2248-#endif /*FEAT_MENU*/
2245+#endif // FEAT_MENU
22492246
22502247 /*
22512248 * Return the RGB value of a pixel as a long.
@@ -2258,21 +2255,27 @@
22582255 }
22592256
22602257 #if defined(FEAT_GUI_DIALOG) || defined(PROTO)
2261-/* Convert pixels in X to dialog units */
2258+/*
2259+ * Convert pixels in X to dialog units
2260+ */
22622261 static WORD
22632262 PixelToDialogX(int numPixels)
22642263 {
22652264 return (WORD)((numPixels * 4) / s_dlgfntwidth);
22662265 }
22672266
2268-/* Convert pixels in Y to dialog units */
2267+/*
2268+ * Convert pixels in Y to dialog units
2269+ */
22692270 static WORD
22702271 PixelToDialogY(int numPixels)
22712272 {
22722273 return (WORD)((numPixels * 8) / s_dlgfntheight);
22732274 }
22742275
2275-/* Return the width in pixels of the given text in the given DC. */
2276+/*
2277+ * Return the width in pixels of the given text in the given DC.
2278+ */
22762279 static int
22772280 GetTextWidth(HDC hdc, char_u *str, int len)
22782281 {
@@ -2328,7 +2331,7 @@
23282331 wChild = rChild.right - rChild.left;
23292332 hChild = rChild.bottom - rChild.top;
23302333
2331- /* If Vim is minimized put the window in the middle of the screen. */
2334+ // If Vim is minimized put the window in the middle of the screen.
23322335 if (hwndParent == NULL || IsMinimized(hwndParent))
23332336 get_work_area(&rParent);
23342337 else
@@ -2367,7 +2370,7 @@
23672370 return SetWindowPos(hwndChild, NULL, xNew, yNew, 0, 0,
23682371 SWP_NOSIZE | SWP_NOZORDER);
23692372 }
2370-#endif /* FEAT_GUI_DIALOG */
2373+#endif // FEAT_GUI_DIALOG
23712374
23722375 #if defined(FEAT_TOOLBAR) || defined(PROTO)
23732376 void
@@ -2391,7 +2394,7 @@
23912394 ShowWindow(s_toolbarhwnd, SW_HIDE);
23922395 }
23932396
2394-/* The number of bitmaps is fixed. Exit is missing! */
2397+// The number of bitmaps is fixed. Exit is missing!
23952398 # define TOOLBAR_BITMAP_COUNT 31
23962399
23972400 #endif
@@ -2424,7 +2427,7 @@
24242427 long rval;
24252428 POINT pt;
24262429
2427- /* When ignoring events don't show the menu. */
2430+ // When ignoring events don't show the menu.
24282431 if (hold_gui_events
24292432 # ifdef FEAT_CMDWIN
24302433 || cmdwin_type != 0
@@ -2450,7 +2453,7 @@
24502453
24512454 DestroyMenu(tab_pmenu);
24522455
2453- /* Add the string cmd into input buffer */
2456+ // Add the string cmd into input buffer
24542457 if (rval > 0)
24552458 {
24562459 TCHITTESTINFO htinfo;
@@ -2516,7 +2519,7 @@
25162519 return;
25172520
25182521 # ifndef CCM_SETUNICODEFORMAT
2519- /* For older compilers. We assume this never changes. */
2522+ // For older compilers. We assume this never changes.
25202523 # define CCM_SETUNICODEFORMAT 0x2005
25212524 # endif
25222525 // Enable unicode support
@@ -2525,10 +2528,10 @@
25252528 tie.mask = TCIF_TEXT;
25262529 tie.iImage = -1;
25272530
2528- /* Disable redraw for tab updates to eliminate O(N^2) draws. */
2531+ // Disable redraw for tab updates to eliminate O(N^2) draws.
25292532 SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)FALSE, 0);
25302533
2531- /* Add a label for each tab page. They all contain the same text area. */
2534+ // Add a label for each tab page. They all contain the same text area.
25322535 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr)
25332536 {
25342537 if (tp == curtab)
@@ -2536,7 +2539,7 @@
25362539
25372540 if (nr >= TabCtrl_GetItemCount(s_tabhwnd))
25382541 {
2539- /* Add the tab */
2542+ // Add the tab
25402543 tie.pszText = "-Empty-";
25412544 TabCtrl_InsertItem(s_tabhwnd, nr, &tie);
25422545 tabadded = 1;
@@ -2558,14 +2561,14 @@
25582561 }
25592562 }
25602563
2561- /* Remove any old labels. */
2564+ // Remove any old labels.
25622565 while (nr < TabCtrl_GetItemCount(s_tabhwnd))
25632566 TabCtrl_DeleteItem(s_tabhwnd, nr);
25642567
25652568 if (!tabadded && TabCtrl_GetCurSel(s_tabhwnd) != curtabidx)
25662569 TabCtrl_SetCurSel(s_tabhwnd, curtabidx);
25672570
2568- /* Re-enable redraw and redraw. */
2571+ // Re-enable redraw and redraw.
25692572 SendMessage(s_tabhwnd, WM_SETREDRAW, (WPARAM)TRUE, 0);
25702573 RedrawWindow(s_tabhwnd, NULL, NULL,
25712574 RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
@@ -2603,15 +2606,15 @@
26032606 while (*keys)
26042607 {
26052608 if (*keys == '~')
2606- *keys = ' '; /* for showing system menu */
2609+ *keys = ' '; // for showing system menu
26072610 PostMessage(s_hwnd, WM_CHAR, (WPARAM)*keys, (LPARAM)0);
26082611 keys++;
26092612 fill_typebuf = TRUE;
26102613 }
26112614 if (fill_typebuf)
26122615 {
2613- /* Put a NOP in the typeahead buffer so that the message will get
2614- * processed. */
2616+ // Put a NOP in the typeahead buffer so that the message will get
2617+ // processed.
26152618 key_name[0] = K_SPECIAL;
26162619 key_name[1] = KS_EXTRA;
26172620 key_name[2] = KE_NOP;
@@ -2636,7 +2639,7 @@
26362639 int mcase = !p_ic;
26372640 char_u *entry_text;
26382641
2639- /* Get the search string to use. */
2642+ // Get the search string to use.
26402643 entry_text = get_find_dialog_text(initial_string, &wword, &mcase);
26412644
26422645 s_findrep_struct.hwndOwner = s_hwnd;
@@ -2668,7 +2671,7 @@
26682671 {
26692672 WCHAR *wbuf;
26702673
2671- /* Convert the title from 'encoding' to UTF-16. */
2674+ // Convert the title from 'encoding' to UTF-16.
26722675 wbuf = (WCHAR *)enc_to_utf16((char_u *)title, NULL);
26732676 if (wbuf != NULL)
26742677 {
@@ -2745,14 +2748,14 @@
27452748 static void
27462749 gui_mch_show_popupmenu_at(vimmenu_T *menu, int x, int y)
27472750 {
2748- /* Unhide the mouse, we don't get move events here. */
2751+ // Unhide the mouse, we don't get move events here.
27492752 gui_mch_mousehide(FALSE);
27502753
27512754 (void)TrackPopupMenu(
27522755 (HMENU)menu->submenu_id,
27532756 TPM_LEFTALIGN | TPM_LEFTBUTTON,
27542757 x, y,
2755- (int)0, /*reserved param*/
2758+ (int)0, //reserved param
27562759 s_hwnd,
27572760 NULL);
27582761 /*
@@ -2799,11 +2802,11 @@
27992802 {
28002803 PAINTSTRUCT ps;
28012804
2802- out_flush(); /* make sure all output has been processed */
2805+ out_flush(); // make sure all output has been processed
28032806 (void)BeginPaint(hwnd, &ps);
28042807
2805- /* prevent multi-byte characters from misprinting on an invalid
2806- * rectangle */
2808+ // prevent multi-byte characters from misprinting on an invalid
2809+ // rectangle
28072810 if (has_mbyte)
28082811 {
28092812 RECT rect;
@@ -2836,7 +2839,7 @@
28362839 gui_resize_shell(cx, cy);
28372840
28382841 #ifdef FEAT_MENU
2839- /* Menu bar may wrap differently now */
2842+ // Menu bar may wrap differently now
28402843 gui_mswin_get_menu_height(TRUE);
28412844 #endif
28422845 }
@@ -2871,8 +2874,8 @@
28712874 BOOL fActivate,
28722875 DWORD dwThreadId)
28732876 {
2874- /* we call gui_focus_change() in _OnSetFocus() */
2875- /* gui_focus_change((int)fActivate); */
2877+ // we call gui_focus_change() in _OnSetFocus()
2878+ // gui_focus_change((int)fActivate);
28762879 return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
28772880 }
28782881
@@ -2954,9 +2957,9 @@
29542957 rc.right = gui.num_cols * gui.char_width;
29552958 rc.bottom = gui.num_rows * gui.char_height;
29562959 InvertRect(s_hdc, &rc);
2957- gui_mch_flush(); /* make sure it's displayed */
2958-
2959- ui_delay((long)msec, TRUE); /* wait for a few msec */
2960+ gui_mch_flush(); // make sure it's displayed
2961+
2962+ ui_delay((long)msec, TRUE); // wait for a few msec
29602963
29612964 InvertRect(s_hdc, &rc);
29622965 }
@@ -2974,13 +2977,13 @@
29742977
29752978 GetWindowRect(s_hwnd, &rcVim);
29762979
2977- /* Check if the window is partly above or below the screen. We don't care
2978- * about partly left or right of the screen, it is not relevant when
2979- * scrolling up or down. */
2980+ // Check if the window is partly above or below the screen. We don't care
2981+ // about partly left or right of the screen, it is not relevant when
2982+ // scrolling up or down.
29802983 if (rcVim.top < 0 || rcVim.bottom > GetSystemMetrics(SM_CYFULLSCREEN))
29812984 return SW_INVALIDATE;
29822985
2983- /* Check if there is an window (partly) on top of us. */
2986+ // Check if there is an window (partly) on top of us.
29842987 for (hwnd = s_hwnd; (hwnd = GetWindow(hwnd, GW_HWNDPREV)) != (HWND)0; )
29852988 if (IsWindowVisible(hwnd))
29862989 {
@@ -3036,11 +3039,11 @@
30363039 UpdateWindow(s_textArea);
30373040 }
30383041
3039- /* This seems to be required to avoid the cursor disappearing when
3040- * scrolling such that the cursor ends up in the top-left character on
3041- * the screen... But why? (Webb) */
3042- /* It's probably fixed by disabling drawing the cursor while scrolling. */
3043- /* gui.cursor_is_valid = FALSE; */
3042+ // This seems to be required to avoid the cursor disappearing when
3043+ // scrolling such that the cursor ends up in the top-left character on
3044+ // the screen... But why? (Webb)
3045+ // It's probably fixed by disabling drawing the cursor while scrolling.
3046+ // gui.cursor_is_valid = FALSE;
30443047
30453048 gui_clear_block(gui.scroll_region_bot - num_lines + 1,
30463049 gui.scroll_region_left,
@@ -3073,8 +3076,8 @@
30733076 #endif
30743077 {
30753078 intel_gpu_workaround();
3076- /* The SW_INVALIDATE is required when part of the window is covered or
3077- * off-screen. How do we avoid it when it's not needed? */
3079+ // The SW_INVALIDATE is required when part of the window is covered or
3080+ // off-screen. How do we avoid it when it's not needed?
30783081 ScrollWindowEx(s_textArea, 0, num_lines * gui.char_height,
30793082 &rc, &rc, NULL, NULL, get_scroll_flags());
30803083 UpdateWindow(s_textArea);
@@ -3098,14 +3101,14 @@
30983101 DeleteObject(s_brush);
30993102
31003103 #ifdef FEAT_TEAROFF
3101- /* Unload the tearoff bitmap */
3104+ // Unload the tearoff bitmap
31023105 (void)DeleteObject((HGDIOBJ)s_htearbitmap);
31033106 #endif
31043107
3105- /* Destroy our window (if we have one). */
3108+ // Destroy our window (if we have one).
31063109 if (s_hwnd != NULL)
31073110 {
3108- destroying = TRUE; /* ignore WM_DESTROY message now */
3111+ destroying = TRUE; // ignore WM_DESTROY message now
31093112 DestroyWindow(s_hwnd);
31103113 }
31113114
@@ -3246,7 +3249,7 @@
32463249 GuiFont font = NOFONT;
32473250 char_u *p;
32483251
3249- /* Load the font */
3252+ // Load the font
32503253 if (get_logfont(&lf, font_name, NULL, TRUE) == OK)
32513254 font = get_font_handle(&lf);
32523255 if (font == NOFONT)
@@ -3273,8 +3276,8 @@
32733276 {
32743277 hl_set_font_name(p);
32753278
3276- /* When setting 'guifont' to "*" replace it with the actual font name.
3277- * */
3279+ // When setting 'guifont' to "*" replace it with the actual font name.
3280+ //
32783281 if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
32793282 {
32803283 vim_free(p_guifont);
@@ -3312,7 +3315,7 @@
33123315 }
33133316
33143317 #ifndef WPF_RESTORETOMAXIMIZED
3315-# define WPF_RESTORETOMAXIMIZED 2 /* just in case someone doesn't have it */
3318+# define WPF_RESTORETOMAXIMIZED 2 // just in case someone doesn't have it
33163319 #endif
33173320
33183321 /*
@@ -3359,7 +3362,7 @@
33593362 }
33603363 else
33613364 {
3362- /* Inside another window, don't use the frame and border. */
3365+ // Inside another window, don't use the frame and border.
33633366 gui_resize_shell(rect.right - rect.left,
33643367 rect.bottom - rect.top
33653368 #ifdef FEAT_MENU
@@ -3381,27 +3384,27 @@
33813384 }
33823385
33833386 #if defined(FEAT_MOUSESHAPE) || defined(PROTO)
3384-/* Table for shape IDCs. Keep in sync with the mshape_names[] table in
3385- * misc2.c! */
3387+// Table for shape IDCs. Keep in sync with the mshape_names[] table in
3388+// misc2.c!
33863389 static LPCSTR mshape_idcs[] =
33873390 {
3388- IDC_ARROW, /* arrow */
3389- MAKEINTRESOURCE(0), /* blank */
3390- IDC_IBEAM, /* beam */
3391- IDC_SIZENS, /* updown */
3392- IDC_SIZENS, /* udsizing */
3393- IDC_SIZEWE, /* leftright */
3394- IDC_SIZEWE, /* lrsizing */
3395- IDC_WAIT, /* busy */
3396- IDC_NO, /* no */
3397- IDC_ARROW, /* crosshair */
3398- IDC_ARROW, /* hand1 */
3399- IDC_ARROW, /* hand2 */
3400- IDC_ARROW, /* pencil */
3401- IDC_ARROW, /* question */
3402- IDC_ARROW, /* right-arrow */
3403- IDC_UPARROW, /* up-arrow */
3404- IDC_ARROW /* last one */
3391+ IDC_ARROW, // arrow
3392+ MAKEINTRESOURCE(0), // blank
3393+ IDC_IBEAM, // beam
3394+ IDC_SIZENS, // updown
3395+ IDC_SIZENS, // udsizing
3396+ IDC_SIZEWE, // leftright
3397+ IDC_SIZEWE, // lrsizing
3398+ IDC_WAIT, // busy
3399+ IDC_NO, // no
3400+ IDC_ARROW, // crosshair
3401+ IDC_ARROW, // hand1
3402+ IDC_ARROW, // hand2
3403+ IDC_ARROW, // pencil
3404+ IDC_ARROW, // question
3405+ IDC_ARROW, // right-arrow
3406+ IDC_UPARROW, // up-arrow
3407+ IDC_ARROW // last one
34053408 };
34063409
34073410 void
@@ -3422,7 +3425,7 @@
34223425 {
34233426 POINT mp;
34243427
3425- /* Set the position to make it redrawn with the new shape. */
3428+ // Set the position to make it redrawn with the new shape.
34263429 (void)GetCursorPos((LPPOINT)&mp);
34273430 (void)SetCursorPos(mp.x, mp.y);
34283431 ShowCursor(TRUE);
@@ -3470,8 +3473,8 @@
34703473 char_u *initdir,
34713474 char_u *filter)
34723475 {
3473- /* We always use the wide function. This means enc_to_utf16() must work,
3474- * otherwise it fails miserably! */
3476+ // We always use the wide function. This means enc_to_utf16() must work,
3477+ // otherwise it fails miserably!
34753478 OPENFILENAMEW fileStruct;
34763479 WCHAR fileBuf[MAXPATHL];
34773480 WCHAR *wp;
@@ -3498,12 +3501,12 @@
34983501 }
34993502 }
35003503
3501- /* Convert the filter to Windows format. */
3504+ // Convert the filter to Windows format.
35023505 filterp = convert_filterW(filter);
35033506
35043507 vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW));
35053508 # ifdef OPENFILENAME_SIZE_VERSION_400W
3506- /* be compatible with Windows NT 4.0 */
3509+ // be compatible with Windows NT 4.0
35073510 fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W;
35083511 # else
35093512 fileStruct.lStructSize = sizeof(fileStruct);
@@ -3520,11 +3523,11 @@
35203523 fileStruct.lpstrFile = fileBuf;
35213524 fileStruct.nMaxFile = MAXPATHL;
35223525 fileStruct.lpstrFilter = filterp;
3523- fileStruct.hwndOwner = s_hwnd; /* main Vim window is owner*/
3524- /* has an initial dir been specified? */
3526+ fileStruct.hwndOwner = s_hwnd; // main Vim window is owner
3527+ // has an initial dir been specified?
35253528 if (initdir != NULL && *initdir != NUL)
35263529 {
3527- /* Must have backslashes here, no matter what 'shellslash' says */
3530+ // Must have backslashes here, no matter what 'shellslash' says
35283531 initdirp = enc_to_utf16(initdir, NULL);
35293532 if (initdirp != NULL)
35303533 {
@@ -3564,15 +3567,15 @@
35643567 vim_free(titlep);
35653568 vim_free(extp);
35663569
3567- /* Convert from UCS2 to 'encoding'. */
3570+ // Convert from UCS2 to 'encoding'.
35683571 p = utf16_to_enc(fileBuf, NULL);
35693572 if (p == NULL)
35703573 return NULL;
35713574
3572- /* Give focus back to main window (when using MDI). */
3575+ // Give focus back to main window (when using MDI).
35733576 SetFocus(s_hwnd);
35743577
3575- /* Shorten the file name if possible */
3578+ // Shorten the file name if possible
35763579 q = vim_strsave(shorten_fname1(p));
35773580 vim_free(p);
35783581 return q;
@@ -3602,7 +3605,7 @@
36023605 else
36033606 res[i] = s[i];
36043607 res[s_len] = NUL;
3605- /* Add two extra NULs to make sure it's properly terminated. */
3608+ // Add two extra NULs to make sure it's properly terminated.
36063609 res[s_len + 1] = NUL;
36073610 res[s_len + 2] = NUL;
36083611 }
@@ -3615,12 +3618,12 @@
36153618 char_u *
36163619 gui_mch_browsedir(char_u *title, char_u *initdir)
36173620 {
3618- /* We fake this: Use a filter that doesn't select anything and a default
3619- * file name that won't be used. */
3621+ // We fake this: Use a filter that doesn't select anything and a default
3622+ // file name that won't be used.
36203623 return gui_mch_browse(0, title, (char_u *)_("Not Used"), NULL,
36213624 initdir, (char_u *)_("Directory\t*.nothing\n"));
36223625 }
3623-#endif /* FEAT_BROWSE */
3626+#endif // FEAT_BROWSE
36243627
36253628 static void
36263629 _OnDropFiles(
@@ -3637,9 +3640,9 @@
36373640 POINT pt;
36383641 int_u modifiers = 0;
36393642
3640- /* TRACE("_OnDropFiles: %d files dropped\n", cFiles); */
3641-
3642- /* Obtain dropped position */
3643+ // TRACE("_OnDropFiles: %d files dropped\n", cFiles);
3644+
3645+ // Obtain dropped position
36433646 DragQueryPoint(hDrop, &pt);
36443647 MapWindowPoints(s_hwnd, s_textArea, &pt, 1);
36453648
@@ -3683,7 +3686,7 @@
36833686 UINT code,
36843687 int pos)
36853688 {
3686- static UINT prev_code = 0; /* code of previous call */
3689+ static UINT prev_code = 0; // code of previous call
36873690 scrollbar_T *sb, *sb_info;
36883691 long val;
36893692 int dragging = FALSE;
@@ -3697,7 +3700,7 @@
36973700 if (sb == NULL)
36983701 return 0;
36993702
3700- if (sb->wp != NULL) /* Left or right scrollbar */
3703+ if (sb->wp != NULL) // Left or right scrollbar
37013704 {
37023705 /*
37033706 * Careful: need to get scrollbar info out of first (left) scrollbar
@@ -3706,7 +3709,7 @@
37063709 */
37073710 sb_info = &sb->wp->w_scrollbars[0];
37083711 }
3709- else /* Bottom scrollbar */
3712+ else // Bottom scrollbar
37103713 sb_info = sb;
37113714 val = sb_info->value;
37123715
@@ -3751,7 +3754,7 @@
37513754 break;
37523755
37533756 default:
3754- /* TRACE("Unknown scrollbar event %d\n", code); */
3757+ // TRACE("Unknown scrollbar event %d\n", code);
37553758 return 0;
37563759 }
37573760 prev_code = code;
@@ -3770,11 +3773,11 @@
37703773 SetScrollInfo(id, SB_CTL, &si, TRUE);
37713774 }
37723775
3773- /* Don't let us be interrupted here by another message. */
3776+ // Don't let us be interrupted here by another message.
37743777 s_busy_processing = TRUE;
37753778
3776- /* When "allow_scrollbar" is FALSE still need to remember the new
3777- * position, but don't actually scroll by setting "dont_scroll". */
3779+ // When "allow_scrollbar" is FALSE still need to remember the new
3780+ // position, but don't actually scroll by setting "dont_scroll".
37783781 dont_scroll = !allow_scrollbar;
37793782
37803783 mch_disable_flush();
@@ -3902,10 +3905,10 @@
39023905 # define HANDLE_WM_DEADCHAR(hwnd, wParam, lParam, fn) \
39033906 ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
39043907 # endif
3905-#endif /* __MINGW32__ */
3906-
3907-
3908-/* Some parameters for tearoff menus. All in pixels. */
3908+#endif // __MINGW32__
3909+
3910+
3911+// Some parameters for tearoff menus. All in pixels.
39093912 #define TEAROFF_PADDING_X 2
39103913 #define TEAROFF_BUTTON_PAD_X 8
39113914 #define TEAROFF_MIN_WIDTH 200
@@ -3913,7 +3916,7 @@
39133916 #define TEAROFF_COLUMN_PADDING 3 // # spaces to pad column with.
39143917
39153918
3916-/* For the Intellimouse: */
3919+// For the Intellimouse:
39173920 #ifndef WM_MOUSEWHEEL
39183921 # define WM_MOUSEWHEEL 0x20a
39193922 #endif
@@ -3924,8 +3927,8 @@
39243927 # define BEVAL_TEXT_LEN MAXPATHL
39253928
39263929 # if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
3927-/* Work around old versions of basetsd.h which wrongly declares
3928- * UINT_PTR as unsigned long. */
3930+// Work around old versions of basetsd.h which wrongly declares
3931+// UINT_PTR as unsigned long.
39293932 # undef UINT_PTR
39303933 # define UINT_PTR UINT
39313934 # endif
@@ -3935,7 +3938,7 @@
39353938 static DWORD LastActivity = 0;
39363939
39373940
3938-/* cproto fails on missing include files */
3941+// cproto fails on missing include files
39393942 # ifndef PROTO
39403943
39413944 /*
@@ -4018,13 +4021,13 @@
40184021 # define TTN_GETDISPINFO (TTN_FIRST - 0)
40194022 # endif
40204023
4021-#endif /* defined(FEAT_BEVAL_GUI) */
4024+#endif // defined(FEAT_BEVAL_GUI)
40224025
40234026 #if defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
4024-/* Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define
4025- * it here if LPNMTTDISPINFO isn't defined.
4026- * MingW doesn't define LPNMTTDISPINFO but typedefs it. Thus we need to check
4027- * _MSC_VER. */
4027+// Older MSVC compilers don't have LPNMTTDISPINFO[AW] thus we need to define
4028+// it here if LPNMTTDISPINFO isn't defined.
4029+// MingW doesn't define LPNMTTDISPINFO but typedefs it. Thus we need to check
4030+// _MSC_VER.
40284031 # if !defined(LPNMTTDISPINFO) && defined(_MSC_VER)
40294032 typedef struct tagNMTTDISPINFOA {
40304033 NMHDR hdr;
@@ -4051,7 +4054,7 @@
40514054 # define TTN_GETDISPINFOW (TTN_FIRST - 10)
40524055 #endif
40534056
4054-/* Local variables: */
4057+// Local variables:
40554058
40564059 #ifdef FEAT_MENU
40574060 static UINT s_menu_id = 100;
@@ -4066,9 +4069,9 @@
40664069 #define VIM_NAME "vim"
40674070 #define VIM_CLASSW L"Vim"
40684071
4069-/* Initial size for the dialog template. For gui_mch_dialog() it's fixed,
4070- * thus there should be room for every dialog. For tearoffs it's made bigger
4071- * when needed. */
4072+// Initial size for the dialog template. For gui_mch_dialog() it's fixed,
4073+// thus there should be room for every dialog. For tearoffs it's made bigger
4074+// when needed.
40724075 #define DLG_ALLOC_SIZE 16 * 1024
40734076
40744077 /*
@@ -4094,10 +4097,10 @@
40944097
40954098 static int dialog_default_button = -1;
40964099
4097-/* Intellimouse support */
4100+// Intellimouse support
40984101 static int mouse_scroll_lines = 0;
40994102
4100-static int s_usenewlook; /* emulate W95/NT4 non-bold dialogs */
4103+static int s_usenewlook; // emulate W95/NT4 non-bold dialogs
41014104 #ifdef FEAT_TOOLBAR
41024105 static void initialise_toolbar(void);
41034106 static LRESULT CALLBACK toolbar_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -4158,7 +4161,7 @@
41584161 */
41594162 static int
41604163 gui_mswin_get_menu_height(
4161- int fix_window) /* If TRUE, resize window if menu height changed */
4164+ int fix_window) // If TRUE, resize window if menu height changed
41624165 {
41634166 static int old_menu_height = -1;
41644167
@@ -4175,10 +4178,10 @@
41754178 menu_height = 0;
41764179 else if (IsMinimized(s_hwnd))
41774180 {
4178- /* The height of the menu cannot be determined while the window is
4179- * minimized. Take the previous height if the menu is changed in that
4180- * state, to avoid that Vim's vertical window size accidentally
4181- * increases due to the unaccounted-for menu height. */
4181+ // The height of the menu cannot be determined while the window is
4182+ // minimized. Take the previous height if the menu is changed in that
4183+ // state, to avoid that Vim's vertical window size accidentally
4184+ // increases due to the unaccounted-for menu height.
41824185 menu_height = old_menu_height == -1 ? 0 : old_menu_height;
41834186 }
41844187 else
@@ -4206,7 +4209,7 @@
42064209
42074210 return menu_height;
42084211 }
4209-#endif /*FEAT_MENU*/
4212+#endif // FEAT_MENU
42104213
42114214
42124215 /*
@@ -4223,14 +4226,14 @@
42234226 # define SPI_SETWHEELSCROLLLINES 105
42244227 #endif
42254228
4226-#define VMOUSEZ_CLASSNAME "MouseZ" /* hidden wheel window class */
4227-#define VMOUSEZ_TITLE "Magellan MSWHEEL" /* hidden wheel window title */
4229+#define VMOUSEZ_CLASSNAME "MouseZ" // hidden wheel window class
4230+#define VMOUSEZ_TITLE "Magellan MSWHEEL" // hidden wheel window title
42284231 #define VMSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
42294232 #define VMSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
42304233
4231- mouse_scroll_lines = 3; /* reasonable default */
4232-
4233- /* if NT 4.0+ (or Win98) get scroll lines directly from system */
4234+ mouse_scroll_lines = 3; // reasonable default
4235+
4236+ // if NT 4.0+ (or Win98) get scroll lines directly from system
42344237 SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
42354238 &mouse_scroll_lines, 0);
42364239 }
@@ -4399,7 +4402,7 @@
43994402 cy = lpwpos->cy;
44004403 netbeans_frame_moved(x, y);
44014404 }
4402- /* Allow to send WM_SIZE and WM_MOVE */
4405+ // Allow to send WM_SIZE and WM_MOVE
44034406 FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, MyWindowProc);
44044407 }
44054408 #endif
@@ -4459,9 +4462,9 @@
44594462 {
44604463 HANDLE_MSG(hwnd, WM_DEADCHAR, _OnDeadChar);
44614464 HANDLE_MSG(hwnd, WM_SYSDEADCHAR, _OnDeadChar);
4462- /* HANDLE_MSG(hwnd, WM_ACTIVATE, _OnActivate); */
4465+ // HANDLE_MSG(hwnd, WM_ACTIVATE, _OnActivate);
44634466 HANDLE_MSG(hwnd, WM_CLOSE, _OnClose);
4464- /* HANDLE_MSG(hwnd, WM_COMMAND, _OnCommand); */
4467+ // HANDLE_MSG(hwnd, WM_COMMAND, _OnCommand);
44654468 HANDLE_MSG(hwnd, WM_DESTROY, _OnDestroy);
44664469 HANDLE_MSG(hwnd, WM_DROPFILES, _OnDropFiles);
44674470 HANDLE_MSG(hwnd, WM_HSCROLL, _OnScroll);
@@ -4469,12 +4472,12 @@
44694472 #ifdef FEAT_MENU
44704473 HANDLE_MSG(hwnd, WM_COMMAND, _OnMenu);
44714474 #endif
4472- /* HANDLE_MSG(hwnd, WM_MOVE, _OnMove); */
4473- /* HANDLE_MSG(hwnd, WM_NCACTIVATE, _OnNCActivate); */
4475+ // HANDLE_MSG(hwnd, WM_MOVE, _OnMove);
4476+ // HANDLE_MSG(hwnd, WM_NCACTIVATE, _OnNCActivate);
44744477 HANDLE_MSG(hwnd, WM_SETFOCUS, _OnSetFocus);
44754478 HANDLE_MSG(hwnd, WM_SIZE, _OnSize);
4476- /* HANDLE_MSG(hwnd, WM_SYSCOMMAND, _OnSysCommand); */
4477- /* HANDLE_MSG(hwnd, WM_SYSKEYDOWN, _OnAltKey); */
4479+ // HANDLE_MSG(hwnd, WM_SYSCOMMAND, _OnSysCommand);
4480+ // HANDLE_MSG(hwnd, WM_SYSKEYDOWN, _OnAltKey);
44784481 HANDLE_MSG(hwnd, WM_VSCROLL, _OnScroll);
44794482 // HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGING, _OnWindowPosChanging);
44804483 HANDLE_MSG(hwnd, WM_ACTIVATEAPP, _OnActivateApp);
@@ -4522,12 +4525,12 @@
45224525 }
45234526 #endif
45244527
4525- case WM_QUERYENDSESSION: /* System wants to go down. */
4526- gui_shell_closed(); /* Will exit when no changed buffers. */
4527- return FALSE; /* Do NOT allow system to go down. */
4528+ case WM_QUERYENDSESSION: // System wants to go down.
4529+ gui_shell_closed(); // Will exit when no changed buffers.
4530+ return FALSE; // Do NOT allow system to go down.
45284531
45294532 case WM_ENDSESSION:
4530- if (wParam) /* system only really goes down when wParam is TRUE */
4533+ if (wParam) // system only really goes down when wParam is TRUE
45314534 {
45324535 _OnEndSession();
45334536 return 0L;
@@ -4535,8 +4538,8 @@
45354538 break;
45364539
45374540 case WM_CHAR:
4538- /* Don't use HANDLE_MSG() for WM_CHAR, it truncates wParam to a single
4539- * byte while we want the UTF-16 character value. */
4541+ // Don't use HANDLE_MSG() for WM_CHAR, it truncates wParam to a single
4542+ // byte while we want the UTF-16 character value.
45404543 _OnChar(hwnd, (UINT)wParam, (int)(short)LOWORD(lParam));
45414544 return 0L;
45424545
@@ -4563,23 +4566,23 @@
45634566
45644567 case WM_SYSKEYUP:
45654568 #ifdef FEAT_MENU
4566- /* This used to be done only when menu is active: ALT key is used for
4567- * that. But that caused problems when menu is disabled and using
4568- * Alt-Tab-Esc: get into a strange state where no mouse-moved events
4569- * are received, mouse pointer remains hidden. */
4569+ // This used to be done only when menu is active: ALT key is used for
4570+ // that. But that caused problems when menu is disabled and using
4571+ // Alt-Tab-Esc: get into a strange state where no mouse-moved events
4572+ // are received, mouse pointer remains hidden.
45704573 return MyWindowProc(hwnd, uMsg, wParam, lParam);
45714574 #else
45724575 return 0L;
45734576 #endif
45744577
4575- case WM_SIZING: /* HANDLE_MSG doesn't seem to handle this one */
4578+ case WM_SIZING: // HANDLE_MSG doesn't seem to handle this one
45764579 return _DuringSizing((UINT)wParam, (LPRECT)lParam);
45774580
45784581 case WM_MOUSEWHEEL:
45794582 _OnMouseWheel(hwnd, HIWORD(wParam));
45804583 return 0L;
45814584
4582- /* Notification for change in SystemParametersInfo() */
4585+ // Notification for change in SystemParametersInfo()
45834586 case WM_SETTINGCHANGE:
45844587 return _OnSettingChange((UINT)wParam);
45854588
@@ -4653,21 +4656,21 @@
46534656 {
46544657 LPNMTTDISPINFOW lpdi = (LPNMTTDISPINFOW)lParam;
46554658
4656- /* Set the maximum width, this also enables using
4657- * \n for line break. */
4659+ // Set the maximum width, this also enables using
4660+ // \n for line break.
46584661 SendMessage(lpdi->hdr.hwndFrom, TTM_SETMAXTIPWIDTH,
46594662 0, 500);
46604663
46614664 tt_text = enc_to_utf16(str, NULL);
46624665 lpdi->lpszText = tt_text;
4663- /* can't show tooltip if failed */
4666+ // can't show tooltip if failed
46644667 }
46654668 else
46664669 {
46674670 LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)lParam;
46684671
4669- /* Set the maximum width, this also enables using
4670- * \n for line break. */
4672+ // Set the maximum width, this also enables using
4673+ // \n for line break.
46714674 SendMessage(lpdi->hdr.hwndFrom, TTM_SETMAXTIPWIDTH,
46724675 0, 500);
46734676
@@ -4760,8 +4763,8 @@
47604763 int yPos = GET_Y_LPARAM(lParam);
47614764 RECT rct;
47624765
4763- /* If the cursor is on the GUI tabline, don't process this
4764- * event */
4766+ // If the cursor is on the GUI tabline, don't process this
4767+ // event
47654768 GetWindowRect(s_textArea, &rct);
47664769 if (yPos < rct.top)
47674770 return result;
@@ -4770,7 +4773,7 @@
47704773 (void)gui_mch_get_winpos(&x, &y);
47714774 xPos -= x;
47724775
4773- if (xPos < 48) /* <VN> TODO should use system metric? */
4776+ if (xPos < 48) // <VN> TODO should use system metric?
47744777 return HTBOTTOMLEFT;
47754778 else
47764779 return HTBOTTOMRIGHT;
@@ -4778,7 +4781,7 @@
47784781 else
47794782 return result;
47804783 }
4781- /* break; notreached */
4784+ // break; notreached
47824785
47834786 #ifdef FEAT_MBYTE_IME
47844787 case WM_IME_NOTIFY:
@@ -4807,7 +4810,7 @@
48074810 * End of call-back routines
48084811 */
48094812
4810-/* parent window, if specified with -P */
4813+// parent window, if specified with -P
48114814 HWND vim_parent_hwnd = NULL;
48124815
48134816 static BOOL CALLBACK
@@ -4820,14 +4823,14 @@
48204823 {
48214824 if (strstr(buf, title) != NULL)
48224825 {
4823- /* Found it. Store the window ref. and quit searching if MDI
4824- * works. */
4826+ // Found it. Store the window ref. and quit searching if MDI
4827+ // works.
48254828 vim_parent_hwnd = FindWindowEx(hwnd, NULL, "MDIClient", NULL);
48264829 if (vim_parent_hwnd != NULL)
48274830 return FALSE;
48284831 }
48294832 }
4830- return TRUE; /* continue searching */
4833+ return TRUE; // continue searching
48314834 }
48324835
48334836 /*
@@ -4855,7 +4858,7 @@
48554858 gui.in_use = mch_is_gui_executable();
48564859 # endif
48574860
4858- /* Can't use emsg() here, we have not finished initialisation yet. */
4861+ // Can't use emsg() here, we have not finished initialisation yet.
48594862 vim_snprintf(buf, IOSIZE,
48604863 _("E243: Argument not supported: \"-%s\"; Use the OLE version."),
48614864 arg);
@@ -5009,10 +5012,10 @@
50095012 int silent = FALSE;
50105013 int idx;
50115014
5012- /* Check for special OLE command line parameters */
5015+ // Check for special OLE command line parameters
50135016 if ((*argc == 2 || *argc == 3) && (argv[1][0] == '-' || argv[1][0] == '/'))
50145017 {
5015- /* Check for a "-silent" argument first. */
5018+ // Check for a "-silent" argument first.
50165019 if (*argc == 3 && STRICMP(argv[1] + 1, "silent") == 0
50175020 && (argv[2][0] == '-' || argv[2][0] == '/'))
50185021 {
@@ -5022,7 +5025,7 @@
50225025 else
50235026 idx = 1;
50245027
5025- /* Register Vim as an OLE Automation server */
5028+ // Register Vim as an OLE Automation server
50265029 if (STRICMP(argv[idx] + 1, "register") == 0)
50275030 {
50285031 #ifdef FEAT_OLE
@@ -5035,7 +5038,7 @@
50355038 #endif
50365039 }
50375040
5038- /* Unregister Vim as an OLE Automation server */
5041+ // Unregister Vim as an OLE Automation server
50395042 if (STRICMP(argv[idx] + 1, "unregister") == 0)
50405043 {
50415044 #ifdef FEAT_OLE
@@ -5048,11 +5051,10 @@
50485051 #endif
50495052 }
50505053
5051- /* Ignore an -embedding argument. It is only relevant if the
5052- * application wants to treat the case when it is started manually
5053- * differently from the case where it is started via automation (and
5054- * we don't).
5055- */
5054+ // Ignore an -embedding argument. It is only relevant if the
5055+ // application wants to treat the case when it is started manually
5056+ // differently from the case where it is started via automation (and
5057+ // we don't).
50565058 if (STRICMP(argv[idx] + 1, "embedding") == 0)
50575059 {
50585060 #ifdef FEAT_OLE
@@ -5069,7 +5071,7 @@
50695071 int bDoRestart = FALSE;
50705072
50715073 InitOLE(&bDoRestart);
5072- /* automatically exit after registering */
5074+ // automatically exit after registering
50735075 if (bDoRestart)
50745076 mch_exit(0);
50755077 }
@@ -5077,7 +5079,7 @@
50775079
50785080 #ifdef FEAT_NETBEANS_INTG
50795081 {
5080- /* stolen from gui_x11.c */
5082+ // stolen from gui_x11.c
50815083 int arg;
50825084
50835085 for (arg = 1; arg < *argc; arg++)
@@ -5087,7 +5089,7 @@
50875089 mch_memmove(&argv[arg], &argv[arg + 1],
50885090 (--*argc - arg) * sizeof(char *));
50895091 argv[*argc] = NULL;
5090- break; /* enough? */
5092+ break; // enough?
50915093 }
50925094 }
50935095 #endif
@@ -5107,8 +5109,8 @@
51075109 ATOM atom;
51085110 #endif
51095111
5110- /* Return here if the window was already opened (happens when
5111- * gui_mch_dialog() is called early). */
5112+ // Return here if the window was already opened (happens when
5113+ // gui_mch_dialog() is called early).
51125114 if (s_hwnd != NULL)
51135115 goto theend;
51145116
@@ -5122,14 +5124,14 @@
51225124 gui.scrollbar_width = GetSystemMetrics(SM_CXVSCROLL);
51235125 gui.scrollbar_height = GetSystemMetrics(SM_CYHSCROLL);
51245126 #ifdef FEAT_MENU
5125- gui.menu_height = 0; /* Windows takes care of this */
5127+ gui.menu_height = 0; // Windows takes care of this
51265128 #endif
51275129 gui.border_width = 0;
51285130
51295131 s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
51305132
5131- /* First try using the wide version, so that we can use any title.
5132- * Otherwise only characters in the active codepage will work. */
5133+ // First try using the wide version, so that we can use any title.
5134+ // Otherwise only characters in the active codepage will work.
51335135 if (GetClassInfoW(g_hinst, szVimWndClassW, &wndclassw) == 0)
51345136 {
51355137 wndclassw.style = CS_DBLCLKS;
@@ -5175,7 +5177,7 @@
51755177 }
51765178 __except(EXCEPTION_EXECUTE_HANDLER)
51775179 {
5178- /* NOP */
5180+ // NOP
51795181 }
51805182 #endif
51815183 if (s_hwnd == NULL)
@@ -5186,21 +5188,21 @@
51865188 }
51875189 else
51885190 {
5189- /* If the provided windowid is not valid reset it to zero, so that it
5190- * is ignored and we open our own window. */
5191+ // If the provided windowid is not valid reset it to zero, so that it
5192+ // is ignored and we open our own window.
51915193 if (IsWindow((HWND)win_socket_id) <= 0)
51925194 win_socket_id = 0;
51935195
5194- /* Create a window. If win_socket_id is not zero without border and
5195- * titlebar, it will be reparented below. */
5196+ // Create a window. If win_socket_id is not zero without border and
5197+ // titlebar, it will be reparented below.
51965198 s_hwnd = CreateWindowW(
51975199 szVimWndClassW, L"Vim MSWindows GUI",
51985200 (win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP)
51995201 | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
52005202 gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
52015203 gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
5202- 100, /* Any value will do */
5203- 100, /* Any value will do */
5204+ 100, // Any value will do
5205+ 100, // Any value will do
52045206 NULL, NULL,
52055207 g_hinst, NULL);
52065208 if (s_hwnd != NULL && win_socket_id != 0)
@@ -5220,7 +5222,7 @@
52205222 dyn_imm_load();
52215223 #endif
52225224
5223- /* Create the text area window */
5225+ // Create the text area window
52245226 if (GetClassInfoW(g_hinst, szTextAreaClassW, &wndclassw) == 0)
52255227 {
52265228 wndclassw.style = CS_OWNDC;
@@ -5251,7 +5253,7 @@
52515253 return FAIL;
52525254
52535255 #ifdef FEAT_LIBCALL
5254- /* Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico. */
5256+ // Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico.
52555257 {
52565258 HANDLE hIcon = NULL;
52575259
@@ -5267,14 +5269,14 @@
52675269
52685270 DragAcceptFiles(s_hwnd, TRUE);
52695271
5270- /* Do we need to bother with this? */
5271- /* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
5272-
5273- /* Get background/foreground colors from the system */
5272+ // Do we need to bother with this?
5273+ // m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT);
5274+
5275+ // Get background/foreground colors from the system
52745276 gui_mch_def_colors();
52755277
5276- /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
5277- * file) */
5278+ // Get the colors from the "Normal" group (set in syntax.c or in a vimrc
5279+ // file)
52785280 set_normal_colors();
52795281
52805282 /*
@@ -5285,8 +5287,8 @@
52855287 gui.def_norm_pixel = gui.norm_pixel;
52865288 gui.def_back_pixel = gui.back_pixel;
52875289
5288- /* Get the colors for the highlight groups (gui_check_colors() might have
5289- * changed them) */
5290+ // Get the colors for the highlight groups (gui_check_colors() might have
5291+ // changed them)
52905292 highlight_gui_started();
52915293
52925294 /*
@@ -5321,7 +5323,7 @@
53215323 */
53225324 s_findrep_msg = RegisterWindowMessage(FINDMSGSTRING);
53235325
5324- /* Initialise the struct */
5326+ // Initialise the struct
53255327 s_findrep_struct.lStructSize = sizeof(s_findrep_struct);
53265328 s_findrep_struct.lpstrFindWhat = ALLOC_MULT(WCHAR, MSWIN_FR_BUFSIZE);
53275329 s_findrep_struct.lpstrFindWhat[0] = NUL;
@@ -5333,12 +5335,12 @@
53335335
53345336 #ifdef FEAT_EVAL
53355337 # if !defined(_MSC_VER) || (_MSC_VER < 1400)
5336-/* Define HandleToLong for old MS and non-MS compilers if not defined. */
5338+// Define HandleToLong for old MS and non-MS compilers if not defined.
53375339 # ifndef HandleToLong
53385340 # define HandleToLong(h) ((long)(intptr_t)(h))
53395341 # endif
53405342 # endif
5341- /* set the v:windowid variable */
5343+ // set the v:windowid variable
53425344 set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
53435345 #endif
53445346
@@ -5348,7 +5350,7 @@
53485350 #endif
53495351
53505352 theend:
5351- /* Display any pending error messages */
5353+ // Display any pending error messages
53525354 display_errors();
53535355
53545356 return OK;
@@ -5364,7 +5366,7 @@
53645366 HMONITOR mon;
53655367 MONITORINFO moninfo;
53665368
5367- /* work out which monitor the window is on, and get *its* work area */
5369+ // work out which monitor the window is on, and get *its* work area
53685370 mon = MonitorFromWindow(s_hwnd, MONITOR_DEFAULTTOPRIMARY);
53695371 if (mon != NULL)
53705372 {
@@ -5375,7 +5377,7 @@
53755377 return;
53765378 }
53775379 }
5378- /* this is the old method... */
5380+ // this is the old method...
53795381 SystemParametersInfo(SPI_GETWORKAREA, 0, spi_rect, 0);
53805382 }
53815383
@@ -5396,27 +5398,27 @@
53965398 int win_width, win_height;
53975399 WINDOWPLACEMENT wndpl;
53985400
5399- /* Try to keep window completely on screen. */
5400- /* Get position of the screen work area. This is the part that is not
5401- * used by the taskbar or appbars. */
5401+ // Try to keep window completely on screen.
5402+ // Get position of the screen work area. This is the part that is not
5403+ // used by the taskbar or appbars.
54025404 get_work_area(&workarea_rect);
54035405
5404- /* Get current position of our window. Note that the .left and .top are
5405- * relative to the work area. */
5406+ // Get current position of our window. Note that the .left and .top are
5407+ // relative to the work area.
54065408 wndpl.length = sizeof(WINDOWPLACEMENT);
54075409 GetWindowPlacement(s_hwnd, &wndpl);
54085410
5409- /* Resizing a maximized window looks very strange, unzoom it first.
5410- * But don't do it when still starting up, it may have been requested in
5411- * the shortcut. */
5411+ // Resizing a maximized window looks very strange, unzoom it first.
5412+ // But don't do it when still starting up, it may have been requested in
5413+ // the shortcut.
54125414 if (wndpl.showCmd == SW_SHOWMAXIMIZED && starting == 0)
54135415 {
54145416 ShowWindow(s_hwnd, SW_SHOWNORMAL);
5415- /* Need to get the settings of the normal window. */
5417+ // Need to get the settings of the normal window.
54165418 GetWindowPlacement(s_hwnd, &wndpl);
54175419 }
54185420
5419- /* compute the size of the outside of the window */
5421+ // compute the size of the outside of the window
54205422 win_width = width + (GetSystemMetrics(SM_CXFRAME) +
54215423 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
54225424 win_height = height + (GetSystemMetrics(SM_CYFRAME) +
@@ -5427,13 +5429,13 @@
54275429 #endif
54285430 ;
54295431
5430- /* The following should take care of keeping Vim on the same monitor, no
5431- * matter if the secondary monitor is left or right of the primary
5432- * monitor. */
5432+ // The following should take care of keeping Vim on the same monitor, no
5433+ // matter if the secondary monitor is left or right of the primary
5434+ // monitor.
54335435 wndpl.rcNormalPosition.right = wndpl.rcNormalPosition.left + win_width;
54345436 wndpl.rcNormalPosition.bottom = wndpl.rcNormalPosition.top + win_height;
54355437
5436- /* If the window is going off the screen, move it on to the screen. */
5438+ // If the window is going off the screen, move it on to the screen.
54375439 if ((direction & RESIZE_HOR)
54385440 && wndpl.rcNormalPosition.right > workarea_rect.right)
54395441 OffsetRect(&wndpl.rcNormalPosition,
@@ -5454,16 +5456,16 @@
54545456 OffsetRect(&wndpl.rcNormalPosition,
54555457 0, workarea_rect.top - wndpl.rcNormalPosition.top);
54565458
5457- /* set window position - we should use SetWindowPlacement rather than
5458- * SetWindowPos as the MSDN docs say the coord systems returned by
5459- * these two are not compatible. */
5459+ // set window position - we should use SetWindowPlacement rather than
5460+ // SetWindowPos as the MSDN docs say the coord systems returned by
5461+ // these two are not compatible.
54605462 SetWindowPlacement(s_hwnd, &wndpl);
54615463
54625464 SetActiveWindow(s_hwnd);
54635465 SetFocus(s_hwnd);
54645466
54655467 #ifdef FEAT_MENU
5466- /* Menu may wrap differently now */
5468+ // Menu may wrap differently now
54675469 gui_mswin_get_menu_height(!gui.starting);
54685470 #endif
54695471 }
@@ -5543,7 +5545,7 @@
55435545 * First static functions (no prototypes generated).
55445546 */
55455547 # ifdef _MSC_VER
5546-# include <ime.h> /* Apparently not needed for Cygwin or MinGW. */
5548+# include <ime.h> // Apparently not needed for Cygwin or MinGW.
55475549 # endif
55485550 # include <imm.h>
55495551
@@ -5566,15 +5568,15 @@
55665568 pImmSetCompositionFontW(hImc, &norm_logfont);
55675569 im_set_position(gui.row, gui.col);
55685570
5569- /* Disable langmap */
5571+ // Disable langmap
55705572 State &= ~LANGMAP;
55715573 if (State & INSERT)
55725574 {
55735575 # if defined(FEAT_KEYMAP)
5574- /* Unshown 'keymap' in status lines */
5576+ // Unshown 'keymap' in status lines
55755577 if (curbuf->b_p_iminsert == B_IMODE_LMAP)
55765578 {
5577- /* Save cursor position */
5579+ // Save cursor position
55785580 int old_row = gui.row;
55795581 int old_col = gui.col;
55805582
@@ -5584,7 +5586,7 @@
55845586 showmode();
55855587 status_redraw_curbuf();
55865588 update_screen(0);
5587- /* Restore cursor position */
5589+ // Restore cursor position
55885590 gui.row = old_row;
55895591 gui.col = old_col;
55905592 }
@@ -5606,7 +5608,7 @@
56065608 char_u *ret;
56075609 int len;
56085610
5609- if ((param & GCS_RESULTSTR) == 0) /* Composition unfinished. */
5611+ if ((param & GCS_RESULTSTR) == 0) // Composition unfinished.
56105612 return 0;
56115613
56125614 ret = GetResultStr(hwnd, GCS_RESULTSTR, &len);
@@ -5631,16 +5633,16 @@
56315633 char_u *buf;
56325634
56335635 if (!pImmGetContext)
5634- return NULL; /* no imm32.dll */
5635-
5636- /* Try Unicode; this'll always work on NT regardless of codepage. */
5636+ return NULL; // no imm32.dll
5637+
5638+ // Try Unicode; this'll always work on NT regardless of codepage.
56375639 ret = pImmGetCompositionStringW(hIMC, GCS, NULL, 0);
56385640 if (ret == 0)
5639- return NULL; /* empty */
5641+ return NULL; // empty
56405642
56415643 if (ret > 0)
56425644 {
5643- /* Allocate the requested buffer plus space for the NUL character. */
5645+ // Allocate the requested buffer plus space for the NUL character.
56445646 wbuf = alloc(ret + sizeof(WCHAR));
56455647 if (wbuf != NULL)
56465648 {
@@ -5650,19 +5652,19 @@
56505652 return (short_u *)wbuf;
56515653 }
56525654
5653- /* ret < 0; we got an error, so try the ANSI version. This'll work
5654- * on 9x/ME, but only if the codepage happens to be set to whatever
5655- * we're inputting. */
5655+ // ret < 0; we got an error, so try the ANSI version. This'll work
5656+ // on 9x/ME, but only if the codepage happens to be set to whatever
5657+ // we're inputting.
56565658 ret = pImmGetCompositionStringA(hIMC, GCS, NULL, 0);
56575659 if (ret <= 0)
5658- return NULL; /* empty or error */
5660+ return NULL; // empty or error
56595661
56605662 buf = alloc(ret);
56615663 if (buf == NULL)
56625664 return NULL;
56635665 pImmGetCompositionStringA(hIMC, GCS, buf, ret);
56645666
5665- /* convert from codepage to UCS-2 */
5667+ // convert from codepage to UCS-2
56665668 MultiByteToWideChar_alloc(GetACP(), 0, (LPCSTR)buf, ret, &wbuf, lenp);
56675669 vim_free(buf);
56685670
@@ -5678,14 +5680,14 @@
56785680 static char_u *
56795681 GetResultStr(HWND hwnd, int GCS, int *lenp)
56805682 {
5681- HIMC hIMC; /* Input context handle. */
5683+ HIMC hIMC; // Input context handle.
56825684 short_u *buf = NULL;
56835685 char_u *convbuf = NULL;
56845686
56855687 if (!pImmGetContext || (hIMC = pImmGetContext(hwnd)) == (HIMC)0)
56865688 return NULL;
56875689
5688- /* Reads in the composition string. */
5690+ // Reads in the composition string.
56895691 buf = GetCompositionString_inUCS2(hIMC, GCS, lenp);
56905692 if (buf == NULL)
56915693 return NULL;
@@ -5697,7 +5699,7 @@
56975699 }
56985700 #endif
56995701
5700-/* For global functions we need prototypes. */
5702+// For global functions we need prototypes.
57015703 #if defined(FEAT_MBYTE_IME) || defined(PROTO)
57025704
57035705 /*
@@ -5754,7 +5756,7 @@
57545756 }
57555757 # endif
57565758
5757- if (pImmGetContext) /* if NULL imm32.dll wasn't loaded (yet) */
5759+ if (pImmGetContext) // if NULL imm32.dll wasn't loaded (yet)
57585760 {
57595761 if (p_imdisable)
57605762 {
@@ -5787,7 +5789,7 @@
57875789
57885790 if (active)
57895791 {
5790- /* if we have a saved conversion status, restore it */
5792+ // if we have a saved conversion status, restore it
57915793 if (bSaved)
57925794 pImmSetConversionStatus(hImc, dwConversionSaved,
57935795 dwSentenceSaved);
@@ -5795,7 +5797,7 @@
57955797 }
57965798 else
57975799 {
5798- /* save conversion status and disable korean */
5800+ // save conversion status and disable korean
57995801 if (pImmGetConversionStatus(hImc, &dwConversionSaved,
58005802 &dwSentenceSaved))
58015803 {
@@ -5836,10 +5838,10 @@
58365838 return status;
58375839 }
58385840
5839-#endif /* FEAT_MBYTE_IME */
5841+#endif // FEAT_MBYTE_IME
58405842
58415843 #if !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
5842-/* Win32 with GLOBAL IME */
5844+// Win32 with GLOBAL IME
58435845
58445846 /*
58455847 * Notify cursor position to IM.
@@ -5847,7 +5849,7 @@
58475849 void
58485850 im_set_position(int row, int col)
58495851 {
5850- /* Win32 with GLOBAL IME */
5852+ // Win32 with GLOBAL IME
58515853 POINT p;
58525854
58535855 p.x = FILL_X(col);
@@ -5888,14 +5890,14 @@
58885890 c = *text++;
58895891 switch (c)
58905892 {
5891- case 0xa4: c = 0x20ac; break; /* euro */
5892- case 0xa6: c = 0x0160; break; /* S hat */
5893- case 0xa8: c = 0x0161; break; /* S -hat */
5894- case 0xb4: c = 0x017d; break; /* Z hat */
5895- case 0xb8: c = 0x017e; break; /* Z -hat */
5896- case 0xbc: c = 0x0152; break; /* OE */
5897- case 0xbd: c = 0x0153; break; /* oe */
5898- case 0xbe: c = 0x0178; break; /* Y */
5893+ case 0xa4: c = 0x20ac; break; // euro
5894+ case 0xa6: c = 0x0160; break; // S hat
5895+ case 0xa8: c = 0x0161; break; // S -hat
5896+ case 0xb4: c = 0x017d; break; // Z hat
5897+ case 0xb8: c = 0x017e; break; // Z -hat
5898+ case 0xbc: c = 0x0152; break; // OE
5899+ case 0xbd: c = 0x0153; break; // oe
5900+ case 0xbe: c = 0x0178; break; // Y
58995901 }
59005902 *unicodebuf++ = c;
59015903 }
@@ -5949,7 +5951,7 @@
59495951 HPEN hpen = CreatePen(PS_SOLID, 1, color);
59505952 HPEN old_pen = SelectObject(s_hdc, hpen);
59515953 MoveToEx(s_hdc, x1, y1, NULL);
5952- /* Note: LineTo() excludes the last pixel in the line. */
5954+ // Note: LineTo() excludes the last pixel in the line.
59535955 LineTo(s_hdc, x2, y2);
59545956 DeleteObject(SelectObject(s_hdc, old_pen));
59555957 }
@@ -6041,15 +6043,15 @@
60416043 rc.top = FILL_Y(row);
60426044 if (has_mbyte)
60436045 {
6044- /* Compute the length in display cells. */
6046+ // Compute the length in display cells.
60456047 rc.right = FILL_X(col + mb_string2cells(text, len));
60466048 }
60476049 else
60486050 rc.right = FILL_X(col + len);
60496051 rc.bottom = FILL_Y(row + 1);
60506052
6051- /* Cache the created brush, that saves a lot of time. We need two:
6052- * one for cursor background and one for the normal background. */
6053+ // Cache the created brush, that saves a lot of time. We need two:
6054+ // one for cursor background and one for the normal background.
60536055 if (gui.currBgColor == brush_color[0])
60546056 {
60556057 hbr = hbr_cache[0];
@@ -6097,8 +6099,8 @@
60976099 vim_free(padding);
60986100 pad_size = Columns;
60996101
6100- /* Don't give an out-of-memory message here, it would call us
6101- * recursively. */
6102+ // Don't give an out-of-memory message here, it would call us
6103+ // recursively.
61026104 padding = LALLOC_MULT(int, pad_size);
61036105 if (padding != NULL)
61046106 for (i = 0; i < pad_size; i++)
@@ -6112,24 +6114,24 @@
61126114 * No check for DRAW_BOLD, Windows will have done it already.
61136115 */
61146116
6115- /* Check if there are any UTF-8 characters. If not, use normal text
6116- * output to speed up output. */
6117+ // Check if there are any UTF-8 characters. If not, use normal text
6118+ // output to speed up output.
61176119 if (enc_utf8)
61186120 for (n = 0; n < len; ++n)
61196121 if (text[n] >= 0x80)
61206122 break;
61216123
61226124 #if defined(FEAT_DIRECTX)
6123- /* Quick hack to enable DirectWrite. To use DirectWrite (antialias), it is
6124- * required that unicode drawing routine, currently. So this forces it
6125- * enabled. */
6125+ // Quick hack to enable DirectWrite. To use DirectWrite (antialias), it is
6126+ // required that unicode drawing routine, currently. So this forces it
6127+ // enabled.
61266128 if (IS_ENABLE_DIRECTX())
6127- n = 0; /* Keep n < len, to enter block for unicode. */
6128-#endif
6129-
6130- /* Check if the Unicode buffer exists and is big enough. Create it
6131- * with the same length as the multi-byte string, the number of wide
6132- * characters is always equal or smaller. */
6129+ n = 0; // Keep n < len, to enter block for unicode.
6130+#endif
6131+
6132+ // Check if the Unicode buffer exists and is big enough. Create it
6133+ // with the same length as the multi-byte string, the number of wide
6134+ // characters is always equal or smaller.
61336135 if ((enc_utf8
61346136 || (enc_codepage > 0 && (int)GetACP() != enc_codepage)
61356137 || enc_latin9)
@@ -6146,13 +6148,13 @@
61466148
61476149 if (enc_utf8 && n < len && unicodebuf != NULL)
61486150 {
6149- /* Output UTF-8 characters. Composing characters should be
6150- * handled here. */
6151+ // Output UTF-8 characters. Composing characters should be
6152+ // handled here.
61516153 int i;
6152- int wlen; /* string length in words */
6153- int clen; /* string length in characters */
6154- int cells; /* cell width of string up to composing char */
6155- int cw; /* width of current cell */
6154+ int wlen; // string length in words
6155+ int clen; // string length in characters
6156+ int cells; // cell width of string up to composing char
6157+ int cw; // width of current cell
61566158 int c;
61576159
61586160 wlen = 0;
@@ -6163,7 +6165,7 @@
61636165 c = utf_ptr2char(text + i);
61646166 if (c >= 0x10000)
61656167 {
6166- /* Turn into UTF-16 encoding. */
6168+ // Turn into UTF-16 encoding.
61676169 unicodebuf[wlen++] = ((c - 0x10000) >> 10) + 0xD800;
61686170 unicodebuf[wlen++] = ((c - 0x10000) & 0x3ff) + 0xDC00;
61696171 }
@@ -6177,15 +6179,15 @@
61776179 else
61786180 {
61796181 cw = utf_char2cells(c);
6180- if (cw > 2) /* don't use 4 for unprintable char */
6182+ if (cw > 2) // don't use 4 for unprintable char
61816183 cw = 1;
61826184 }
61836185
61846186 if (unicodepdy != NULL)
61856187 {
6186- /* Use unicodepdy to make characters fit as we expect, even
6187- * when the font uses different widths (e.g., bold character
6188- * is wider). */
6188+ // Use unicodepdy to make characters fit as we expect, even
6189+ // when the font uses different widths (e.g., bold character
6190+ // is wider).
61896191 if (c >= 0x10000)
61906192 {
61916193 unicodepdy[wlen - 2] = cw * gui.char_width;
@@ -6201,7 +6203,7 @@
62016203 #if defined(FEAT_DIRECTX)
62026204 if (IS_ENABLE_DIRECTX())
62036205 {
6204- /* Add one to "cells" for italics. */
6206+ // Add one to "cells" for italics.
62056207 DWriteContext_DrawText(s_dwc, unicodebuf, wlen,
62066208 TEXT_X(col), TEXT_Y(row),
62076209 FILL_X(cells + 1), FILL_Y(1) - p_linespace,
@@ -6212,12 +6214,12 @@
62126214 #endif
62136215 ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
62146216 foptions, pcliprect, unicodebuf, wlen, unicodepdy);
6215- len = cells; /* used for underlining */
6217+ len = cells; // used for underlining
62166218 }
62176219 else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9)
62186220 {
6219- /* If we want to display codepage data, and the current CP is not the
6220- * ANSI one, we need to go via Unicode. */
6221+ // If we want to display codepage data, and the current CP is not the
6222+ // ANSI one, we need to go via Unicode.
62216223 if (unicodebuf != NULL)
62226224 {
62236225 if (enc_latin9)
@@ -6229,9 +6231,9 @@
62296231 (LPWSTR)unicodebuf, unibuflen);
62306232 if (len != 0)
62316233 {
6232- /* Use unicodepdy to make characters fit as we expect, even
6233- * when the font uses different widths (e.g., bold character
6234- * is wider). */
6234+ // Use unicodepdy to make characters fit as we expect, even
6235+ // when the font uses different widths (e.g., bold character
6236+ // is wider).
62356237 if (unicodepdy != NULL)
62366238 {
62376239 int i;
@@ -6253,8 +6255,8 @@
62536255 else
62546256 {
62556257 #ifdef FEAT_RIGHTLEFT
6256- /* Windows will mess up RL text, so we have to draw it character by
6257- * character. Only do this if RL is on, since it's slow. */
6258+ // Windows will mess up RL text, so we have to draw it character by
6259+ // character. Only do this if RL is on, since it's slow.
62586260 if (curwin->w_p_rl)
62596261 RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
62606262 foptions, pcliprect, (char *)text, len, padding);
@@ -6264,25 +6266,25 @@
62646266 foptions, pcliprect, (char *)text, len, padding);
62656267 }
62666268
6267- /* Underline */
6269+ // Underline
62686270 if (flags & DRAW_UNDERL)
62696271 {
6270- /* When p_linespace is 0, overwrite the bottom row of pixels.
6271- * Otherwise put the line just below the character. */
6272+ // When p_linespace is 0, overwrite the bottom row of pixels.
6273+ // Otherwise put the line just below the character.
62726274 y = FILL_Y(row + 1) - 1;
62736275 if (p_linespace > 1)
62746276 y -= p_linespace - 1;
62756277 draw_line(FILL_X(col), y, FILL_X(col + len), y, gui.currFgColor);
62766278 }
62776279
6278- /* Strikethrough */
6280+ // Strikethrough
62796281 if (flags & DRAW_STRIKE)
62806282 {
62816283 y = FILL_Y(row + 1) - gui.char_height/2;
62826284 draw_line(FILL_X(col), y, FILL_X(col + len), y, gui.currSpColor);
62836285 }
62846286
6285- /* Undercurl */
6287+ // Undercurl
62866288 if (flags & DRAW_UNDERC)
62876289 {
62886290 int x;
@@ -6303,7 +6305,9 @@
63036305 * Output routines.
63046306 */
63056307
6306-/* Flush any output to the screen */
6308+/*
6309+ * Flush any output to the screen
6310+ */
63076311 void
63086312 gui_mch_flush(void)
63096313 {
@@ -6333,9 +6337,9 @@
63336337 - (GetSystemMetrics(SM_CXFRAME) +
63346338 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
63356339
6336- /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
6337- * the menubar for MSwin, we subtract it from the screen height, so that
6338- * the window size can be made to fit on the screen. */
6340+ // FIXME: dirty trick: Because the gui_get_base_height() doesn't include
6341+ // the menubar for MSwin, we subtract it from the screen height, so that
6342+ // the window size can be made to fit on the screen.
63396343 *screen_h = workarea_rect.bottom - workarea_rect.top
63406344 - (GetSystemMetrics(SM_CYFRAME) +
63416345 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
@@ -6385,7 +6389,7 @@
63856389 vim_free(wn);
63866390 }
63876391
6388- /* Fix window size if menu may have wrapped */
6392+ // Fix window size if menu may have wrapped
63896393 if (parent == NULL)
63906394 gui_mswin_get_menu_height(!gui.starting);
63916395 # ifdef FEAT_TEAROFF
@@ -6412,7 +6416,7 @@
64126416 {
64136417 POINT p;
64146418
6415- /* Find the position of the current cursor */
6419+ // Find the position of the current cursor
64166420 GetDCOrgEx(s_hdc, &p);
64176421 if (mouse_pos)
64186422 {
@@ -6442,7 +6446,7 @@
64426446 {
64436447 vimmenu_T *menu = gui_find_menu(path_name);
64446448
6445- /* Found the menu, so tear it off. */
6449+ // Found the menu, so tear it off.
64466450 if (menu != NULL)
64476451 gui_mch_tearoff(menu->dname, menu, 0xffffL, 0xffffL);
64486452 }
@@ -6549,7 +6553,7 @@
65496553 && menu->parent->children != NULL
65506554 && IsWindow(menu->parent->tearoff_handle))
65516555 {
6552- /* This menu must not show up when rebuilding the tearoff window. */
6556+ // This menu must not show up when rebuilding the tearoff window.
65536557 menu->modes = 0;
65546558 rebuild_tearoff(menu->parent);
65556559 }
@@ -6561,7 +6565,7 @@
65616565 static void
65626566 rebuild_tearoff(vimmenu_T *menu)
65636567 {
6564- /*hackish*/
6568+ //hackish
65656569 char_u tbuf[128];
65666570 RECT trect;
65676571 RECT rct;
@@ -6595,7 +6599,7 @@
65956599 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
65966600 }
65976601 }
6598-# endif /* FEAT_TEAROFF */
6602+# endif // FEAT_TEAROFF
65996603
66006604 /*
66016605 * Make a menu either grey or not grey.
@@ -6640,10 +6644,10 @@
66406644 # endif
66416645 }
66426646
6643-#endif /* FEAT_MENU */
6644-
6645-
6646-/* define some macros used to make the dialogue creation more readable */
6647+#endif // FEAT_MENU
6648+
6649+
6650+// define some macros used to make the dialogue creation more readable
66476651
66486652 #define add_string(s) strcpy((LPSTR)p, s); (LPSTR)p += (strlen((LPSTR)p) + 1)
66496653 #define add_word(x) *p++ = (x)
@@ -6671,13 +6675,13 @@
66716675 if (message == WM_INITDIALOG)