From 9e97b5820975cb44775f62805dc6366d7eec3411 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 5 Apr 2016 17:05:50 +0200 Subject: session.tes: save and restore the working directory as part of the session * turned out to be a very handy feature * can be turned off by setting register `session.savedir` to false * also fixed the line endings in .teco_session files to line-feed (ie. native) --- lib/session.tes | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/session.tes b/lib/session.tes index 3ca5dd9..5f1ceab 100644 --- a/lib/session.tes +++ b/lib/session.tes @@ -5,18 +5,26 @@ If empty or undefined, no session will be saved. ! EU[session.path]Q[$SCITECOCONFIG]/.teco_session +! Whether to restore the working directory with sessions. + It is a TECO boolean. ! +-1U[session.savedir] + ! Save current session to the file specified by "session.path" ! @[session.save]{ :Q[session.path]-1"<  ' Q*U.[curbuf] + ! Restore the working directory ! + Q[session.savedir]"S + :@EU.[session]{3:EN*Q$"S FGQ$ '^J} + ' EJ< %.bEB ESGETFIRSTVISIBLELINEU.[fvline] ESGETXOFFSETU.[xoff] .U.[dot] - :@EU.[session]{EBQ* \.[fvline]ESSETFIRSTVISIBLELINE \.[xoff]ESSETXOFFSET \.[dot]:J^M} + :@EU.[session]{EBQ* \.[fvline]ESSETFIRSTVISIBLELINE \.[xoff]ESSETXOFFSET \.[dot]:J^J} :Q*"= -1U.u ' > ! We always start with an unnamed file in the ring, so we may have to remove it: ! - Q.u"F :@EU.[session]{EB -EF^M} ' - :@EU.[session]{\.[curbuf]EB^M} + Q.u"F :@EU.[session]{EB -EF^J} ' + :@EU.[session]{\.[curbuf]EB^J} E%.[session]Q[session.path] Q.[curbuf]EB -- cgit v1.2.3