diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 68d41a59c..6c7bda2b2 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1582,11 +1582,16 @@ void Editor::ClearDocumentStyle() { } void Editor::Cut() { - Copy(); - ClearSelection(); + if (!pdoc->IsReadOnly()) { + Copy(); + ClearSelection(); + } } void Editor::PasteRectangular(int pos, const char *ptr, int len) { + if (pdoc->IsReadOnly()) { + return; + } currentPos = pos; int insertPos = currentPos; int xInsert = XFromPosition(currentPos); @@ -3478,7 +3483,7 @@ long Editor::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { case EM_CANPASTE: case SCI_CANPASTE: - return 1; + return !pdoc->IsReadOnly(); case EM_CHARFROMPOS: { if (lParam == 0) |