From 5c4f02b84cf981da441ea130deca3109f6754914 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sun, 26 Oct 2014 20:07:34 +0800 Subject: [PATCH] Feature #171 Fold element does not fold following whitespace --- ChangeLog | 4 ++++ src/mypropertysheet.cpp | 5 +++++ src/mypropertysheet.h | 1 + src/xmlcopyeditor.cpp | 4 ++++ src/xmlctrl.cpp | 3 ++- src/xmlctrl.h | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4f6f8bf..51d80e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1.2.1.4 + + Feature #171 Fold element does not fold following whitespace + + Feature #170 I did a small patch that allows SPACE to trigger autocompletion on any space (Thanassis Tsiodras) + 1.2.1.3 2014/09/06 * Fixed problems with new documents * Bug #212 XSLT insert elements diff --git a/src/mypropertysheet.cpp b/src/mypropertysheet.cpp index 0bca771..2f09b42 100644 --- a/src/mypropertysheet.cpp +++ b/src/mypropertysheet.cpp @@ -77,6 +77,9 @@ MyPropertySheet::MyPropertySheet ( foldBox = new wxCheckBox ( editorPanel, wxID_ANY, _ ( "&Folding" ) ); foldBox->SetValue ( properties.fold ); + foldCompactBox = + new wxCheckBox ( editorPanel, wxID_ANY, _ ( "Fol&d blank lines" ) ); + foldCompactBox->SetValue ( properties.foldCompact ); currentLineBox = new wxCheckBox ( editorPanel, wxID_ANY, _ ( "&Highlight current line" ) ); currentLineBox->SetValue ( properties.currentLine ); @@ -126,6 +129,7 @@ MyPropertySheet::MyPropertySheet ( col1sizer->Add ( insertCloseTagBox, 0, wxALL | wxALIGN_LEFT, 5 ); col1sizer->Add ( foldBox, 0, wxALL | wxALIGN_LEFT, 5 ); + col1sizer->Add ( foldCompactBox, 0, wxALL | wxALIGN_LEFT, 5 ); col1sizer->Add ( currentLineBox, 0, wxALL | wxALIGN_LEFT, 5 ); col1sizer->Add ( highlightSyntaxBox, 0, wxALL | wxALIGN_LEFT, 5 ); col1sizer->Add ( indentLinesBox, 0, wxALL | wxALIGN_LEFT, 5 ); @@ -262,6 +266,7 @@ void MyPropertySheet::OnOk ( wxCommandEvent& e ) properties.completion = completionBox->GetValue(); properties.fold = foldBox->GetValue(); + properties.foldCompact = foldCompactBox->GetValue(); properties.number = numberBox->GetValue(); properties.currentLine = currentLineBox->GetValue(); properties.whitespaceVisible = whitespaceVisibleBox->GetValue(); diff --git a/src/mypropertysheet.h b/src/mypropertysheet.h index bf215b7..b71a595 100644 --- a/src/mypropertysheet.h +++ b/src/mypropertysheet.h @@ -62,6 +62,7 @@ class MyPropertySheet : public wxPropertySheetDialog wxCheckBox *completionBox, *currentLineBox, *foldBox, + *foldCompactBox, *numberBox, *whitespaceVisibleBox, *indentLinesBox, diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index f3858a1..34ecf48 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -688,6 +688,8 @@ MyFrame::MyFrame ( config->Read ( _T ( "number" ), true ); properties.fold = config->Read ( _T ( "fold" ), true ); + properties.foldCompact = + config->Read ( _T ( "foldCompact" ), true ); properties.currentLine = config->Read ( _T ( "currentLine" ), true ); properties.highlightSyntax = @@ -854,6 +856,7 @@ MyFrame::MyFrame ( largeFileProperties.completion = false; largeFileProperties.fold = false; + largeFileProperties.foldCompact = false; largeFileProperties.whitespaceVisible = false; largeFileProperties.wrap = false; largeFileProperties.indentLines = false; @@ -1082,6 +1085,7 @@ MyFrame::~MyFrame() config->Write ( _T ( "completion" ), properties.completion ); config->Write ( _T ( "number" ), properties.number ); config->Write ( _T ( "fold" ), properties.fold ); + config->Write ( _T ( "foldCompact" ), properties.foldCompact ); config->Write ( _T ( "currentLine" ), properties.currentLine ); config->Write ( _T ( "whitespaceVisible" ), properties.whitespaceVisible ); config->Write ( _T ( "wrap" ), properties.wrap ); diff --git a/src/xmlctrl.cpp b/src/xmlctrl.cpp index bd1bc7c..bec2070 100644 --- a/src/xmlctrl.cpp +++ b/src/xmlctrl.cpp @@ -1233,8 +1233,9 @@ void XmlCtrl::applyProperties ( wxString value = ( properties.fold && type != FILE_TYPE_BINARY ) ? _T ( "1" ) : _T ( "0" ); SetProperty ( _T ( "fold" ), value ); - SetProperty ( _T ( "fold.compact" ), value ); SetProperty ( _T ( "fold.html" ), value ); + value = properties.foldCompact ? value : _T("0"); + SetProperty ( _T ( "fold.compact" ), value ); } void XmlCtrl::OnMarginClick ( wxStyledTextEvent& event ) diff --git a/src/xmlctrl.h b/src/xmlctrl.h index aa4f432..160899e 100644 --- a/src/xmlctrl.h +++ b/src/xmlctrl.h @@ -36,6 +36,7 @@ struct XmlCtrlProperties { bool completion; bool fold; + bool foldCompact; bool number; bool currentLine; bool whitespaceVisible;