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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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