MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / increaseSelectionIndent

Method increaseSelectionIndent

src/ui/codeeditor.cpp:206–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void CodeEditor::increaseSelectionIndent()
207{
208 int blockCount=getSelectionBlockCount();
209
210 QTextCursor cursor=textCursor();
211 cursor.setPosition(std::min(cursor.anchor(),cursor.position()));
212
213 cursor.beginEditBlock();
214 auto& p=Preferences::getInstance();
215 QString indent=p.getIndent();
216 for(auto i=0; i<=blockCount; ++i) {
217 cursor.movePosition(QTextCursor::StartOfBlock);
218 QTextCursor current(cursor);
219 current.movePosition(QTextCursor::EndOfBlock,QTextCursor::KeepAnchor);
220 if(current.hasSelection())
221 cursor.insertText(indent);
222 cursor.movePosition(QTextCursor::NextBlock);
223 }
224 cursor.endEditBlock();
225}
226
227void CodeEditor::decreaseSelectionIndent()
228{

Callers

nothing calls this directly

Calls 1

getIndentMethod · 0.80

Tested by

no test coverage detected