2009/3/4 roger peppe <rogpe...@gmail.com>:
> personally, i think that Put should work on any non-application
> window, and that re-columnation should only take place if
> the textual content hasn't been modified by the user. (and
> probably also that if you change the name of a window to a directory
> name and do "Get", that it would get a directory listing).
>
> but YMMV as always.
>

I think the attached patch is what you are proposing. If you apply it,
when you edit dir windows, the file menu will be added (Undo, Put will
only appear when the window name changes), and columnate won't be
called for that window. If you execute Put in that window it will be
saved, if the window name is a directory there will be an error.
Another changes I did is that now if you edit the title of +Error
windows the file menu will appear, and Get will appear when the window
name finishes with '/'. I haven't tested it too much, but it is
working here.



-- 
- yiyus || JGL .
diff /sys/src/cmd/acme/exec.c .
643c643
< 	if(et==nil || et->w==nil || et->w->isdir)
---
> 	if(et==nil || et->w==nil)
645a646
> 	w->isdir = FALSE;
diff /sys/src/cmd/acme/look.c .
109c109
< 				while(q1<t->file->nc && (c=tgetc(t, q1))!=' ' && c!='\t' && c!='\n')
---
> 				while(q1<t->file->nc && (c=tgetc(t, q1))!=' ' && c!='\t' && c!='\n' && c!='/')
449c449
< 		while(q1<t->file->nc && isfilec(c=textreadc(t, q1))){
---
> 		while(q1<t->file->nc && isfilec(c=textreadc(t, q1)) && c!='/'){
diff /sys/src/cmd/acme/text.c .
58c58
< 	if(t->what==Body && t->w->isdir && odx!=Dx(t->all)){
---
> 	if(t->what==Body && t->w->isdir && !t->w->dirty && odx!=Dx(t->all)){
215d214
< 		t->w->filemenu = FALSE;
251d249
< 		t->w->filemenu = TRUE;
945c943
< 		if((b&1) && (b&6)){
---
> 		if((b&1) && (b&30)){
950c948
< 			if(b & 2){
---
> 			if(b & 10){
diff /sys/src/cmd/acme/wind.c .
100c100
< 		if(w->body.file->mod && !w->isdir && !w->isscratch)
---
> 		if(!w->isscratch && w->dirty)
262a263
> 	w->isdir = FALSE;
266a268,270
> 	else if(n>=1 && runeeq(L"/", 1, name+(n-1), 1))
> 		w->isdir = TRUE;
> 	w->filemenu = !w->isscratch;
347a352,355
> 	if(w->isdir){
> 		runemove(new+i, L" Get", 4);
> 		i += 4;
> 	}
358c366
< 		if(!w->isdir && dirty){
---
> 		if(!w->isdir && !w->isscratch && dirty){
363,366d370
< 	if(w->isdir){
< 		runemove(new+i, L" Get", 4);
< 		i += 4;
< 	}
411c415
< 	if(!w->isdir && !w->isscratch && (w->body.file->mod || w->body.ncache))
---
> 	if(!w->isscratch && w->dirty)
diff /sys/src/cmd/acme/xfid.c .
117c117
< 				if(!w->isdir && w->col!=nil){
---
> 				if(w->col!=nil){
rc 2461: diff 2462: some

Reply via email to