MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / Copy

Method Copy

plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp:1914–1931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1912}
1913
1914void TextEditor::Copy()
1915{
1916 if (HasSelection())
1917 {
1918 ImGui::SetClipboardText(GetSelectedText().c_str());
1919 }
1920 else
1921 {
1922 if (!mLines.empty())
1923 {
1924 std::string str;
1925 auto& line = mLines[GetActualCursorCoordinates().mLine];
1926 for (auto& g : line)
1927 str.push_back(g.mChar);
1928 ImGui::SetClipboardText(str.c_str());
1929 }
1930 }
1931}
1932
1933void TextEditor::Cut()
1934{

Callers 1

copyMethod · 0.80

Calls 4

HasSelectionFunction · 0.85
c_strMethod · 0.80
push_backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected