rgieseke / textredux

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

buffer reloading and cursor positioning working as intended? #59

Open ghost opened 4 years ago

ghost commented 4 years ago

Got two questions on intended behavior.

First, when switching between say the buffer list and some other buffer the current cursor position inside the buffer list will be reset (i.e. to the top). As far as I can tell this happens for all reduxlists.
Is this intentional? Consider a very long list and the user switching and upon returning to the list the cursor always resets to the top which can be annoying (somewhat related is that going to the end of the buffer in a reduxlist only goes to the end of the currently visible page).

The other point concerns buffer reloading.
When you change a file outside of TA which is open in TA and then select another file (not the one that was changed!) you will get a popup asking if you want to reload the changed file.
Normal TA only asks for that if the file was actually selected but in TR the confirmation always comes up when switching files.
Intended or not?

rgieseke commented 4 years ago

Good questions,

the first one i can reproduce when switching buffers -- when switching views the position is kept. So, unintended and agreeing that it is annoying! Probably not surfacing when one uses selection by typing some chars, definitely worth investigating.

Reload behaviour, not sure i can reproduce, i get this, when e.g. closing some files in a buffer list sometimes, but not when just opening the buffer-switch dialog.

ghost commented 4 years ago

when switching views the position is kept.

Correct, however at least for me the styling is lost when switching between views.

ghost commented 4 years ago

but not when just opening the buffer-switch dialog.

May have miscommunicated this. The effect happens when opening another file (that is not the one that was changed) from the buffer-list. The only precondition is that a file was changed outside of TA.

For clarification:

rgieseke commented 4 years ago

For clarification:

Thanks for the detailed description, i don't get this with your description but sometimes when i close another file (with ctrl-d) in the buffer-list (notification for file1).

ghost commented 4 years ago

Yeah, it does happen on closing as well. Not sure how it works though. Does the buffer list cycle through files at some point?

ghost commented 4 years ago

styling is lost when switching between views.

Were you able to corroborate this?

rgieseke commented 4 years ago

Yes, as typing something does a refresh with colors, this is probably an easy fix ...

ghost commented 4 years ago

this is probably an easy fix ...

Great to hear, looking forward to your fix!
If you find this easy to fix then you can probably fix the cursor position as well. I suspect the nature of those bugs is quite similar.

As for the reloading of files. That should pretty much fix itself once you apply your changes for TA11 because the closing mechanism changes.
I checked and by removing https://github.com/rgieseke/textredux/blob/1aaea677bd2262831e32df1a7ebf33c16290a46f/buffer_list.lua#L125 the files will no longer be openend and therefore also not reloaded while still being closed.
Still does not explain why it happens in some other instances but it will be a good start.

rgieseke commented 4 years ago

probably an easy fix :-) I don't know yet ...

I've merged the 11 branch (i've been using the alpha for quite a while now), it seems that the closing behaviour has indeed changed, but if one just removes that line the buffer-list buffer is not active after closing a file, isn't it?

ghost commented 4 years ago

but if one just removes that line the buffer-list buffer is not active after closing a file, isn't it?

Yeah, bummer.

Just tried the TA11 version and aren't the colors off for the buffer list? It's using the color for comments and something else when it should be the color for strings/keywords I think.

rgieseke commented 4 years ago

Just tried the TA11 version and aren't the colors off for the buffer list? It's using the color for comments and something else when it should be the color for strings/keywords I think.

Good catch, thanks!

Should be fixe here:

https://github.com/rgieseke/textredux/commit/533daf1e37eda0644f4d778c5545155ffae6e2fd