diff --git a/Notepad3.sln b/Notepad3.sln index a1b857ab1..ce1ce1793 100644 --- a/Notepad3.sln +++ b/Notepad3.sln @@ -215,6 +215,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp_it_it", "minipath\langua EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notepad3", "Notepad3", "{C3735E17-6EAE-4CC5-980E-30BCEF094862}" + ProjectSection(SolutionItems) = preProject + src\.clang-format = src\.clang-format + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MiniPath", "MiniPath", "{D21C1F85-6FA3-4695-82CD-DDC5690E2D66}" ProjectSection(SolutionItems) = preProject diff --git a/src/.clang-format b/src/.clang-format index 07056def7..34fdd5dbe 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -12,7 +12,7 @@ AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None @@ -23,10 +23,10 @@ BinPackParameters: true BraceWrapping: AfterCaseLabel: true AfterClass: true - AfterControlStatement: true + AfterControlStatement: false AfterEnum: true AfterFunction: true - AfterNamespace: true + AfterNamespace: false AfterObjCDeclaration: true AfterStruct: true AfterUnion: true @@ -48,8 +48,8 @@ ColumnLimit: 0 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 Cpp11BracedListStyle: true DerivePointerAlignment: true DisableFormat: false @@ -69,7 +69,7 @@ IncludeCategories: IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: true IndentPPDirectives: AfterHash -IndentWidth: 4 +IndentWidth: 2 IndentWrappedFunctionNames: true JavaScriptQuotes: Leave JavaScriptWrapImports: true @@ -127,7 +127,7 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 -TabWidth: 4 +TabWidth: 2 UseTab: Never ... diff --git a/src/Notepad3.c b/src/Notepad3.c index c9ba658b1..d5e9778f7 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -9717,15 +9717,15 @@ bool FileRevert(LPCWSTR szFileName, bool bIgnoreCmdLnEnc) } } - if (bPreserveView) { - EditJumpTo(curLineNum, 0); - } - SciCall_SetSavePoint(); UpdateToolbar(); UpdateStatusbar(true); UpdateMarginWidth(); + if (bPreserveView) { + EditJumpTo(curLineNum + 1, 0); + } + return true; }