On 18-7-2011 10:31, Aditya Mahajan wrote:
On Thu, 14 Jul 2011, Aditya Mahajan wrote:
On Wed, 13 Jul 2011, Hans Hagen wrote:
- Typing gets frontstripped with the number of spaces in front of
\stoptyping so that one can have nicely formatted input like:
Great. Recently I had added a similar functionality to t-vim using the
key 'trimspaces=on|off'. I'll change that to 'frontstripped' to be
consistent with the core.
There is no option frontstripped. buff-ver does have a 'strip' option,
but looking at the corresponding lua code, I don't think that it can work:
local function filter(lines,settings)
local strip = settings.strip
if strip == v_yes then
lines = realign(lines,strip)
end
...
end
This means that when realign is called, strip = v_yes. But, realign
function is defined as
local function realign(lines,forced_n) -- no, auto, <number>
forced_n = (forced_n == v_auto and huge) or tonumber(forced_n)
if forced_n then
...
end
return lines
end
Since, forced_n is always true when realign is called, the original
lines are not changed.
Hans, did you mean
if not (strip == v_no) then
in the filter function?
I cleaned up that bit. So now we have:
\starttext
test (automatic based on spaces before \stop...):
\starttyping
test test
test test
test test
\stoptyping
test (key controlled):
\starttyping[strip=yes]
test test
test test
test test
\stoptyping
test
\startbuffer[x]
test test
test test
test test
\stopbuffer
\typebuffer[x][strip=yes]
test
\typebuffer[x][strip=8]
test
\stoptext
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________