sandy

text editor
git clone git://git.suckless.org/sandy
Log | Files | Refs | README | LICENSE

commit 38aee70c7771211893ef346be01ed3bbd9e04482
parent dba84f346986f10457f46e75056f79e778a25f37
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Tue, 14 Jun 2011 01:33:32 +0200

Honor read-only.
Diffstat:
sandy.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sandy.c b/sandy.c @@ -402,7 +402,7 @@ f_pipero(const Arg *arg) { lastaction=LastPipeRO; } -void /* Repeat the last action */ +void /* Repeat the last action. Your responsibility: call only if t_rw() */ f_repeat(const Arg *arg) { Filepos pos; i_sortpos(&fsel, &fcur); @@ -816,7 +816,8 @@ i_edit(void) { goto edit_top; } statusflags&=~(S_InsEsc); - f_insert(&(const Arg){ .v = c }); + if(t_rw()) f_insert(&(const Arg){ .v = c }); + else tmptitle="WARNING! File is read-only!!!"; } }