all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: Theodor Thornhill <theo@thornhill.no>,
	Yuan Fu <casouri@gmail.com>,
	62717@debbugs.gnu.org
Subject: bug#62717: 29.0.60; c-ts-mode does not indent the first line in a function after RET
Date: Sat, 08 Apr 2023 20:37:50 +0200	[thread overview]
Message-ID: <m1cz4e43up.fsf@yahoo.es> (raw)
In-Reply-To: <ab20b112-057f-4dcd-268f-4095180fad2a@gutov.dev> (Dmitry Gutov's message of "Sat, 8 Apr 2023 04:57:53 +0300")

Dmitry Gutov <dmitry@gutov.dev> writes:

>
> I've looked at what nvim-treesitter does for indentation, and at least
> one of the steps looks like this:
>
> https://github.com/nvim-treesitter/nvim-treesitter/blob/584ccea56e2d37b31ba292da2b539e1a4bb411ca/lua/nvim-treesitter/indent.lua#L129-L134
>
> If the current line is empty, look at the end of the previous line and
> compute based on the node there.
>
> I'm not sure how this meshes with the fact that tree-sitter inserts a
> "virtual" closer node at the end of the previous line, but the
> approach is worth examining.
>
> Daniel, you posted about testing nvim-treesitter with several
> scenarios. Does it do the right thing with this one?

Yes, it works well in this scenario.  Inserting a new line automatically
adds indentation.





  reply	other threads:[~2023-04-08 18:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1355ba2xr.fsf.ref@yahoo.es>
2023-04-07 19:48 ` bug#62717: 29.0.60; c-ts-mode does not indent the first line in a function after RET Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-08  1:57   ` Dmitry Gutov
2023-04-08 18:37     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-04-09  0:20       ` Dmitry Gutov
2023-04-09  5:19         ` Eli Zaretskii
2023-04-09 16:33           ` Dmitry Gutov
2023-04-09 17:37             ` Eli Zaretskii
2023-04-10  0:36               ` Dmitry Gutov
2023-04-10 21:04                 ` Yuan Fu
2023-04-09 11:05         ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 16:30           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1cz4e43up.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62717@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dmitry@gutov.dev \
    --cc=mardani29@yahoo.es \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.