MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / insertTextAtColumn

Method insertTextAtColumn

src/dialogs/ColumnEditorDialog.cpp:101–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void ColumnEditorDialog::insertTextAtColumn(ScintillaNext *editor, int line, int column, const QString &str)
102{
103 const int lineEndPosition = editor->lineEndPosition(line);
104 const int lineEndColumn = editor->column(lineEndPosition);
105
106 // If the line does not end past the needed column, then use the left over as virtual space
107 if (lineEndColumn < column) {
108 editor->setTargetRange(lineEndPosition, lineEndPosition);
109
110 editor->setTargetStartVirtualSpace(column - lineEndColumn);
111 editor->setTargetEndVirtualSpace(column - lineEndColumn);
112 }
113 else {
114 const int pos = editor->findColumn(line, column);
115
116 editor->setTargetRange(pos, pos);
117 }
118
119 editor->replaceTarget(-1, str.toUtf8().constData());
120}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected