[NTG-context] beta

Hans Hagen pragma at wxs.nl
Tue Jul 19 10:56:31 CEST 2011


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
-----------------------------------------------------------------


More information about the ntg-context mailing list