Closed snoopy closed 3 years ago
Thanks for digging in, fixing the off-by-one (which appears indeed to have been overlooked) seems to work!
Your patch only fixes half of the problem for me.
Now the margin width gets reset to the correct width but the line numbers are still missing. Did it work for you? Might be some of my settings then.
You mean when resetting? For Textredux buffers the margin should appear "empty", by hiding the number view (as one usually doesn't need one for a list of buffers). For curses it's 1 char wide. There seems to be a problem when a message buffer is open, as these have no line numbers any more.
Still happens with normal buffers just slightly different than before.
Here is a video using the latest master: https://streamable.com/oqn0v1
Thanks for the reproducible bug report and video! I think this might be due to Textadept saving margin width in core/ui.lua
Discussion and fix in https://github.com/orbitalquark/textadept/issues/33
When switching to a TR buffer the line number margin gets removed. Closing the buffer resets the line number margin.
In some cases the line number margin does not get reset. I haven't been able to ascertain why and when. This will only happen in exactly one normal buffer.
Removing the following lines from
bufer.lua
will "fix" the problem by never removing the line number margin in TR buffers.Obviously there must be a better solution but I don't know what causes this. Maybe something that was overlooked with the switch from 0 to 1 based counting? Seems to be a fairly recent bug anyways.
Can usually be reproduced by selecting a buffer through the buffer list and then cycling through your buffers until you find one without line numbers.