From 655a24356fe84ac3e110431aaaa1f8ba3deb6cf4 Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Sat, 26 Jun 2010 16:18:45 +0000 Subject: From the Loganaden Velvindron: Make dired more sane (and emacslike): * Position cursor at first filename after .. * Don't reposition cursor on reopening * Check for permission before attempting to open directory I took forever to get this in. Thanks, Logan for being patient! --- usr.bin/mg/file.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'usr.bin/mg/file.c') diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c index ee345924c75..be98250def5 100644 --- a/usr.bin/mg/file.c +++ b/usr.bin/mg/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.71 2009/06/04 23:39:37 kjell Exp $ */ +/* $OpenBSD: file.c,v 1.72 2010/06/26 16:18:44 kjell Exp $ */ /* This file is in the public domain. */ @@ -220,10 +220,12 @@ readin(char *fname) for (wp = wheadp; wp != NULL; wp = wp->w_wndp) { if (wp->w_bufp == curbp) { - wp->w_dotp = wp->w_linep = bfirstlp(curbp); - wp->w_doto = 0; - wp->w_markp = NULL; - wp->w_marko = 0; + if ((fisdir(fname)) != TRUE) { + wp->w_dotp = wp->w_linep = bfirstlp(curbp); + wp->w_doto = 0; + wp->w_markp = NULL; + wp->w_marko = 0; + } } } -- cgit v1.2.3