Re: [code] Improved File Browser

From: Alexander Misel <alexander_misel.att.live.cn>
Date: Tue, 9 Oct 2018 00:35:38 +0000

I found not so easy to solve the issues. As I placed a print(name) after the last buffer:set_styling but the print is fine, while the text is not colored. The second issue I tried the BUFFER_AFTER_SWITCH event, but I don't know how to color the text, simply copying the code from print_listing doesn't work.
________________________________
From: Mitchell <m.att.foicica.com>
Sent: Monday, October 8, 2018 1:34
To: code.att.foicica.com
Subject: Re: [code] Improved File Browser

Hi Alexander,

On Fri, 5 Oct 2018, Alexander Misel wrote:

> I did the following patches to make File Browser work after reopening Textadept.
> init.patch is applied to modules/file_browser/init.lua
> session.patch is applied to modules/textadept/session.lua
>
> Things I fixed include:
>
> 1. Restoring file browser session after reopen
> 2. False indent if the first item in a folder is a folder (expand that folder would result in the files inside it become same level as the parent folder)

Thanks for the contribution! Rather than patching Textadept's *session.lua* module, I recommend patching the file_browser module's *init.lua* to use "[File Browser - path/to/dir]" rather than "[File Browser] - path/to/dir". Hopefully that wouldn't be too difficult.

> Some issues I found in File Browser:
>
> 1. The last folder inside a folder cannot be colored

It's probably trivial to fix. Look for `buffer:set_styling()` calls and see if a loop exits prematurely.

> 2. After switching buffers, the colors in File Browser disappears

You'll have to set up whatever is performing the styling to do so again in an `events.BUFFER_AFTER_SWITCH` event. This may be more complicated than it initially seems.

When you're happy with your changes, I would encourage you to update the wiki page[1] by clicking on the page's title and following the edit instructions.

Cheers,
Mitchell

[1]: https://foicica.com/wiki/ta-filebrowser

--
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 08 Oct 2018 - 20:35:38 EDT

This archive was generated by hypermail 2.2.0 : Tue 09 Oct 2018 - 06:52:31 EDT