summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-06-20 12:51:53 +0000
committerBram Moolenaar <Bram@vim.org>2004-06-20 12:51:53 +0000
commit69a7cb473ceae109b61fae9aa04ee0c29afba5d9 (patch)
tree04bd3292cc6c2317842d7a46ae3ab11e9956ed99 /src
parented20346f0b81d1d89c22c9616abe8e47b4c17f08 (diff)
updated for version 7.0002v7.0002
Diffstat (limited to 'src')
-rw-r--r--src/Makefile4
-rw-r--r--src/buffer.c2
-rw-r--r--src/eval.c28
-rw-r--r--src/ex_cmds.c34
-rw-r--r--src/ex_docmd.c27
-rw-r--r--src/fileio.c5
-rw-r--r--src/gui_mac.c907
-rw-r--r--src/gui_w32.c6
-rw-r--r--src/memline.c4
-rw-r--r--src/normal.c35
-rw-r--r--src/os_mac.c2
-rw-r--r--src/os_msdos.c7
-rw-r--r--src/os_win32.c50
-rw-r--r--src/po/Makefile4
-rw-r--r--src/po/ru.cp1251.po1661
-rw-r--r--src/proto/eval.pro1
-rw-r--r--src/proto/ex_cmds.pro1
-rw-r--r--src/quickfix.c81
-rw-r--r--src/search.c7
19 files changed, 1565 insertions, 1301 deletions
diff --git a/src/Makefile b/src/Makefile
index 46a40ad297..d59f32abe3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -432,7 +432,7 @@ CClink = $(CC)
#CONF_OPT_FEAT = --with-features=small
#CONF_OPT_FEAT = --with-features=normal
#CONF_OPT_FEAT = --with-features=big
-CONF_OPT_FEAT = --with-features=huge
+#CONF_OPT_FEAT = --with-features=huge
# COMPILED BY - For including a specific e-mail address for ":version".
#CONF_OPT_COMPBY = "--with-compiledby=John Doe <JohnDoe@yahoo.com>"
@@ -493,7 +493,7 @@ CONF_OPT_FEAT = --with-features=huge
# Often used for GCC: mixed optimizing, lot of optimizing, debugging
#CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes
-CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wmissing-prototypes
+#CFLAGS = -g -O2 -fno-strength-reduce -Wall -Wmissing-prototypes
#CFLAGS = -O6 -fno-strength-reduce -Wall -Wshadow -Wmissing-prototypes
#CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes
#CFLAGS = -g -O2 -DSTARTUPTIME=\"vimstartup\" -fno-strength-reduce -Wall -Wmissing-prototypes
diff --git a/src/buffer.c b/src/buffer.c
index 83b570f612..27f64bd5f8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4579,7 +4579,7 @@ buf_spname(buf)
}
#endif
if (buf->b_fname == NULL)
- return _("[No File]");
+ return _("[No Name]");
return NULL;
}
diff --git a/src/eval.c b/src/eval.c
index 2e339e6d04..561857a37b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -599,6 +599,20 @@ eval_to_string_skip(arg, nextcmd, skip)
}
/*
+ * Skip over an expression at "*pp".
+ * Return FAIL for an error, OK otherwise.
+ */
+ int
+skip_expr(pp)
+ char_u **pp;
+{
+ var retvar;
+
+ *pp = skipwhite(*pp);
+ return eval1(pp, &retvar, FALSE);
+}
+
+/*
* Top level evaluation function, returning a string.
* Return pointer to allocated memory, or NULL for failure.
*/
@@ -3375,6 +3389,20 @@ find_buffer(avar)
buf = buflist_findname(name);
vim_free(name);
}
+ if (buf == NULL)
+ {
+ /* No full path name match, try a match with a URL or a "nofile"
+ * buffer, these don't use the full path. */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_fname != NULL
+ && (path_with_url(buf->b_fname)
+#ifdef FEAT_QUICKFIX
+ || bt_nofile(buf)
+#endif
+ )
+ && STRCMP(buf->b_fname, avar->var_val.var_string) == 0)
+ break;
+ }
}
return buf;
}
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e6036ca342..ad612cd706 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4573,7 +4573,7 @@ ex_help(eap)
buf_T *buf;
#ifdef FEAT_MULTI_LANG
int len;
- char_u *lang = NULL;
+ char_u *lang;
#endif
if (eap != NULL)
@@ -4613,13 +4613,7 @@ ex_help(eap)
#ifdef FEAT_MULTI_LANG
/* Check for a specified language */
- len = STRLEN(arg);
- if (len >= 3 && arg[len - 3] == '@' && ASCII_ISALPHA(arg[len - 2])
- && ASCII_ISALPHA(arg[len - 1]))
- {
- lang = arg + len - 2;
- lang[-1] = NUL; /* remove the '@' */
- }
+ lang = check_help_lang(arg);
#endif
/* When no argument given go to the index. */
@@ -4748,6 +4742,28 @@ erret:
}
+#if defined(FEAT_MULTI_LANG) || defined(PROTO)
+/*
+ * In an argument search for a language specifiers in the form "@xx".
+ * Changes the "@" to NUL if found, and returns a pointer to "xx".
+ * Returns NULL if not found.
+ */
+ char_u *
+check_help_lang(arg)
+ char_u *arg;
+{
+ int len = STRLEN(arg);
+
+ if (len >= 3 && arg[len - 3] == '@' && ASCII_ISALPHA(arg[len - 2])
+ && ASCII_ISALPHA(arg[len - 1]))
+ {
+ arg[len - 3] = NUL; /* remove the '@' */
+ return arg + len - 2;
+ }
+ return NULL;
+}
+#endif
+
/*
* Return a heuristic indicating how well the given string matches. The
* smaller the number, the better the match. This is the order of priorities,
@@ -5180,7 +5196,9 @@ ex_helptags(eap)
garray_T ga;
int i, j;
int len;
+#ifdef FEAT_MULTI_LANG
char_u lang[2];
+#endif
char_u ext[5];
char_u fname[8];
int filecount;
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c4b9012ca1..af8d3fc7c4 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2319,8 +2319,8 @@ do_one_cmd(cmdlinep, sourcing,
}
}
/* no arguments allowed */
- if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL &&
- vim_strchr((char_u *)"|\"", *ea.arg) == NULL)
+ if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL
+ && vim_strchr((char_u *)"|\"", *ea.arg) == NULL)
{
errormsg = (char_u *)_(e_trailing);
goto doend;
@@ -3885,6 +3885,17 @@ expand_filename(eap, cmdlinep, errormsgp)
has_wildcards = mch_has_wildcard(eap->arg);
for (p = eap->arg; *p; )
{
+#ifdef FEAT_EVAL
+ /* Skip over `=expr`, wildcards in it are not expanded. */
+ if (p[0] == '`' && p[1] == '=')
+ {
+ p += 2;
+ (void)skip_expr(&p);
+ if (*p == '`')
+ ++p;
+ continue;
+ }
+#endif
/*
* Quick check if this cannot be the start of a special string.
* Also removes backslash before '%', '#' and '<'.
@@ -4157,6 +4168,18 @@ separate_nextcmd(eap)
if (*p == NUL) /* stop at NUL after CTRL-V */
break;
}
+
+#ifdef FEAT_EVAL
+ /* Skip over `=expr` when wildcards are expanded. */
+ else if (p[0] == '`' && p[1] == '=')
+ {
+ p += 2;
+ (void)skip_expr(&p);
+ if (*p == '`')
+ ++p;
+ }
+#endif
+
/* Check for '"': start of comment or '|': next command */
/* :@" and :*" do not start a comment!
* :redir @" doesn't either. */
diff --git a/src/fileio.c b/src/fileio.c
index e8d4e27bbd..a0947aa6d6 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5290,8 +5290,11 @@ shorten_fnames(force)
}
if (p == NULL || buf->b_fname == NULL)
buf->b_fname = buf->b_ffname;
- mf_fullname(buf->b_ml.ml_mfp);
}
+
+ /* Always make the swap file name a full path, a "nofile" buffer may
+ * also have a swap file. */
+ mf_fullname(buf->b_ml.ml_mfp);
}
#ifdef FEAT_WINDOWS
status_redraw_all();
diff --git a/src/gui_mac.c b/src/gui_mac.c
index 2b74c63281..e6a8433493 100644
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -74,6 +74,9 @@ static OSType _ftype = 'TEXT';
# endif
#endif
+/* Vim's Scrap flavor. */
+#define VIMSCRAPFLAVOR 'VIM!'
+
/* CARBON version only tested with Project Builder under MacOS X */
#undef USE_CARBONIZED
#if (defined(__APPLE_CC__) || defined(__MRC__)) && defined(TARGET_API_MAC_CARBON)
@@ -326,7 +329,7 @@ static struct
*/
#ifdef USE_AEVENT
-OSErr HandleUnusedParms (const AppleEvent *theAEvent);
+OSErr HandleUnusedParms(const AppleEvent *theAEvent);
#endif
/*
@@ -511,7 +514,7 @@ char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
if (*error)
{
#ifdef USE_SIOUX
- printf ("fname_from_AEDesc: AECountItems error: %d\n", error);
+ printf("fname_from_AEDesc: AECountItems error: %d\n", error);
#endif
return(fnames);
}
@@ -535,13 +538,13 @@ char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
/* Caller is able to clean up */
/* TODO: Should be clean up or not? For safety. */
#ifdef USE_SIOUX
- printf ("aevt_odoc: AEGetNthPtr error: %d\n", newError);
+ printf("aevt_odoc: AEGetNthPtr error: %d\n", newError);
#endif
return(fnames);
}
/* Convert the FSSpec to a pathname */
- fnames[fileCount - 1] = FullPathFromFSSpec_save (fileToOpen);
+ fnames[fileCount - 1] = FullPathFromFSSpec_save(fileToOpen);
}
return (fnames);
@@ -574,7 +577,7 @@ char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
* When the editor receives this event, determine whether the specified
* file is open. If it is, return the modification date/time for that file
* in the appropriate location specified in the structure. If the file is
- * not opened, put the value fnfErr (file not found) in that location.
+ * not opened, put the value fnfErr(file not found) in that location.
*
*/
@@ -591,7 +594,8 @@ struct WindowSearch /* for handling class 'KAHL', event 'SRCH', keyDirectObject
# pragma options align=reset
#endif
-pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_KAHL_SRCH_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
buf_T *buf;
@@ -604,16 +608,16 @@ pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theRe
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_SRCH: AEGetParamPtr error: %d\n", error);
+ printf("KAHL_SRCH: AEGetParamPtr error: %d\n", error);
#endif
return(error);
}
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_SRCH: HandleUnusedParms error: %d\n", error);
+ printf("KAHL_SRCH: HandleUnusedParms error: %d\n", error);
#endif
return(error);
}
@@ -634,10 +638,10 @@ pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theRe
*SearchData.theDate = buf->b_mtime;
#ifdef USE_SIOUX
- printf ("KAHL_SRCH: file \"%#s\" {%d}", SearchData.theFile.name,SearchData.theFile.parID);
+ printf("KAHL_SRCH: file \"%#s\" {%d}", SearchData.theFile.name,SearchData.theFile.parID);
if (foundFile == false)
- printf (" NOT");
- printf (" found. [date %lx, %lx]\n", *SearchData.theDate, buf->b_mtime_read);
+ printf(" NOT");
+ printf(" found. [date %lx, %lx]\n", *SearchData.theDate, buf->b_mtime_read);
#endif
return error;
@@ -684,7 +688,8 @@ struct ModificationInfo /* for replying to class 'KAHL', event 'MOD ', keyDirect
# pragma options align=reset
#endif
-pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_KAHL_MOD_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
AEDescList replyList;
@@ -694,11 +699,11 @@ pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theRep
theFile.saved = 0;
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_MOD: HandleUnusedParms error: %d\n", error);
+ printf("KAHL_MOD: HandleUnusedParms error: %d\n", error);
#endif
return(error);
}
@@ -712,7 +717,7 @@ pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theRep
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_MOD: AECreateList error: %d\n", error);
+ printf("KAHL_MOD: AECreateList error: %d\n", error);
#endif
return(error);
}
@@ -720,12 +725,12 @@ pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theRep
#if 0
error = AECountItems(&replyList, &numFiles);
#ifdef USE_SIOUX
- printf ("KAHL_MOD ReplyList: %x %x\n", replyList.descriptorType, replyList.dataHandle);
- printf ("KAHL_MOD ItemInList: %d\n", numFiles);
+ printf("KAHL_MOD ReplyList: %x %x\n", replyList.descriptorType, replyList.dataHandle);
+ printf("KAHL_MOD ItemInList: %d\n", numFiles);
#endif
- /* AEPutKeyDesc (&replyList, keyAEPnject, &aDesc)
- * AEPutKeyPtr (&replyList, keyAEPosition, typeChar, (Ptr)&theType,
+ /* AEPutKeyDesc(&replyList, keyAEPnject, &aDesc)
+ * AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType,
* sizeof(DescType))
*/
@@ -739,37 +744,37 @@ pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theRep
/* Add this file to the list */
theFile.theFile = buf->b_FSSpec;
theFile.theDate = buf->b_mtime;
-/* theFile.theDate = time (NULL) & (time_t) 0xFFFFFFF0; */
- error = AEPutPtr (&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile));
+/* theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0; */
+ error = AEPutPtr(&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile));
#ifdef USE_SIOUX
if (numFiles == 0)
- printf ("KAHL_MOD: ");
+ printf("KAHL_MOD: ");
else
- printf (", ");
- printf ("\"%#s\" {%d} [date %lx, %lx]", theFile.theFile.name, theFile.theFile.parID, theFile.theDate, buf->b_mtime_read);
+ printf(", ");
+ printf("\"%#s\" {%d} [date %lx, %lx]", theFile.theFile.name, theFile.theFile.parID, theFile.theDate, buf->b_mtime_read);
if (error)
- printf (" (%d)", error);
+ printf(" (%d)", error);
numFiles++;
#endif
};
#ifdef USE_SIOUX
- printf ("\n");
+ printf("\n");
#endif
#if 0
error = AECountItems(&replyList, &numFiles);
#ifdef USE_SIOUX
- printf ("KAHL_MOD ItemInList: %d\n", numFiles);
+ printf("KAHL_MOD ItemInList: %d\n", numFiles);
#endif
#endif
/* We can add data only if something to reply */
- error = AEPutParamDesc (theReply, keyDirectObject, &replyList);
+ error = AEPutParamDesc(theReply, keyDirectObject, &replyList);
#ifdef USE_SIOUX
if (error)
- printf ("KAHL_MOD: AEPutParamDesc error: %d\n", error);
+ printf("KAHL_MOD: AEPutParamDesc error: %d\n", error);
#endif
if (replyList.dataHandle)
@@ -819,7 +824,8 @@ struct CW_GetText /* for handling class 'KAHL', event 'GTTX', keyDirectObject ty
# pragma options align=reset
#endif
-pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_KAHL_GTTX_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
buf_T *buf;
@@ -839,7 +845,7 @@ pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theRe
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_GTTX: AEGetParamPtr error: %d\n", error);
+ printf("KAHL_GTTX: AEGetParamPtr error: %d\n", error);
#endif
return(error);
}
@@ -854,7 +860,7 @@ pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theRe
if (foundFile)
{
- BufferSize = 0; /* GetHandleSize (GetTextData.theText); */
+ BufferSize = 0; /* GetHandleSize(GetTextData.theText); */
for (lineno = 0; lineno <= buf->b_ml.ml_line_count; lineno++)
{
/* Must use the right buffer */
@@ -863,48 +869,48 @@ pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theRe
lineStart = BufferSize;
BufferSize += linesize;
/* Resize handle to linesize+1 to include the linefeed */
- SetHandleSize (GetTextData.theText, BufferSize);
- if (GetHandleSize (GetTextData.theText) != BufferSize)
+ SetHandleSize(GetTextData.theText, BufferSize);
+ if (GetHandleSize(GetTextData.theText) != BufferSize)
{
#ifdef USE_SIOUX
- printf ("KAHL_GTTX: SetHandleSize increase: %d, size %d\n",
+ printf("KAHL_GTTX: SetHandleSize increase: %d, size %d\n",
linesize, BufferSize);
#endif
break; /* Simple handling for now */
}
else
{
- HLock (GetTextData.theText);
+ HLock(GetTextData.theText);
fullbuffer = (char_u *) *GetTextData.theText;
- STRCPY ((char_u *) (fullbuffer + lineStart), line);
+ STRCPY((char_u *)(fullbuffer + lineStart), line);
fullbuffer[BufferSize-1] = '\r';
- HUnlock (GetTextData.theText);
+ HUnlock(GetTextData.theText);
}
}
if (fullbuffer != NULL)
{
- HLock (GetTextData.theText);
+ HLock(GetTextData.theText);
fullbuffer[BufferSize-1] = 0;
- HUnlock (GetTextData.theText);
+ HUnlock(GetTextData.theText);
}
if (foundFile == false)
*GetTextData.theDate = fnfErr;
else
-/* *GetTextData.theDate = time (NULL) & (time_t) 0xFFFFFFF0;*/
+/* *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0;*/
*GetTextData.theDate = buf->b_mtime;
}
#ifdef USE_SIOUX
- printf ("KAHL_GTTX: file \"%#s\" {%d} [date %lx, %lx]", GetTextData.theFile.name, GetTextData.theFile.parID, *GetTextData.theDate, buf->b_mtime_read);
+ printf("KAHL_GTTX: file \"%#s\" {%d} [date %lx, %lx]", GetTextData.theFile.name, GetTextData.theFile.parID, *GetTextData.theDate, buf->b_mtime_read);
if (foundFile == false)
- printf (" NOT");
- printf (" found. (BufferSize = %d)\n", BufferSize);
+ printf(" NOT");
+ printf(" found. (BufferSize = %d)\n", BufferSize);
#endif
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
#ifdef USE_SIOUX
- printf ("KAHL_GTTX: HandleUnusedParms error: %d\n", error);
+ printf("KAHL_GTTX: HandleUnusedParms error: %d\n", error);
#endif
return(error);
}
@@ -917,48 +923,45 @@ pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theRe
*/
/* Taken from MoreAppleEvents:ProcessHelpers*/
-pascal OSErr FindProcessBySignature( const OSType targetType,
+pascal OSErr FindProcessBySignature(const OSType targetType,
const OSType targetCreator,
- ProcessSerialNumberPtr psnPtr )
+ ProcessSerialNumberPtr psnPtr)
{
OSErr anErr = noErr;
Boolean lookingForProcess = true;
ProcessInfoRec infoRec;
- infoRec.processInfoLength = sizeof( ProcessInfoRec );
+ infoRec.processInfoLength = sizeof(ProcessInfoRec);
infoRec.processName = nil;
infoRec.processAppSpec = nil;
psnPtr->lowLongOfPSN = kNoProcess;
psnPtr->highLongOfPSN = kNoProcess;
- while ( lookingForProcess )
+ while (lookingForProcess)
{
- anErr = GetNextProcess( psnPtr );
- if ( anErr != noErr )
- {
+ anErr = GetNextProcess(psnPtr);
+ if (anErr != noErr)
lookingForProcess = false;
- }
else
{
- anErr = GetProcessInformation( psnPtr, &infoRec );
- if ( ( anErr == noErr )
- && ( infoRec.processType == targetType )
- && ( infoRec.processSignature == targetCreator ) )
- {
+ anErr = GetProcessInformation(psnPtr, &infoRec);
+ if ((anErr == noErr)
+ && (infoRec.processType == targetType)
+ && (infoRec.processSignature == targetCreator))
lookingForProcess = false;
- }
}
}
return anErr;
}//end FindProcessBySignature
-void Send_KAHL_MOD_AE (buf_T *buf)
+ void
+Send_KAHL_MOD_AE(buf_T *buf)
{
- OSErr anErr = noErr;
- AEDesc targetAppDesc = { typeNull, nil };
+ OSErr anErr = noErr;
+ AEDesc targetAppDesc = { typeNull, nil };
ProcessSerialNumber psn = { kNoProcess, kNoProcess };
AppleEvent theReply = { typeNull, nil };
AESendMode sendMode;
@@ -967,48 +970,48 @@ void Send_KAHL_MOD_AE (buf_T *buf)
ModificationInfo ModData;
- anErr = FindProcessBySignature( 'APPL', 'CWIE', &psn );
+ anErr = FindProcessBySignature('APPL', 'CWIE', &psn);
#ifdef USE_SIOUX
- printf ("CodeWarrior is");
+ printf("CodeWarrior is");
if (anErr != noErr)
- printf (" NOT");
- printf (" running\n");
+ printf(" NOT");
+ printf(" running\n");
#endif
- if ( anErr == noErr )
+ if (anErr == noErr)
{
- anErr = AECreateDesc (typeProcessSerialNumber, &psn,
- sizeof( ProcessSerialNumber ), &targetAppDesc);
+ anErr = AECreateDesc(typeProcessSerialNumber, &psn,
+ sizeof(ProcessSerialNumber), &targetAppDesc);
- if ( anErr == noErr )
+ if (anErr == noErr)
{
anErr = AECreateAppleEvent( 'KAHL', 'MOD ', &targetAppDesc,
kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
}
- AEDisposeDesc( &targetAppDesc );
+ AEDisposeDesc(&targetAppDesc);
/* Add the parms */
ModData.theFile = buf->b_FSSpec;
ModData.theDate = buf->b_mtime;
if (anErr == noErr)
- anErr =AEPutParamPtr (&theEvent, keyDirectObject, typeChar, &ModData, sizeof(ModData));
+ anErr = AEPutParamPtr(&theEvent, keyDirectObject, typeChar, &ModData, sizeof(ModData));
- if ( idleProcUPP == nil )
+ if (idleProcUPP == nil)
sendMode = kAENoReply;
else
sendMode = kAEWaitReply;
- if ( anErr == noErr )
- anErr = AESend( &theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil );
- if ( anErr == noErr && sendMode == kAEWaitReply )
+ if (anErr == noErr)
+ anErr = AESend(&theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil);
+ if (anErr == noErr && sendMode == kAEWaitReply)
{
#ifdef USE_SIOUX
- printf ("KAHL_MOD: Send error: %d\n", anErr);
+ printf("KAHL_MOD: Send error: %d\n", anErr);
#endif
-/* anErr = AEHGetHandlerError( &theReply );*/
+/* anErr = AEHGetHandlerError(&theReply);*/
}
- (void) AEDisposeDesc( &theReply );
+ (void) AEDisposeDesc(&theReply);
}
}
#endif /* FEAT_CW_EDITOR */
@@ -1024,7 +1027,8 @@ void Send_KAHL_MOD_AE (buf_T *buf)
* Handle the Unused parms of an AppleEvent
*/
-OSErr HandleUnusedParms (const AppleEvent *theAEvent)
+ OSErr
+HandleUnusedParms(const AppleEvent *theAEvent)
{
OSErr error;
long actualSize;
@@ -1086,7 +1090,8 @@ struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPositi
endRange are all negative, there is no selection range specified.
*/
-pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
/*
* TODO: Clean up the code with convert the AppleEvent into
@@ -1107,7 +1112,7 @@ pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, lo
long lnum;
#ifdef USE_SIOUX
- printf ("aevt_odoc:\n");
+ printf("aevt_odoc:\n");
#endif
/* the direct object parameter is the list of aliases to files (one or more) */
@@ -1115,7 +1120,7 @@ pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, lo
if (error)
{
#ifdef USE_SIOUX
- printf ("aevt_odoc: AEGetParamDesc error: %d\n", error);
+ printf("aevt_odoc: AEGetParamDesc error: %d\n", error);
#endif
return(error);
}
@@ -1129,13 +1134,13 @@ pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, lo
if (error)
{
#ifdef USE_SIOUX
- printf ("aevt_odoc: AEGetParamPtr error: %d\n", error);
+ printf("aevt_odoc: AEGetParamPtr error: %d\n", error);
#endif
return(error);
}
#ifdef USE_SIOUX
- printf ("aevt_odoc: lineNum: %d, startRange %d, endRange %d, [date %lx]\n",
+ printf("aevt_odoc: lineNum: %d, startRange %d, endRange %d, [date %lx]\n",
thePosition.lineNum, thePosition.startRange, thePosition.endRange,
thePosition.theDate);
#endif
@@ -1216,11 +1221,11 @@ pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, lo
finished:
AEDisposeDesc(&theList); /* dispose what we allocated */
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
#ifdef USE_SIOUX
- printf ("aevt_odoc: HandleUnusedParms error: %d\n", error);
+ printf("aevt_odoc: HandleUnusedParms error: %d\n", error);
#endif
return(error);
}
@@ -1231,15 +1236,16 @@ pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, lo
*
*/
-pascal OSErr Handle_aevt_oapp_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_aevt_oapp_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
#ifdef USE_SIOUX
- printf ("aevt_oapp:\n");
+ printf("aevt_oapp:\n");
#endif
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
return(error);
@@ -1252,15 +1258,16 @@ pascal OSErr Handle_aevt_oapp_AE (const AppleEvent *theAEvent, AppleEvent *theRe
*
*/
-pascal OSErr Handle_aevt_quit_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_aevt_quit_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
#ifdef USE_SIOUX
- printf ("aevt_quit\n");
+ printf("aevt_quit\n");
#endif
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
return(error);
@@ -1276,15 +1283,16 @@ pascal OSErr Handle_aevt_quit_AE (const AppleEvent *theAEvent, AppleEvent *theRe
*
*/
-pascal OSErr Handle_aevt_pdoc_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_aevt_pdoc_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
#ifdef USE_SIOUX
- printf ("aevt_pdoc:\n");
+ printf("aevt_pdoc:\n");
#endif
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
return(error);
@@ -1298,15 +1306,16 @@ pascal OSErr Handle_aevt_pdoc_AE (const AppleEvent *theAEvent, AppleEvent *theRe
*
* (Just get rid of all the parms)
*/
-pascal OSErr Handle_unknown_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+ pascal OSErr
+Handle_unknown_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
{
OSErr error = noErr;
#ifdef USE_SIOUX
- printf ("Unknown Event: %x\n", theAEvent->descriptorType);
+ printf("Unknown Event: %x\n", theAEvent->descriptorType);
#endif
- error = HandleUnusedParms (theAEvent);
+ error = HandleUnusedParms(theAEvent);
if (error)
{
return(error);
@@ -1324,7 +1333,8 @@ pascal OSErr Handle_unknown_AE (const AppleEvent *theAEvent, AppleEvent *theRepl
/*
* Install the various AppleEvent Handlers
*/
-OSErr InstallAEHandlers (void)
+ OSErr
+InstallAEHandlers(void)
{
OSErr error;
@@ -1438,7 +1448,7 @@ OSErr InstallAEHandlers (void)
* Returns the index inside the menu wher
*/
short /* Shoulde we return MenuItemIndex? */
-gui_mac_get_menu_item_index (pMenu)
+gui_mac_get_menu_item_index(pMenu)
vimmenu_T *pMenu;
{
short index;
@@ -1475,7 +1485,7 @@ gui_mac_get_menu_item_index (pMenu)
}
static vimmenu_T *
-gui_mac_get_vim_menu (menuID, itemIndex, pMenu)
+gui_mac_get_vim_menu(menuID, itemIndex, pMenu)
short menuID;
short itemIndex;
vimmenu_T *pMenu;
@@ -1529,7 +1539,7 @@ gui_mac_get_vim_menu (menuID, itemIndex, pMenu)
*/
pascal
void
-gui_mac_drag_thumb (ControlHandle theControl, short partCode)
+gui_mac_drag_thumb(ControlHandle theControl, short partCode)
{
scrollbar_T *sb;
int value, dragging;
@@ -1538,13 +1548,13 @@ gui_mac_drag_thumb (ControlHandle theControl, short partCode)
theControlToUse = dragged_sb;
- sb = gui_find_scrollbar((long) GetControlReference (theControlToUse));
+ sb = gui_find_scrollbar((long) GetControlReference(theControlToUse));
if (sb == NULL)
return;
/* Need to find value by diff between Old Poss New Pos */
- value = GetControl32BitValue (theControlToUse);
+ value = GetControl32BitValue(theControlToUse);
dragging = (partCode != 0);
/* When "allow_scrollbar" is FALSE still need to remember the new
@@ -1556,7 +1566,7 @@ gui_mac_drag_thumb (ControlHandle theControl, short partCode)
pascal
void
-gui_mac_scroll_action (ControlHandle theControl, short partCode)
+gui_mac_scroll_action(ControlHandle theControl, short partCode)
{
/* TODO: have live support */
scrollbar_T *sb, *sb_info;
@@ -1566,7 +1576,7 @@ gui_mac_scroll_action (ControlHandle theControl, short partCode)
int dragging = FALSE;
int dont_scroll_save = dont_scroll;
- sb = gui_find_scrollbar((long) GetControlReference (theControl));
+ sb = gui_find_scrollbar((long)GetControlReference(theControl));
if (sb == NULL)
return;
@@ -1648,7 +1658,7 @@ gui_mac_scroll_action (ControlHandle theControl, short partCode)
* TODO: Add support for potential TOOLBAR
*/
void
-gui_mac_doInContentClick (theEvent, whichWindow)
+gui_mac_doInContentClick(theEvent, whichWindow)
EventRecord *theEvent;
WindowPtr whichWindow;
{
@@ -1660,10 +1670,10 @@ gui_mac_doInContentClick (theEvent, whichWindow)
short dblClick;
thePoint = theEvent->where;
- GlobalToLocal (&thePoint);
- SelectWindow (whichWindow);
+ GlobalToLocal(&thePoint);
+ SelectWindow(whichWindow);
- thePortion = FindControl (thePoint, whichWindow, &theControl);
+ thePortion = FindControl(thePoint, whichWindow, &theControl);
if (theControl != NUL)
{
@@ -1685,7 +1695,7 @@ gui_mac_doInContentClick (theEvent, whichWindow)
#endif
/* pass 0 as the part to tell gui_mac_drag_thumb, that the mouse
* button has been released */
- gui_mac_drag_thumb (theControl, 0); /* Should it be thePortion ? (Dany) */
+ gui_mac_drag_thumb(theControl, 0); /* Should it be thePortion ? (Dany) */
dragged_sb = NULL;
}
}
@@ -1731,7 +1741,7 @@ gui_mac_doInContentClick (theEvent, whichWindow)
#endif
#endif
{
- SetRect (&dragRect, FILL_X(X_2_COL(thePoint.h)),
+ SetRect(&dragRect, FILL_X(X_2_COL(thePoint.h)),
FILL_Y(Y_2_ROW(thePoint.v)),
FILL_X(X_2_COL(thePoint.h)+1),
FILL_Y(Y_2_ROW(thePoint.v)+1));
@@ -1746,7 +1756,7 @@ gui_mac_doInContentClick (theEvent, whichWindow)
* Handle the click in the titlebar (to move the window)
*/
void
-gui_mac_doInDragClick (where, whichWindow)
+gui_mac_doInDragClick(where, whichWindow)
Point where;
WindowPtr whichWindow;
{
@@ -1755,11 +1765,11 @@ gui_mac_doInDragClick (where, whichWindow)
/* TODO: may try to prevent move outside screen? */
#ifdef USE_CARBONIZED
- movingLimitsPtr = GetRegionBounds ( GetGrayRgn(), &movingLimits );
+ movingLimitsPtr = GetRegionBounds(GetGrayRgn(), &movingLimits);
#else
movingLimitsPtr = &(*GetGrayRgn())->rgnBBox;
#endif
- DragWindow (whichWindow, where, movingLimitsPtr);
+ DragWindow(whichWindow, where, movingLimitsPtr);
}
/*
@@ -1779,7 +1789,7 @@ gui_mac_doInGrowClick(where, whichWindow)
#ifdef USE_CARBONIZED
Rect NewContentRect;
- resizeLimitsPtr = GetRegionBounds ( GetGrayRgn(), &resizeLimits );
+ resizeLimitsPtr = GetRegionBounds(GetGrayRgn(), &resizeLimits);
#else
resizeLimits = qd.screenBits.bounds;
#endif
@@ -1919,17 +1929,17 @@ gui_mac_doUpdateEvent(event)
whichWindow = (WindowPtr) event->message;