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: john muhl <jm <at> pub.pink>
To: 66159 <at> debbugs.gnu.org
Cc: Andrey Listopadov <andreyorst <at> gmail.com>, Mauro Aranda <maurooaranda <at> gmail.com>
Subject: bug#66159: [PATCH] Various improvements to lua-ts-mode (Bug#66159)
Date: Mon, 16 Oct 2023 22:26:00 -0500
[Message part 1 (text/plain, inline)]
john muhl <jm <at> pub.pink> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> On 6/10/23 16:44, john muhl via Bug reports for GNU Emacs, the Swiss
>> army knife of text editors wrote:
>>
>>> +(defcustom lua-ts-inferior-history nil
>>> +  "File used to save command history of the inferior Lua process."
>>> +  :type '(choice (const nil) file)
>>
>> Please, give a :tag for the const option.  IMO, it makes for a better
>> Customize UI.
>
> Fixed here and for the other choices.
>
> Andrey Listopadov <andreyorst <at> gmail.com> writes:
>
>> 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
>
> Navigation should be all around improved now. Let me know if I missed something.
>
> [2. text/x-patch; 0001-Various-improvements-to-lua-ts-mode-Bug-66159.patch]...

Here is the latest version. Fixed a missing declare-function
and other minor omissions.

[0001-Various-improvements-to-lua-ts-mode-Bug-66159.patch (text/x-patch, attachment)]

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.