B: expand path when plumbing files

When we plumb a file, we open it in the current working
directory if it exists. However, if it doesn't exist,
we end up opening it relative to the editor's working
directory.

Expanding the path to works around this issue.
This commit is contained in:
Ori Bernstein 2021-06-12 18:03:26 +00:00
parent 1c30bd451e
commit c12e49ecbf

View file

@ -10,10 +10,9 @@ if(~ $#* 0){
exit usage exit usage
} }
if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){ wdir=`{pwd}
for(i) for(i){
plumb -s B -d edit $i if(! ~ $i /*)
exit i=$wdir/$i
plumb -s B -d edit $i
} }
echo 'no plumber' >[1=2]