[TxMt] Text indent on latest build
Allan Odgaard
throw-away-1 at macromates.com
Sat Nov 5 09:39:19 UTC 2005
On 05/11/2005, at 10.25, Andreas Wahlin wrote:
> Upps, after some testing, I discovered somethnig I'd still like to
> be changed :)
> When an empty line, let the caret remain in position, or move it
> "in" just as a tab would have done.
Yes -- though the reason why I haven't done so yet is, that it's not
that simple, since empty lines doesn't get special treatment, but are
matched by the unindent line pattern -- but it's likely going to be
fixed somehow.
> Reason; I immediately set up enter to be a macro with newline and
> indent
Doesn't a normal return already give you that?
> [...] Problem was this behaviour broke rather badly since each line
> without previous text had the caret far to the left
What you can do is record a macro that does:
1) return
2) ctrl-shift left (select to begin of line)
3) tab (overwrite selection with tabs corresponding to calculated
indent)
Part #3 is basically the same as the new re-indent function, except
it does keep leading whitespace on empty lines -- although the
difference in behavior between this and normal return should be
minimal (basically the indent next line pattern is not used with
return, due to how that pattern can get cancelled based on what's on
next line -- this may improve slightly in the future, but I'd think
this case is limited to only a few languages, in particular C/C++).
More information about the textmate
mailing list