Re: [textadept] Snippets with Tabs

From: mitchell <c....at.caladbolg.net>
Date: Wed, 27 Apr 2011 11:48:07 -0400 (Eastern Daylight Time)

Robert,

On Wed, 27 Apr 2011, Robert wrote:

> Hi,
>
> for these three ways to define a snippet with indentation, the second
> example fails
> (I prefer to use the second one for readability).
>
> snippets.s1 = "test\n\t123\n"
> -- two spaces
> snippets.s2 = [[
> test
> 123
> ]]
> -- actual tab
> snippets.s3 = [[
> test
> 123
> ]]
>
> The attached patch should allow for all three ways to define a snippet.

What you are seeing happens when you use a snippet tab_width of 2 [spaces]
while your document has a tab_width of 4. The indent sizes need to match
in order to insert the proper indentation. This is why it is recommended
to use tab characters in snippets. (By the way, your patch does not handle
multiple levels of indentation properly.)

mitchell
Received on Wed 27 Apr 2011 - 11:48:07 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:05:25 EST