9fans archive / 1996 / 09 / 48 /    prev next

From: Boyd Roberts boyd@fra...
Subject: /appl/lib/wmlib.b [inferno]
Date: Mon, 23 Sep 1996 11:00:40 +0200

i've added a few lines to /appl/lib/wmlib.b so that getfilename tracks
the last directory where a file was opened.  passing "" for the
directory argument uses the previous directory where the file was
found.  if "" is passed on the first call "." is used.

226a227,228
> lastdir := "";
> 
233a236,245
> 
>       # start at  directory of previous file
>       if (dir == "")
>       {
>               if (lastdir != "")
>                       dir = lastdir;
>               else
>                       dir = ".";
>       }
> 
346a359,360
> 
>       lastdir = dir;

to exploit this i changed /appl/wm/edit.b:

18a19,21
> include "lib.m";
>       str: String;
> 
69a73
>       str = load String String->PATH;
150c154
<               fname := wmlib->getfilename(screen, ed, "", "*", ".");
---
>               fname := wmlib->getfilename(screen, ed, "", "*", "");
268a273,274
>       (nil, f) := str->splitr(curfile, "/");
>       wmlib->taskbar(ed, f);

this patch also includes setting the taskbar to be the basename of the
file currently being edited.  i guess you could say i'm actually writing
limbo with edit.  i'd prefer sam, but i'm beginning to live with edit.