MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / ScriptEditor

Method ScriptEditor

src/scripts.cpp:526–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524};
525
526ScriptEditor::ScriptEditor(QWidget *parent) : QPlainTextEdit(parent)
527{
528 lineNumberArea = new LineNumberArea(this);
529 highlighter = new LuaHighlighter(document());
530
531 connect(this, &ScriptEditor::blockCountChanged, this, &ScriptEditor::updateLineNumberAreaWidth);
532 connect(this, &ScriptEditor::updateRequest, this, &ScriptEditor::updateLineNumberArea);
533 connect(this, &ScriptEditor::cursorPositionChanged, this, &ScriptEditor::highlightCurrentLine);
534
535 QTextOption opt = document()->defaultTextOption();
536 opt.setFlags(opt.flags() | QTextOption::ShowTabsAndSpaces);
537 document()->setDefaultTextOption(opt);
538 setLineWrapMode(LineWrapMode::NoWrap);
539
540 updateLineNumberAreaWidth(0);
541 highlightCurrentLine();
542}
543
544int ScriptEditor::lineNumberAreaWidth()
545{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected