diff --git a/NEWS.md b/NEWS.md index a7be0098..f981b5de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ Version 0.6.4 - fix: code completion popup not show after '->' inputted - fix: font styles in the color scheme settings not in effect - fix: editor's font style shouldn't affect gutter's font style + - change: enable copy as HTML by default + - fix: unneeded empty lines when copy as HTML Version 0.6.3 - fix: should use c++ syntax to check ".h" files diff --git a/RedPandaIDE/qsynedit/exporter/synexporter.cpp b/RedPandaIDE/qsynedit/exporter/synexporter.cpp index 83bfc713..03df90f8 100644 --- a/RedPandaIDE/qsynedit/exporter/synexporter.cpp +++ b/RedPandaIDE/qsynedit/exporter/synexporter.cpp @@ -99,7 +99,8 @@ void SynExporter::ExportRange(PSynEditStringList ALines, BufferCoord Start, Buff FormatToken(Token); mHighlighter->next(); } - FormatNewLine(); + if (i!=Stop.Line) + FormatNewLine(); } if (!mFirstAttribute) FormatAfterLastAttribute(); diff --git a/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp b/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp index 2f1d5f75..e39bf1ea 100644 --- a/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp +++ b/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp @@ -126,7 +126,7 @@ void SynHTMLExporter::FormatNewLine() QString SynHTMLExporter::GetFooter() { QString Result = ""; - Result = "" + lineBreak() + "" + lineBreak(); + Result = "" + lineBreak(); if (mCreateHTMLFragment) Result += ""; Result += ""+lineBreak()+ ""; @@ -172,7 +172,7 @@ QString SynHTMLExporter::GetHeader() if (mCreateHTMLFragment) { Result += ""; } - Result += QString("
"+lineBreak()+"")
+    Result += QString("
")
             .arg(mFont.pointSize())
             .arg(mFont.family());
 
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index f73fb0d1..4ceb9781 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -1108,12 +1108,12 @@ void Settings::Editor::doLoad()
     mCopySizeLimit = boolValue("copy_limit",true);
     mCopyCharLimits = intValue("copy_char_limits",100);
     mCopyLineLimits = intValue("copy_line_limits",100000);
-    mCopyWithFormatAs = intValue("copy_with_format_as",0);
+    mCopyWithFormatAs = intValue("copy_with_format_as",1);
     mCopyRTFUseBackground = boolValue("copy_rtf_use_background",false);
-    mCopyRTFUseEditorColor = boolValue("copy_rtf_use_editor_color_scheme",true);
+    mCopyRTFUseEditorColor = boolValue("copy_rtf_use_editor_color_scheme",false);
     mCopyRTFColorScheme = stringValue("copy_rtf_color_scheme","Intellij Classic");
     mCopyHTMLUseBackground = boolValue("copy_html_use_background",false);
-    mCopyHTMLUseEditorColor = boolValue("copy_html_use_editor_color_scheme",true);
+    mCopyHTMLUseEditorColor = boolValue("copy_html_use_editor_color_scheme",false);
     mCopyHTMLColorScheme = stringValue("copy_html_color_scheme","Intellij Classic");
 
     //color
diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp
index e6ca42bc..bfd002cf 100644
--- a/RedPandaIDE/utils.cpp
+++ b/RedPandaIDE/utils.cpp
@@ -820,3 +820,12 @@ void executeFile(const QString &fileName, const QString ¶ms, const QString &
                   SW_SHOW
                   );
 }
+
+void StringToFile(const QString &str, const QString &fileName)
+{
+    QFile file(fileName);
+    if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+        QTextStream stream(&file);
+        stream<