aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/session.tes
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-24 20:50:25 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-24 20:53:55 +0100
commit6e5a6113af29dcc2380e6884fb49ed0e4fcbe16d (patch)
tree6ab0908e43744634d8bf25f8326faa9603b6dd73 /lib/session.tes
parentad3d2f4a63cddd312cdf3571c42b420b5b23e50e (diff)
downloadsciteco-6e5a6113af29dcc2380e6884fb49ed0e4fcbe16d.tar.gz
allow disabling of buffer sessions. in sample.teco_ini, disable sessions automatically when files are given.
this allows you to use sciteco in a Git repository to edit a specific file, without changing the buffer session. Also useful if SciTECO is used as the GIT_EDITOR without thrashing the repository's session every time a commit message is edited.
Diffstat (limited to 'lib/session.tes')
-rw-r--r--lib/session.tes9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/session.tes b/lib/session.tes
index 99dce52..9b924bc 100644
--- a/lib/session.tes
+++ b/lib/session.tes
@@ -1,16 +1,18 @@
! Macros for saving and loading buffer sessions !
! Path of the session profile.
- Change this to save/load a custom profile !
+ Change this to save/load a custom profile.
+ If empty, no session will be saved. !
EU[session.path]Q[$SCITECOCONFIG]/.teco_session
! Save current session to the file specified by "session.path" !
@[session.save]{
+ :Q[session.path]"= Oend '
Q*U.[curbuf]
EJ<
%.bEB ESGETFIRSTVISIBLELINEU.[fvline] ESGETXOFFSETU.[xoff] .U.[dot]
:@EU.[session]{EBQ* \.[fvline]ESSETFIRSTVISIBLELINE \.[xoff]ESSETXOFFSET \.[dot]:J^M}
- EQ* Z"= -1U.u '
+ :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} '
@@ -18,11 +20,12 @@ EU[session.path]Q[$SCITECOCONFIG]/.teco_session
E%.[session]Q[session.path]
Q.[curbuf]EB
-}
+!end!}
! Load session specified by "session.path" !
@[session.load]{
EJ<-EF>
+ ! now we have only one unnamed buffer !
EQ.x ENQ[session.path]
Z"=
1EB