MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / commitInlineEdit

Method commitInlineEdit

src/editor.cpp:1894–1912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1892// ── Commit inline edit ──
1893
1894void RcxEditor::commitInlineEdit() {
1895 if (!m_editState.active) return;
1896
1897 QString lineText = getLineText(m_sci, m_editState.line);
1898 int currentLen = lineText.size();
1899 int delta = currentLen - m_editState.linelenAfterReplace;
1900 int editedLen = m_editState.original.size() + delta;
1901
1902 QString editedText;
1903 if (editedLen > 0)
1904 editedText = lineText.mid(m_editState.spanStart, editedLen).trimmed();
1905
1906 // For Type edits: if nothing changed, commit original
1907 if (m_editState.target == EditTarget::Type && editedText.isEmpty())
1908 editedText = m_editState.original;
1909
1910 auto info = endInlineEdit();
1911 emit inlineEditCommitted(info.nodeIdx, info.subLine, info.target, editedText);
1912}
1913
1914// ── Cancel inline edit ──
1915

Callers

nothing calls this directly

Calls 2

getLineTextFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected