| 1912 | } |
| 1913 | |
| 1914 | void 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 | |
| 1933 | void TextEditor::Cut() |
| 1934 | { |
no test coverage detected