orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
640 stars 38 forks source link

buffer.tab_label does not work #413

Closed GreedyTactician closed 1 year ago

GreedyTactician commented 1 year ago

If I somebuffer = buffer.new() and then somebuffer.buffer.tab_label = 'somename', the name of the buffer will only be changed as long as I am in that tab. If I switch to another tab and switch back, the tab will revert to 'Untitled'.

However, I found that setting both

somebuffer.buffer.tab_label = 'somename'
somebuffer._type = 'somename'

seems to work fine.

So it seems either the documentation could use a bit more detail or there's a small bug with tab_label

orbitalquark commented 1 year ago

Thanks for the report. That field is not really intended to be user-defined. I have updated the documentation to mention that Textadept automatically sets this field based on the buffer's filename or type, and its save status: https://github.com/orbitalquark/textadept/commit/54d93bcd919d264ac144b2e80be754db2673c278. While your workaround will work for the foreseeable future, it is not officially defined behavior.