patch: fix indentation

Ivan Skytte Jørgensen isj-nedit-dev at i1.dk
Tue Oct 16 01:35:34 CEST 2007


The attached patch fixes indentation errors i multiple files. Nothing else.

There remains a large mis-indented block in windowTitle.c (inside the switch), 
but it does not seem to disturb understanding the source code.

The is one remaining issue in highlightData.c where a for is missing curly 
braces. Or maybe not. It is otherwise nicely indented so I wonder if the 
curly braces are missing, the logic is incomplete, or if the indentation is a 
leftover from some old code:

    	SetIntText(HighlightDialog.lineContextW, defaultPatSet->lineContext);
./source/highlightData.c  3064  Warning 539: Did not expect positive 
indentation from line 3061
-------------- next part --------------
diff -r -U3 nedit.isj9/source/menu.c nedit.isj10/source/menu.c
--- nedit.isj9/source/menu.c	2007-10-02 17:47:08.000000000 +0200
+++ nedit.isj10/source/menu.c	2007-10-16 01:20:47.000000000 +0200
@@ -3369,7 +3369,7 @@
     }
     /* User didn't specify a column */
     else if ( column == -1 ) {
-    SelectNumberedLine(WidgetToWindow(w), lineNum);
+        SelectNumberedLine(WidgetToWindow(w), lineNum);
         return;
     }
 
diff -r -U3 nedit.isj9/source/preferences.c nedit.isj10/source/preferences.c
--- nedit.isj9/source/preferences.c	2007-10-08 22:22:37.000000000 +0200
+++ nedit.isj10/source/preferences.c	2007-10-16 01:21:33.000000000 +0200
@@ -1450,7 +1450,7 @@
                 "SAVING WILL INCORPORATE SETTINGS\n"
                 "FROM FILE: %s", "OK", "Cancel",
                 prefFileName, ImportedFile) == 2)
-        return;
+            return;
     }
 
     /*  Write the more dynamic settings into TempStringPrefs.
diff -r -U3 nedit.isj9/source/rangeset.c nedit.isj10/source/rangeset.c
--- nedit.isj9/source/rangeset.c	2006-12-02 11:27:06.000000000 +0100
+++ nedit.isj10/source/rangeset.c	2007-10-16 01:21:57.000000000 +0200
@@ -622,7 +622,7 @@
 		    *newRanges++ = *origRanges++;
 		    nOrigRanges--;
 		    origSet->n_ranges++;
-	      }
+		}
 	    }
 	} while (nMinusRanges > 0 && minusRanges->end <= origRanges->start); /* any more non-overlaps */
 
diff -r -U3 nedit.isj9/source/search.c nedit.isj10/source/search.c
--- nedit.isj9/source/search.c	2007-10-02 17:47:08.000000000 +0200
+++ nedit.isj10/source/search.c	2007-10-16 01:23:48.000000000 +0200
@@ -4100,11 +4100,11 @@
 	if(direction == SEARCH_FORWARD) {
 	    if(  (startPos >= beginPos && window->iSearchLastBeginPos < beginPos)
 	       ||(startPos < beginPos && window->iSearchLastBeginPos >= beginPos)) 
-	    XBell(TheDisplay, 0);
+	        XBell(TheDisplay, 0);
 	} else {
 	    if(  (startPos <= beginPos && window->iSearchLastBeginPos > beginPos)
 	       ||(startPos > beginPos && window->iSearchLastBeginPos <= beginPos))
-	    XBell(TheDisplay, 0);
+	        XBell(TheDisplay, 0);
 	}
     }
 }
diff -r -U3 nedit.isj9/source/server.c nedit.isj10/source/server.c
--- nedit.isj9/source/server.c	2005-07-30 20:05:21.000000000 +0200
+++ nedit.isj10/source/server.c	2007-10-16 01:24:06.000000000 +0200
@@ -317,7 +317,7 @@
            /* No check for top document here! */
            if (isLocatedOnDesktop(window, currentDesktop))
                return window;
-      }
+       }
    }
    else {
        /* Find a window on the current desktop to hold the new document */
diff -r -U3 nedit.isj9/source/shell.c nedit.isj10/source/shell.c
--- nedit.isj9/source/shell.c	2006-12-02 11:27:06.000000000 +0100
+++ nedit.isj10/source/shell.c	2007-10-16 01:24:47.000000000 +0200
@@ -1027,7 +1027,7 @@
      
        /* change the current working directory to the directory of the current
 	  file. */ 
-       if(cmdDir[0] != 0)
+	if(cmdDir[0] != 0)
 	   if(chdir(cmdDir) == -1)
 	       perror("chdir to directory of current file failed");
      
diff -r -U3 nedit.isj9/source/windowTitle.c nedit.isj10/source/windowTitle.c
--- nedit.isj9/source/windowTitle.c	2004-12-23 23:25:47.000000000 +0100
+++ nedit.isj10/source/windowTitle.c	2007-10-16 01:26:23.000000000 +0200
@@ -331,7 +331,7 @@
                case '7':
                case '8':
                case '9':
-                   if (*titleFormat == 'd') {
+                    if (*titleFormat == 'd') {
                        dirNamePresent = True;
                        noOfComponents = c - '0';
                        titleFormat++; /* delete the argument */
@@ -514,7 +514,7 @@
         strcmp(GetClearCaseViewTag(), GetPrefServerName()) == 0) {
         XmToggleButtonSetState(etDialog.oServerEqualViewW,
     	    	    True, False);
-     } else {
+    } else {
         XmToggleButtonSetState(etDialog.oServerEqualViewW,
     	    	    False, False);
     }
diff -r -U3 nedit.isj9/util/fileUtils.c nedit.isj10/util/fileUtils.c
--- nedit.isj9/util/fileUtils.c	2004-10-18 17:54:12.000000000 +0200
+++ nedit.isj10/util/fileUtils.c	2007-10-16 01:27:30.000000000 +0200
@@ -246,15 +246,15 @@
 #else
 	    if (errno == ENXIO)
 #endif
-        {
-            /* It's not a symlink - we are done */
-            strncpy(pathResolved, pathIn, MAXPATHLEN);
-            pathResolved[MAXPATHLEN-1] = '\0';
-            return TRUE;
-        } else
-        {
-            return FALSE;
-        }
+            {
+                /* It's not a symlink - we are done */
+                strncpy(pathResolved, pathIn, MAXPATHLEN);
+                pathResolved[MAXPATHLEN-1] = '\0';
+                return TRUE;
+            } else
+            {
+                return FALSE;
+            }
 	} else if (rlResult==0) {
 	    return FALSE;
 	}


More information about the Develop mailing list