emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: treesit indentation "blinking"


From: João Távora
Subject: Re: treesit indentation "blinking"
Date: Mon, 3 Apr 2023 11:28:28 +0100

On Mon, Apr 3, 2023 at 10:59 AM Alan Mackenzie <acm@muc.de> wrote:
>
> Hello, Dmitry.
>
> On Mon, Apr 03, 2023 at 00:21:18 +0300, Dmitry Gutov wrote:
> > On 02/04/2023 20:23, João Távora wrote:
> > > So my initial idea was to tone down electric-indent-chars, at least
> > > for the moment.  And Dmitry's idea was to make electric-indent-chars
> > > be ambitious_only_  if electric-pair-mode is enabled (by the user).
> > > Maybe we should bring back that idea, and it seems the least bad of the
> > > bunch right now.
>
> > Alternatively, we only perform "electric indent" (aside from after RET)
> > when the parse tree does not contain errors.
>
> That is NOT electric indentation.  The whole point about electric
> indentation is for it to take effect whilst point is still on the line
> being edited.

I can't speak for Dmitry, but I think that's precisely what is in mind
here.  Say I have this buffer and point is on the end of the second line:

int foo() {
something()
}

As soon as I type the ';' at the end of "something", the parse tree is
valid and electric-indent kicks in.  In this buffer:

int foo() {
  for() something();
}

Then "blinking" would not happen if you add two ;; inside the for's
parens, as it does now, because as soon as soon as I add one, the
parse tree becomes invalid (presumably) and electric-indent does not
kick in.

João



reply via email to

[Prev in Thread] Current Thread [Next in Thread]