diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-04-05 17:05:50 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-04-05 17:34:53 +0200 |
commit | 9e97b5820975cb44775f62805dc6366d7eec3411 (patch) | |
tree | 30273094d000e105475820e08014cc2c73f05a9d /lib | |
parent | c4dbe74a100ab355da80953c8c1288889bd41757 (diff) | |
download | sciteco-9e97b5820975cb44775f62805dc6366d7eec3411.tar.gz |
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)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/session.tes | 14 |
1 files changed, 11 insertions, 3 deletions
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 |