bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66159: [PATCH] Various improvements to lua-ts-mode (Bug#66159)


From: john muhl
Subject: bug#66159: [PATCH] Various improvements to lua-ts-mode (Bug#66159)
Date: Mon, 16 Oct 2023 22:26:00 -0500

john muhl <jm@pub.pink> writes:

> Mauro Aranda <maurooaranda@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@gmail.com> writes:
>
>> john muhl <jm@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.

Attachment: 0001-Various-improvements-to-lua-ts-mode-Bug-66159.patch
Description: Text Data


reply via email to

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