From f3ebd08bd38001ea48e41d2130c37fb2b6ebe638 Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 20 Jul 2008 00:00:03 +0000 Subject: [PATCH] [BUG_FIXED] Fix a bug that file detection options set are not saved. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@297 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 4 +++- PowerEditor/src/Parameters.cpp | 2 ++ PowerEditor/src/Parameters.h | 3 ++- PowerEditor/src/ScitillaComponent/Buffer.h | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 468471312..f7c143449 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -7166,7 +7166,9 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_SETCHECKDOCOPT : { - ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam; + // If nothing is changed by user, then we allow to set this value + if (((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection == ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetectionOriginalValue) + ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam; return TRUE; } diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 499421473..aac845325 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -2344,6 +2344,8 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._fileAutoDetection = cdAutoUpdateGo2end; else //(!strcmp(val, "no")) _nppGUI._fileAutoDetection = cdDisabled; + + _nppGUI._fileAutoDetectionOriginalValue = _nppGUI._fileAutoDetection; } } } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index f11e1748b..bca89cacb 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -531,7 +531,7 @@ struct NppGUI { NppGUI() : _toolBarStatus(TB_LARGE), _toolbarShow(true), _statusBarShow(true), _menuBarShow(true),\ _tabStatus(TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP), _splitterPos(POS_HORIZOTAL),\ - _userDefineDlgStatus(UDD_DOCKED), _tabSize(8), _tabReplacedBySpace(false), _fileAutoDetection(cdEnabled),\ + _userDefineDlgStatus(UDD_DOCKED), _tabSize(8), _tabReplacedBySpace(false), _fileAutoDetection(cdEnabled), _fileAutoDetectionOriginalValue(_fileAutoDetection),\ _checkHistoryFiles(true) ,_enableSmartHilite(true), _enableTagsMatchHilite(true), _enableTagAttrsHilite(true),\ _isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false),\ _doTaskList(true), _maitainIndent(true), _saveOpenKeepInSameDir(false), _styleMRU(true), _styleURL(0),\ @@ -566,6 +566,7 @@ struct NppGUI bool _tabReplacedBySpace; ChangeDetect _fileAutoDetection; + ChangeDetect _fileAutoDetectionOriginalValue; bool _checkHistoryFiles; RECT _appPos; diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 4fa7854db..8d4fbc74f 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -1,5 +1,5 @@ //this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +//Copyright (C)2003 Don HO < donho@altern.org > // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License