rgieseke / textredux

Text-based interfaces for Textadept
http://rgieseke.github.io/textredux/
Other
59 stars 11 forks source link

Wrapped lists always return first element #83

Closed snoopy closed 1 year ago

snoopy commented 1 year ago

I am calling a wrapped list in TR with textredux.core.filteredlist.wrap(m('Buffer/Select Lexer...')) (lexer is used in this example but it's the same with recent files etc.). Once the select lexer list is open the second entry is selected ("ada"). The lexer (indicated on the bottom right) changes to the first selection of the list ("actionscript").

Using hijack() and then calling the normal TA dialog will not show the TR list but the TA one.

Here is a video to showcase the problem: lexer.webm

rgieseke commented 1 year ago

Does this work now with the fix in #84 ?

snoopy commented 1 year ago

No, wrapped lists still always return the first element.

rgieseke commented 1 year ago

I think something might need fixing here: https://github.com/rgieseke/textredux/blob/a9a33ab810698a3949c13b2339ddfe8545627da6/core/filteredlist.lua#L51-L55

string_output is no longer supported.

Dialogs no longer accept a string_output option. Buttons are always returned as numbers and list selections are always returned as numeric indices.

https://github.com/orbitalquark/textadept/blob/9d6227d8d4f4cf054ad3593645503d3b5d73af42/docs/manual.md

snoopy commented 1 year ago

I suspected this already in #82 but haven't been able to pinpoint the issue.

rgieseke commented 1 year ago

Right, thank you!

I think this is fixed now in https://github.com/rgieseke/textredux/commit/b90a36be7d4f1dac93cab8cc3a22b4d86da5e033

snoopy commented 1 year ago

Looks good, thanks