Fix value in config.xml does not match user's preference in Column Editor

Fix #13370
pull/13441/head
Don Ho 2 years ago
parent 57667d136f
commit d37c7c396a

@ -2495,9 +2495,9 @@ void NppParameters::feedColumnEditorParameters(TiXmlNode *node)
if (strVal)
{
if (lstrcmp(strVal, TEXT("text")) == 0)
_columnEditParam._mainChoice = false;
_columnEditParam._mainChoice = activeText;
else
_columnEditParam._mainChoice = true;
_columnEditParam._mainChoice = activeNumeric;
}
TiXmlNode *childNode = columnEditorRoot->FirstChildElement(TEXT("text"));
if (!childNode) return;
@ -4101,7 +4101,7 @@ bool NppParameters::writeColumnEditorSettings() const
// Create the new ColumnEditor root
TiXmlElement columnEditorRootNode{TEXT("ColumnEditor")};
(columnEditorRootNode.ToElement())->SetAttribute(TEXT("choice"), _columnEditParam._mainChoice ? L"number" : L"text");
(columnEditorRootNode.ToElement())->SetAttribute(TEXT("choice"), _columnEditParam._mainChoice == activeNumeric ? L"number" : L"text");
TiXmlElement textNode{ TEXT("text") };
(textNode.ToElement())->SetAttribute(TEXT("content"), _columnEditParam._insertedTextContent.c_str());

@ -73,6 +73,8 @@ const int TAB_HIDE = 256; //0001 0000 0000
const int TAB_QUITONEMPTY = 512; //0010 0000 0000
const int TAB_ALTICONS = 1024; //0100 0000 0000
const bool activeText = true;
const bool activeNumeric = false;
enum class EolType: std::uint8_t
{
@ -1211,7 +1213,7 @@ struct ColumnEditorParam final
{
enum leadingChoice : UCHAR { noneLeading, zeroLeading, spaceLeading };
bool _mainChoice = true; // true (1): text false (0): number
bool _mainChoice = activeNumeric;
std::wstring _insertedTextContent;

@ -136,7 +136,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
if (NppDarkMode::isEnabled())
{
const ColumnEditorParam& colEditParam = NppParameters::getInstance()._columnEditParam;
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_FORMAT_GRP_STATIC), !colEditParam._mainChoice);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_FORMAT_GRP_STATIC), colEditParam._mainChoice == activeNumeric);
}
NppDarkMode::autoThemeChildControls(_hSelf);
return TRUE;

@ -22,8 +22,6 @@
class ScintillaEditView;
const bool activeText = true;
const bool activeNumeric = false;
class ColumnEditorDlg : public StaticDialog
{

Loading…
Cancel
Save