diff --git a/edit/edit-widget.h b/edit/edit-widget.h
index ab55764..48288a3 100644
a
|
b
|
struct WEdit { |
65 | 65 | unsigned int screen_modified:1; /* File has been changed since the last screen draw */ |
66 | 66 | unsigned int delete_file:1; /* New file, needs to be deleted unless modified */ |
67 | 67 | unsigned int highlight:1; /* There is a selected block */ |
| 68 | unsigned int readonly:1; /* File is readonly */ |
68 | 69 | long prev_col; /* recent column position of the cursor - used when moving |
69 | 70 | up or down past lines that are shorter than the current line */ |
70 | 71 | long curs_line; /* line number of the cursor. */ |
diff --git a/edit/editcmd.c b/edit/editcmd.c
index 257ab6e..25d4c3a 100644
a
|
b
|
edit_insert_column_of_text (WEdit * edit, unsigned char *data, int size, int wid |
968 | 968 | void |
969 | 969 | edit_block_copy_cmd (WEdit *edit) |
970 | 970 | { |
| 971 | if ( !edit->readonly ) { |
| 972 | return; |
| 973 | } |
971 | 974 | long start_mark, end_mark, current = edit->curs1; |
972 | 975 | int size; |
973 | 976 | unsigned char *copy_buf; |
… |
… |
edit_block_copy_cmd (WEdit *edit) |
1008 | 1011 | void |
1009 | 1012 | edit_block_move_cmd (WEdit *edit) |
1010 | 1013 | { |
| 1014 | if ( !edit->readonly ) { |
| 1015 | return; |
| 1016 | } |
1011 | 1017 | long count; |
1012 | 1018 | long current; |
1013 | 1019 | unsigned char *copy_buf; |
diff --git a/edit/edit.c b/edit/edit.c
index 51810f7..8e72b0d 100644
a
|
b
|
static inline void edit_modification (WEdit * edit) |
832 | 832 | void |
833 | 833 | edit_insert (WEdit *edit, int c) |
834 | 834 | { |
| 835 | if ( !edit->readonly ) { |
| 836 | return; |
| 837 | } |
| 838 | mc_log("insert: %i\n", c); |
835 | 839 | /* check if file has grown to large */ |
836 | 840 | if (edit->last_byte >= SIZE_LIMIT) |
837 | 841 | return; |
… |
… |
void edit_insert_ahead (WEdit * edit, int c) |
917 | 921 | |
918 | 922 | int edit_delete (WEdit * edit) |
919 | 923 | { |
| 924 | if ( !edit->readonly ) { |
| 925 | return; |
| 926 | } |
920 | 927 | int p; |
921 | 928 | if (!edit->curs2) |
922 | 929 | return 0; |
… |
… |
int edit_delete (WEdit * edit) |
955 | 962 | static int |
956 | 963 | edit_backspace (WEdit * edit) |
957 | 964 | { |
| 965 | if ( !edit->readonly ) { |
| 966 | return; |
| 967 | } |
958 | 968 | int p; |
959 | 969 | if (!edit->curs1) |
960 | 970 | return 0; |