From a09c0a17dbdb4bb9a414a4a6fedf761987a80032 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 8 Apr 2020 17:22:44 +0200 Subject: [PATCH] Fix folding state lost on the next starup issue Any setting other than the default setting "for new opened document - UTF8 apply to opened ansi files" will cause C/C++ and other some languages (not for xml though) folding lost on startup. Fix #4103 --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 5 +++-- PowerEditor/src/WinControls/Preference/preference_rc.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index c8d11973..98b39208 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1946,14 +1946,15 @@ void ScintillaEditView::activateBuffer(BufferID buffer) restyleBuffer(); } + // Everything should be updated, but the language + bufferUpdated(_currentBuffer, (BufferChangeMask & ~BufferChangeLanguage)); + // restore the collapsed info const std::vector & lineStateVectorNew = newBuf->getHeaderLineState(this); syncFoldStateWith(lineStateVectorNew); restoreCurrentPosPreStep(); - bufferUpdated(_currentBuffer, (BufferChangeMask & ~BufferChangeLanguage)); //everything should be updated, but the language (which undoes some operations done here like folding) - //setup line number margin int numLines = static_cast(execute(SCI_GETLINECOUNT)); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index a3198157..83d0c95c 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO +// Copyright (C)2020 Don HO // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License