From 95ebb1c7d7969fa642192ce8e6c9efa8249979d9 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 29 Jun 2015 16:46:19 +0200 Subject: <:Q> returns -1 for non-existent registers now * added a new OPTIONAL behaviour for QRegSpecMachines * allows you to implement commands that have an optional Q-Register argument that should not be initialized if undefined. * Using QRegSpecMachine::fail() you may still check for existence of the register conditionally to emulate the QREG_REQUIRED behaviour. * Using :Q for checking for register existence makes sense, because usually you will want to check for both existence and non-emptyness as in :Qq">. So in this common case, you no longer have to keep in mind that the register may also be undefined. * This finally allows us to create arrays in the Q-Register tables without keeping a separate entry for the number of elements. E.g. an array.0 to array.N can be iterated like this: 0Ui <:Q[array.^E\i]:; ! work with element i ! %i> --- lib/session.tes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/session.tes b/lib/session.tes index 09bd647..e0bad9e 100644 --- a/lib/session.tes +++ b/lib/session.tes @@ -2,12 +2,12 @@ ! Path of the session profile. Change this to save/load a custom profile. - If empty, no session will be saved. ! + If empty or undefined, 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[session.path]-1"< Oend ' Q*U.[curbuf] EJ< %.bEB ESGETFIRSTVISIBLELINEU.[fvline] ESGETXOFFSETU.[xoff] .U.[dot] -- cgit v1.2.3