- enhancement: fill indents in the editor (Turned off by default)

This commit is contained in:
royqh1979@gmail.com 2021-10-20 11:14:49 +08:00
parent d188d8897f
commit 25d83d0e8d
12 changed files with 186 additions and 109 deletions

View File

@ -1,6 +1,7 @@
Version 0.7.0 Version 0.7.0
- fix: Backspace still works in readonly mode - fix: Backspace still works in readonly mode
- fix: save as file dialog's operation mode is not correct - fix: save as file dialog's operation mode is not correct
- enhancement: fill indents in the editor (Turned off by default)
Version 0.6.8 Version 0.6.8
- enhancement: add link to cppreference in the help menu - enhancement: add link to cppreference in the help menu

Binary file not shown.

View File

@ -933,11 +933,11 @@ Are you really want to continue?</source>
<message> <message>
<location filename="editor.cpp" line="213"/> <location filename="editor.cpp" line="213"/>
<location filename="editor.cpp" line="227"/> <location filename="editor.cpp" line="227"/>
<location filename="editor.cpp" line="298"/> <location filename="editor.cpp" line="303"/>
<location filename="editor.cpp" line="1125"/>
<location filename="editor.cpp" line="1130"/> <location filename="editor.cpp" line="1130"/>
<location filename="editor.cpp" line="1148"/> <location filename="editor.cpp" line="1135"/>
<location filename="editor.cpp" line="1153"/> <location filename="editor.cpp" line="1153"/>
<location filename="editor.cpp" line="1158"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -947,60 +947,60 @@ Are you really want to continue?</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="252"/> <location filename="editor.cpp" line="256"/>
<source>Save As</source> <source>Save As</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1126"/> <location filename="editor.cpp" line="1131"/>
<source>The text to be copied exceeds count limit!</source> <source>The text to be copied exceeds count limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1131"/> <location filename="editor.cpp" line="1136"/>
<source>The text to be copied exceeds character limit!</source> <source>The text to be copied exceeds character limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1149"/> <location filename="editor.cpp" line="1154"/>
<source>The text to be cut exceeds count limit!</source> <source>The text to be cut exceeds count limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1154"/> <location filename="editor.cpp" line="1159"/>
<source>The text to be cut exceeds character limit!</source> <source>The text to be cut exceeds character limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="2122"/> <location filename="editor.cpp" line="2127"/>
<source>Print Document</source> <source>Print Document</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="2669"/> <location filename="editor.cpp" line="2674"/>
<location filename="editor.cpp" line="2706"/> <location filename="editor.cpp" line="2711"/>
<location filename="editor.cpp" line="2757"/> <location filename="editor.cpp" line="2762"/>
<source>Ctrl+click for more info</source> <source>Ctrl+click for more info</source>
<translation>Ctrl+</translation> <translation>Ctrl+</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3102"/> <location filename="editor.cpp" line="3107"/>
<location filename="editor.cpp" line="3132"/> <location filename="editor.cpp" line="3137"/>
<source>Symbol &apos;%1&apos; not found!</source> <source>Symbol &apos;%1&apos; not found!</source>
<translation>&apos;%1&apos;!</translation> <translation>&apos;%1&apos;!</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3521"/> <location filename="editor.cpp" line="3526"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3522"/> <location filename="editor.cpp" line="3527"/>
<source>Enter the condition of the breakpoint:</source> <source>Enter the condition of the breakpoint:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3698"/> <location filename="editor.cpp" line="3704"/>
<source>Readonly</source> <source>Readonly</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4857,175 +4857,175 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1397"/> <location filename="settings.cpp" line="1409"/>
<location filename="settings.cpp" line="1416"/>
<location filename="settings.cpp" line="1428"/> <location filename="settings.cpp" line="1428"/>
<location filename="settings.cpp" line="1440"/> <location filename="settings.cpp" line="1440"/>
<location filename="settings.cpp" line="1452"/>
<source>The following %1 directories don&apos;t exist:</source> <source>The following %1 directories don&apos;t exist:</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1398"/> <location filename="settings.cpp" line="1410"/>
<location filename="settings.cpp" line="1408"/> <location filename="settings.cpp" line="1420"/>
<source>binary</source> <source>binary</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1407"/> <location filename="settings.cpp" line="1419"/>
<source>No %1 directories have been specified.</source> <source>No %1 directories have been specified.</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1417"/> <location filename="settings.cpp" line="1429"/>
<source>C include</source> <source>C include</source>
<translation>C包含</translation> <translation>C包含</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1429"/>
<location filename="settings.cpp" line="1441"/> <location filename="settings.cpp" line="1441"/>
<location filename="settings.cpp" line="1453"/>
<source>C++ include</source> <source>C++ include</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1460"/> <location filename="settings.cpp" line="1472"/>
<location filename="settings.cpp" line="1465"/> <location filename="settings.cpp" line="1477"/>
<location filename="settings.cpp" line="1470"/> <location filename="settings.cpp" line="1482"/>
<location filename="settings.cpp" line="1475"/> <location filename="settings.cpp" line="1487"/>
<source>Cannot find the %1 &quot;%2&quot;</source> <source>Cannot find the %1 &quot;%2&quot;</source>
<translation>%1&quot;%2&quot;</translation> <translation>%1&quot;%2&quot;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2003"/> <location filename="settings.cpp" line="2015"/>
<source>C options</source> <source>C options</source>
<translation>C语言选项</translation> <translation>C语言选项</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2004"/> <location filename="settings.cpp" line="2016"/>
<source>Support all ANSI standard C programs (-ansi)</source> <source>Support all ANSI standard C programs (-ansi)</source>
<translation>ANSI标准C程序(-ansi)</translation> <translation>ANSI标准C程序(-ansi)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2005"/> <location filename="settings.cpp" line="2017"/>
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source> <source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
<translation>asminline和typeof作为关键字(-fno-asm)</translation> <translation>asminline和typeof作为关键字(-fno-asm)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2006"/> <location filename="settings.cpp" line="2018"/>
<source>Imitate traditional C preprocessors (-traditional-cpp)</source> <source>Imitate traditional C preprocessors (-traditional-cpp)</source>
<translation>仿C预处理器行为(-traditional-cpp)</translation> <translation>仿C预处理器行为(-traditional-cpp)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2009"/> <location filename="settings.cpp" line="2021"/>
<source>Code Generation</source> <source>Code Generation</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2038"/> <location filename="settings.cpp" line="2050"/>
<source>Optimize for the following machine (-march)</source> <source>Optimize for the following machine (-march)</source>
<translation>(-march)</translation> <translation>(-march)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2039"/> <location filename="settings.cpp" line="2051"/>
<source>Optimize less, while maintaining full compatibility (-tune)</source> <source>Optimize less, while maintaining full compatibility (-tune)</source>
<translation>(-tune)</translation> <translation>(-tune)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2059"/> <location filename="settings.cpp" line="2071"/>
<source>Enable use of specific instructions (-mx)</source> <source>Enable use of specific instructions (-mx)</source>
<translation>(-mx)</translation> <translation>(-mx)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2070"/> <location filename="settings.cpp" line="2082"/>
<source>Optimization level (-Ox)</source> <source>Optimization level (-Ox)</source>
<translation>(-Ox)</translation> <translation>(-Ox)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2077"/> <location filename="settings.cpp" line="2089"/>
<source>Compile with the following pointer size (-mx)</source> <source>Compile with the following pointer size (-mx)</source>
<translation>使(-mx)</translation> <translation>使(-mx)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2100"/> <location filename="settings.cpp" line="2112"/>
<source>Language standard (-std)</source> <source>Language standard (-std)</source>
<translation>(-std)</translation> <translation>(-std)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2113"/> <location filename="settings.cpp" line="2125"/>
<source>Profile</source> <source>Profile</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2122"/> <location filename="settings.cpp" line="2134"/>
<source>Generate debugging information (-g3)</source> <source>Generate debugging information (-g3)</source>
<translation>(-g3)</translation> <translation>(-g3)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2114"/> <location filename="settings.cpp" line="2126"/>
<source>Generate profiling info for analysis (-pg)</source> <source>Generate profiling info for analysis (-pg)</source>
<translation>(-pg)</translation> <translation>(-pg)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2103"/> <location filename="settings.cpp" line="2115"/>
<source>Warnings</source> <source>Warnings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2104"/> <location filename="settings.cpp" line="2116"/>
<source>Inhibit all warning messages (-w)</source> <source>Inhibit all warning messages (-w)</source>
<translation>(-w)</translation> <translation>(-w)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2105"/> <location filename="settings.cpp" line="2117"/>
<source>Show most warnings (-Wall)</source> <source>Show most warnings (-Wall)</source>
<translation>(-Wall)</translation> <translation>(-Wall)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2106"/> <location filename="settings.cpp" line="2118"/>
<source>Show some more warnings (-Wextra)</source> <source>Show some more warnings (-Wextra)</source>
<translation>(-Wextra)</translation> <translation>(-Wextra)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2107"/> <location filename="settings.cpp" line="2119"/>
<source>Check ISO C/C++/C++0x conformance (-pedantic)</source> <source>Check ISO C/C++/C++0x conformance (-pedantic)</source>
<translation>ISO C/C++/C++0x(-pedantic)</translation> <translation>ISO C/C++/C++0x(-pedantic)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2108"/> <location filename="settings.cpp" line="2120"/>
<source>Only check the code for syntax errors (-fsyntax-only)</source> <source>Only check the code for syntax errors (-fsyntax-only)</source>
<translation>(-fsyntax-only)</translation> <translation>(-fsyntax-only)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2109"/> <location filename="settings.cpp" line="2121"/>
<source>Make all warnings into errors (-Werror)</source> <source>Make all warnings into errors (-Werror)</source>
<translation>(-Werror)</translation> <translation>(-Werror)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2110"/> <location filename="settings.cpp" line="2122"/>
<source>Abort compilation on first error (-Wfatal-errors)</source> <source>Abort compilation on first error (-Wfatal-errors)</source>
<translation>(-Wfatal-errors)</translation> <translation>(-Wfatal-errors)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2117"/> <location filename="settings.cpp" line="2129"/>
<source>Linker</source> <source>Linker</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2118"/> <location filename="settings.cpp" line="2130"/>
<source>Link an Objective C program (-lobjc)</source> <source>Link an Objective C program (-lobjc)</source>
<translation>Objective-C程序 (-lobjc)</translation> <translation>Objective-C程序 (-lobjc)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2119"/> <location filename="settings.cpp" line="2131"/>
<source>Do not use standard system libraries (-nostdlib)</source> <source>Do not use standard system libraries (-nostdlib)</source>
<translation>使(-nostdlib)</translation> <translation>使(-nostdlib)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2120"/> <location filename="settings.cpp" line="2132"/>
<source>Do not create a console window (-mwindows)</source> <source>Do not create a console window (-mwindows)</source>
<translation>(-mwindows)</translation> <translation>(-mwindows)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2121"/> <location filename="settings.cpp" line="2133"/>
<source>Strip executable (-s)</source> <source>Strip executable (-s)</source>
<translation>(-s)</translation> <translation>(-s)</translation>
</message> </message>
@ -5034,43 +5034,43 @@ Are you really want to continue?</source>
<translation type="vanished">Ojbective C程序(-lobjc)</translation> <translation type="vanished">Ojbective C程序(-lobjc)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2125"/> <location filename="settings.cpp" line="2137"/>
<source>Output</source> <source>Output</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2126"/> <location filename="settings.cpp" line="2138"/>
<source>Put comments in generated assembly code (-fverbose-asm)</source> <source>Put comments in generated assembly code (-fverbose-asm)</source>
<translation>(-fverbose-asm)</translation> <translation>(-fverbose-asm)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2128"/> <location filename="settings.cpp" line="2140"/>
<source>Use pipes instead of temporary files during compilation (-pipe)</source> <source>Use pipes instead of temporary files during compilation (-pipe)</source>
<translation>使(-pipe)</translation> <translation>使(-pipe)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2127"/> <location filename="settings.cpp" line="2139"/>
<source>Do not assemble, compile and generate the assemble code (-S)</source> <source>Do not assemble, compile and generate the assemble code (-S)</source>
<translation>(-S)</translation> <translation>(-S)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2344"/> <location filename="settings.cpp" line="2356"/>
<location filename="settings.cpp" line="2369"/> <location filename="settings.cpp" line="2381"/>
<source>Confirm</source> <source>Confirm</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2345"/> <location filename="settings.cpp" line="2357"/>
<source>The following problems were found during validation of compiler set &quot;%1&quot;:</source> <source>The following problems were found during validation of compiler set &quot;%1&quot;:</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2370"/> <location filename="settings.cpp" line="2382"/>
<source>Compiler set not configuared.</source> <source>Compiler set not configuared.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2372"/> <location filename="settings.cpp" line="2384"/>
<source>Would you like Red Panda C++ to search for compilers in the following locations: &lt;BR /&gt;&apos;%1&apos;&lt;BR /&gt;&apos;%2&apos;? </source> <source>Would you like Red Panda C++ to search for compilers in the following locations: &lt;BR /&gt;&apos;%1&apos;&lt;BR /&gt;&apos;%2&apos;? </source>
<translation>C++&lt;br /&gt;%1&lt;br /&gt;%2</translation> <translation>C++&lt;br /&gt;%1&lt;br /&gt;%2</translation>
</message> </message>
@ -6097,8 +6097,8 @@ Are you really want to continue?</source>
<context> <context>
<name>SynEdit</name> <name>SynEdit</name>
<message> <message>
<location filename="qsynedit/TextPainter.cpp" line="909"/> <location filename="qsynedit/TextPainter.cpp" line="936"/>
<location filename="qsynedit/TextPainter.cpp" line="910"/> <location filename="qsynedit/TextPainter.cpp" line="937"/>
<source>The highlighter seems to be in an infinite loop</source> <source>The highlighter seems to be in an infinite loop</source>
<translation></translation> <translation></translation>
</message> </message>
@ -6320,87 +6320,92 @@ Are you really want to continue?</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="129"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="126"/>
<source>Fill Indents</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="136"/>
<source>Caret</source> <source>Caret</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="135"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="142"/>
<source>Move caret to the first non-space char in the current line when press HOME key</source> <source>Move caret to the first non-space char in the current line when press HOME key</source>
<translation>HOME键时</translation> <translation>HOME键时</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="142"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="149"/>
<source>Move caret to the last non-space char in the current line when press END key</source> <source>Move caret to the last non-space char in the current line when press END key</source>
<translation>End键时</translation> <translation>End键时</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="149"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="156"/>
<source>Keep X position of the caret when moving vertically</source> <source>Keep X position of the caret when moving vertically</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="184"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="191"/>
<source>Caret for inserting mode</source> <source>Caret for inserting mode</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="221"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="228"/>
<source>Use text color as caret color</source> <source>Use text color as caret color</source>
<translation>使</translation> <translation>使</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="234"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="241"/>
<source>Scroll</source> <source>Scroll</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="240"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="247"/>
<source>Auto hide scroll bars</source> <source>Auto hide scroll bars</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="247"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="254"/>
<source>Can scroll the last char to the left edge of the editor</source> <source>Can scroll the last char to the left edge of the editor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="254"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="261"/>
<source>Can scroll the last line to the top edge of the editor</source> <source>Can scroll the last line to the top edge of the editor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="261"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="268"/>
<source>Page Up/Down scrolls half a page</source> <source>Page Up/Down scrolls half a page</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="268"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="275"/>
<source>Forces page scroll to be one line less</source> <source>Forces page scroll to be one line less</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="278"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="285"/>
<source>Show right edge line</source> <source>Show right edge line</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="290"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="297"/>
<source>Right egde width</source> <source>Right egde width</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="342"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="349"/>
<source>Right edge line color</source> <source>Right edge line color</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="214"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="221"/>
<source>Caret for overwriting mode</source> <source>Caret for overwriting mode</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="194"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="201"/>
<source>Caret Color</source> <source>Caret Color</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -3581,6 +3581,7 @@ void Editor::applySettings()
codeFolding().indentGuides = pSettings->editor().showIndentLines(); codeFolding().indentGuides = pSettings->editor().showIndentLines();
codeFolding().indentGuidesColor = pSettings->editor().indentLineColor(); codeFolding().indentGuidesColor = pSettings->editor().indentLineColor();
codeFolding().fillIndents = pSettings->editor().fillIndents();
QFont f=QFont(pSettings->editor().fontName(),pSettings->editor().fontSize()); QFont f=QFont(pSettings->editor().fontName(),pSettings->editor().fontSize());
f.setStyleStrategy(QFont::PreferAntialias); f.setStyleStrategy(QFont::PreferAntialias);

View File

@ -23,6 +23,7 @@ PSynEditFoldRegion SynEditFoldRegions::get(int index)
} }
SynEditCodeFolding::SynEditCodeFolding(): SynEditCodeFolding::SynEditCodeFolding():
fillIndents(false),
indentGuides(true), indentGuides(true),
showCollapsedLine(true), showCollapsedLine(true),
collapsedLineColor(QColor("black")), collapsedLineColor(QColor("black")),

View File

@ -29,6 +29,7 @@ struct SynEditFoldRegion {
struct SynEditCodeFolding { struct SynEditCodeFolding {
bool indentGuides; bool indentGuides;
bool fillIndents;
bool showCollapsedLine; bool showCollapsedLine;
QColor collapsedLineColor; QColor collapsedLineColor;
QColor folderBarLinesColor; QColor folderBarLinesColor;

View File

@ -650,12 +650,17 @@ void SynEditTextPainter::PaintFoldAttributes()
// Paint indent guides. Use folds to determine indent value of these // Paint indent guides. Use folds to determine indent value of these
// Use a separate loop so we can use a custom pen // Use a separate loop so we can use a custom pen
// Paint indent guides using custom pen // Paint indent guides using custom pen
if (edit->mCodeFolding.indentGuides) { if (edit->mCodeFolding.indentGuides || edit->mCodeFolding.fillIndents) {
QPen dottedPen(Qt::PenStyle::DashLine); QColor paintColor;
dottedPen.setColor(edit->mCodeFolding.indentGuidesColor); if (edit->mCodeFolding.indentGuidesColor.isValid()) {
paintColor = edit->mCodeFolding.indentGuidesColor;
} else {
paintColor = edit->palette().color(QPalette::Text);
}
QColor gradientStart = paintColor;
QColor gradientEnd = paintColor;
QPen oldPen = painter->pen(); QPen oldPen = painter->pen();
painter->setPen(dottedPen);
// Now loop through all the lines. The indices are valid for Lines. // Now loop through all the lines. The indices are valid for Lines.
for (cRow = aFirstRow; cRow<=aLastRow;cRow++) { for (cRow = aFirstRow; cRow<=aLastRow;cRow++) {
vLine = edit->rowToLine(cRow); vLine = edit->rowToLine(cRow);
@ -682,23 +687,45 @@ void SynEditTextPainter::PaintFoldAttributes()
//TabSteps = edit->mTabWidth; //TabSteps = edit->mTabWidth;
TabSteps = 0; TabSteps = 0;
indentLevel = 0; indentLevel = 0;
while (TabSteps < LineIndent) { while (TabSteps < LineIndent) {
X = TabSteps * edit->mCharWidth + edit->textOffset() - 2; X = TabSteps * edit->mCharWidth + edit->textOffset() - 2;
TabSteps+=edit->mTabWidth; TabSteps+=edit->mTabWidth;
indentLevel++ ; indentLevel++ ;
if (edit->mHighlighter) { if (edit->mHighlighter) {
if (edit->mCodeFolding.indentGuides) {
PSynHighlighterAttribute attr = edit->mHighlighter->symbolAttribute(); PSynHighlighterAttribute attr = edit->mHighlighter->symbolAttribute();
GetBraceColorAttr(indentLevel,attr); GetBraceColorAttr(indentLevel,attr);
if (attr!=edit->mHighlighter->symbolAttribute()) { paintColor = attr->foreground();
dottedPen.setColor(attr->foreground());
painter->setPen(dottedPen);
} }
if (edit->mCodeFolding.fillIndents) {
PSynHighlighterAttribute attr = edit->mHighlighter->symbolAttribute();
GetBraceColorAttr(indentLevel,attr);
gradientStart=attr->foreground();
attr = edit->mHighlighter->symbolAttribute();
GetBraceColorAttr(indentLevel+1,attr);
gradientStart=attr->foreground();
}
}
if (edit->mCodeFolding.fillIndents) {
int X1=TabSteps * edit->mCharWidth + edit->textOffset() - 2;
gradientStart.setAlpha(20);
gradientEnd.setAlpha(10);
QLinearGradient gradient(X,Y,X1,Y);
gradient.setColorAt(0,gradientStart);
gradient.setColorAt(1,gradientEnd);
painter->fillRect(X,Y,edit->mTabWidth * edit->mCharWidth,edit->mTextHeight,gradient);
} }
// Move to top of vertical line // Move to top of vertical line
if (edit->mCodeFolding.indentGuides) {
QPen dottedPen(Qt::PenStyle::DashLine);
dottedPen.setColor(paintColor);
painter->setPen(dottedPen);
painter->drawLine(X,Y,X,Y+edit->mTextHeight); painter->drawLine(X,Y,X,Y+edit->mTextHeight);
} }
} }
}
painter->setPen(oldPen); painter->setPen(oldPen);
} }
@ -920,18 +947,24 @@ void SynEditTextPainter::PaintLines()
} }
// It's at least partially visible. Get the token attributes now. // It's at least partially visible. Get the token attributes now.
attr = edit->mHighlighter->getTokenAttribute(); attr = edit->mHighlighter->getTokenAttribute();
if (sToken == "[") { if (sToken == "["
GetBraceColorAttr(edit->mHighlighter->getRangeState().bracketLevel,attr); || sToken == "("
} else if (sToken == "]") { || sToken == "{"
GetBraceColorAttr(edit->mHighlighter->getRangeState().bracketLevel+1,attr); ) {
} else if (sToken == "(") { SynRangeState rangeState = edit->mHighlighter->getRangeState();
GetBraceColorAttr(edit->mHighlighter->getRangeState().parenthesisLevel,attr); GetBraceColorAttr(rangeState.bracketLevel
} else if (sToken == ")") { +rangeState.braceLevel
GetBraceColorAttr(edit->mHighlighter->getRangeState().parenthesisLevel+1,attr); +rangeState.parenthesisLevel
} else if (sToken == "{") { ,attr);
GetBraceColorAttr(edit->mHighlighter->getRangeState().braceLevel,attr); } else if (sToken == "]"
} else if (sToken == "}") { || sToken == ")"
GetBraceColorAttr(edit->mHighlighter->getRangeState().braceLevel+1,attr); || sToken == "}"
){
SynRangeState rangeState = edit->mHighlighter->getRangeState();
GetBraceColorAttr(rangeState.bracketLevel
+rangeState.braceLevel
+rangeState.parenthesisLevel+1,
attr);
} }
if (bCurrentLine && edit->mInputPreeditString.length()>0) { if (bCurrentLine && edit->mInputPreeditString.length()>0) {
int startPos = edit->mHighlighter->getTokenPos()+1; int startPos = edit->mHighlighter->getTokenPos()+1;

View File

@ -487,6 +487,16 @@ void Settings::Editor::setShowFunctionTips(bool newShowFunctionTips)
mShowFunctionTips = newShowFunctionTips; mShowFunctionTips = newShowFunctionTips;
} }
bool Settings::Editor::fillIndents() const
{
return mfillIndents;
}
void Settings::Editor::setFillIndents(bool newFillIndents)
{
mfillIndents = newFillIndents;
}
bool Settings::Editor::enableTooltips() const bool Settings::Editor::enableTooltips() const
{ {
return mEnableTooltips; return mEnableTooltips;
@ -957,6 +967,7 @@ void Settings::Editor::doSave()
saveValue("tab_width", mTabWidth); saveValue("tab_width", mTabWidth);
saveValue("show_indent_lines", mShowIndentLines); saveValue("show_indent_lines", mShowIndentLines);
saveValue("indent_line_color",mIndentLineColor); saveValue("indent_line_color",mIndentLineColor);
saveValue("fill_indents",mfillIndents);
// caret // caret
saveValue("enhance_home_key",mEnhanceHomeKey); saveValue("enhance_home_key",mEnhanceHomeKey);
saveValue("enhance_end_key",mEnhanceEndKey); saveValue("enhance_end_key",mEnhanceEndKey);
@ -1063,6 +1074,7 @@ void Settings::Editor::doLoad()
mTabWidth = intValue("tab_width",4); mTabWidth = intValue("tab_width",4);
mShowIndentLines = boolValue("show_indent_lines",true); mShowIndentLines = boolValue("show_indent_lines",true);
mIndentLineColor = colorValue("indent_line_color",QColorConstants::Svg::silver); mIndentLineColor = colorValue("indent_line_color",QColorConstants::Svg::silver);
mfillIndents = boolValue("fill_indents", false);
// caret // caret
mEnhanceHomeKey = boolValue("enhance_home_key", true); mEnhanceHomeKey = boolValue("enhance_home_key", true);
mEnhanceEndKey = boolValue("enhance_end_key",true); mEnhanceEndKey = boolValue("enhance_end_key",true);

View File

@ -320,6 +320,9 @@ public:
bool showFunctionTips() const; bool showFunctionTips() const;
void setShowFunctionTips(bool newShowFunctionTips); void setShowFunctionTips(bool newShowFunctionTips);
bool fillIndents() const;
void setFillIndents(bool newFillIndents);
private: private:
//General //General
// indents // indents
@ -329,6 +332,7 @@ public:
int mTabWidth; int mTabWidth;
bool mShowIndentLines; bool mShowIndentLines;
QColor mIndentLineColor; QColor mIndentLineColor;
bool mfillIndents;
// caret // caret
bool mEnhanceHomeKey; bool mEnhanceHomeKey;
bool mEnhanceEndKey; bool mEnhanceEndKey;

View File

@ -44,6 +44,7 @@ void EditorGeneralWidget::doLoad()
ui->spTabWidth->setValue(pSettings->editor().tabWidth()); ui->spTabWidth->setValue(pSettings->editor().tabWidth());
ui->chkShowIndentLines->setChecked(pSettings->editor().showIndentLines()); ui->chkShowIndentLines->setChecked(pSettings->editor().showIndentLines());
ui->colorIndentLine->setColor(pSettings->editor().indentLineColor()); ui->colorIndentLine->setColor(pSettings->editor().indentLineColor());
ui->chkFillIndents->setChecked(pSettings->editor().fillIndents());
//carets //carets
ui->chkEnhanceHome->setChecked(pSettings->editor().enhanceHomeKey()); ui->chkEnhanceHome->setChecked(pSettings->editor().enhanceHomeKey());
ui->chkEnhanceEndKey->setChecked(pSettings->editor().enhanceEndKey()); ui->chkEnhanceEndKey->setChecked(pSettings->editor().enhanceEndKey());
@ -73,6 +74,8 @@ void EditorGeneralWidget::doSave()
pSettings->editor().setTabWidth(ui->spTabWidth->value()); pSettings->editor().setTabWidth(ui->spTabWidth->value());
pSettings->editor().setShowIndentLines(ui->chkShowIndentLines->isChecked()); pSettings->editor().setShowIndentLines(ui->chkShowIndentLines->isChecked());
pSettings->editor().setIndentLineColor(ui->colorIndentLine->color()); pSettings->editor().setIndentLineColor(ui->colorIndentLine->color());
pSettings->editor().setFillIndents(ui->chkFillIndents->isChecked());
//carets //carets
pSettings->editor().setEnhanceHomeKey(ui->chkEnhanceHome->isChecked()); pSettings->editor().setEnhanceHomeKey(ui->chkEnhanceHome->isChecked());
pSettings->editor().setEnhanceEndKey(ui->chkEnhanceEndKey->isChecked()); pSettings->editor().setEnhanceEndKey(ui->chkEnhanceEndKey->isChecked());

View File

@ -120,6 +120,13 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="chkFillIndents">
<property name="text">
<string>Fill Indents</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -5,8 +5,8 @@
#define DEVCPP_VERSION "0.6.9" #define DEVCPP_VERSION "0.6.9"
#ifdef Q_OS_WIN
#define APP_SETTSINGS_FILENAME "redpandacpp.ini" #define APP_SETTSINGS_FILENAME "redpandacpp.ini"
#ifdef Q_OS_WIN
#define GCC_PROGRAM "gcc.exe" #define GCC_PROGRAM "gcc.exe"
#define GPP_PROGRAM "g++.exe" #define GPP_PROGRAM "g++.exe"
#define GDB_PROGRAM "gdb.exe" #define GDB_PROGRAM "gdb.exe"
@ -16,8 +16,17 @@
#define GPROF_PROGRAM "gprof.exe" #define GPROF_PROGRAM "gprof.exe"
#define CLEAN_PROGRAM "del /q /f" #define CLEAN_PROGRAM "del /q /f"
#define CPP_PROGRAM "cpp.exe" #define CPP_PROGRAM "cpp.exe"
#elif defined(Q_OS_LINUX)
#define GCC_PROGRAM "gcc"
#define GPP_PROGRAM "g++"
#define GDB_PROGRAM "gdb"
#define GDB32_PROGRAM "gdb32"
#define MAKE_PROGRAM "make"
#define GPROF_PROGRAM "gprof"
#define CLEAN_PROGRAM "rm -rf"
#define CPP_PROGRAM "cpp"
#else #else
#error "Only support windows now!" #error "Only support windows and linux now!"
#endif #endif
#define DEV_PROJECT_EXT "dev" #define DEV_PROJECT_EXT "dev"
@ -46,7 +55,7 @@
# define STATIC_LIB_EXT "a" # define STATIC_LIB_EXT "a"
# define DYNAMIC_LIB_EXT "dll" # define DYNAMIC_LIB_EXT "dll"
# define MAKEFILE_NAME "makefile.win" # define MAKEFILE_NAME "makefile.win"
#elif Q_OS_LINUX #elif defined(Q_OS_LINUX)
# define PATH_SENSITIVITY Qt::CaseSensitive # define PATH_SENSITIVITY Qt::CaseSensitive
# define PATH_SEPARATOR ":" # define PATH_SEPARATOR ":"
# define NULL_FILE "/dev/null" # define NULL_FILE "/dev/null"