Re: Tabs (or spaces) in snippets

From: mitchell <mforal.n....at.gmail.com>
Date: Mon, 29 Mar 2010 13:12:46 -0700 (PDT)

Robert,

> does anyone know if there is an easy way to get a "tab" inserted in a
> snippet that respects that currently set tab size and type?
>
> tab = "\t",
> Will be alway be a tab stop even if spaces are set.
>
> btab = "if %1:\n%(buffer:tab())",
> indents the entire block one tab (respecting the current setting)
>
> atab = "if %1:\n%2(#(buffer:tab())) #end"
> adds a tab (respecting the current setting) add the end of the entire
> snippet

The snippet text could be preprocessed to replace '\t' with
string.rep(' ', buffer.indent_size). I think it's indent_size anyway.
I'll accept a patch.

Mitchell

>
> Robert
Received on Mon 29 Mar 2010 - 16:12:46 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:41:41 EST