GNU bug report logs - #66159
30.0.50; lua-ts-mode semantic indentation problems

Previous Next

Package: emacs;

Reported by: Andrey Listopadov <andreyorst <at> gmail.com>

Date: Fri, 22 Sep 2023 19:41:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: john muhl <jm <at> pub.pink>
Cc: 66159 <at> debbugs.gnu.org
Subject: bug#66159: [PATCH] Various improvements to lua-ts-mode (Bug#66159)
Date: Sun, 08 Oct 2023 12:43:50 +0300
john muhl <jm <at> pub.pink> writes:

>> It seems the last patch broke the movement.
>
> The tests for those pass and are still working here. Maybe you found
> another case that needs to be improved. What is the specific problem?

It seems so, sorry for not including this, I thought I sent this before.
Here's an example:


█for i=1,10 do
     print(x)
 end

Pressing Pressing C-M-f (forward-sexp) puts the point here:

 for i=1,10 do
     print(x)█
 end

I think it should go over the `for' loop right to the `end'.

Pressing Pressing C-M-b (backward-sexp), however, puts the point here:

 for i=1,10 do
    █print(x)
 end

Pressing C-M-b again doesn't move the point anymore.

Same thing happens with for-each style loop:

█for k,v in pairs({1,2,3}) do
     print(x)
 end

C-M-f:

 for k,v in pairs({1,2,3})█do
     print(x)
 end

C-M-f:

 for k,v in pairs({1,2,3}) do
     print(x)█
 end

Backward movement manages to take the point way back to the pairs:

C-M-b, C-M-b:

 for k,v in pairs█({1,2,3}) do
     print(x)
 end

I went to https://devhints.io/lua and copied a bunch of examples of
other loops to the scratch buffer, and the movement is as follows:

█while condition do
 end

 for i = 1,5 do
 end

 for i = start,finish,delta do
 end

 for k,v in pairs(tab) do
 end

 repeat
 until condition

 -- Breaking out:
 while x do
   if condition then break end
 end

C-M-f:

 while condition do
 end

 for i = 1,5 do
 end

 for i = start,finish,delta do
 end

 for k,v in pairs(tab)█do
 end

 repeat
 until condition

 -- Breaking out:
 while x do
   if condition then break end
 end

C-M-f:

 while condition do
 end

 for i = 1,5 do
 end

 for i = start,finish,delta do
 end

 for k,v in pairs(tab) do
 end

 repeat
 until condition

 -- Breaking out:
 while x do
   if condition then break end█
 end


--
Andrey Listopadov




This bug report was last modified 1 year and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.