-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lastused property for windows/buffers/tabpages ("MRU history") #28745
Comments
This is related to a more general idea, which is that currently it's clumsy and unreliable to get a history of accesses ("touches"/"last-used"/"recent") to buffers/windows/tabpages. Cross-posting from #28742 (comment) :
|
I've done some more digging into this and started to realize the scale of my naivety about this change.... In short, it looks like Line 2435 in 041b0f9
I created a counter for each window to keep track when a What's the likelihood that
where Do you think this change or somerthing similar would be OK to make or do you think would I face objections to this? |
I don't think that's better than adding the code somewhere else outside that function. |
@zeertzjq where do you think it would be best to add a |
I don't think that flag is needed if you move the code out of |
Problem
I'm trying to add a
lastused
property tovim.fn.getwininfo
, like invim.fn.getbufinfo
.It's just a timestamp for when a windown was last entered into
I've made a start: #28742 and for the most part it works, however, there's one case where it doesn't work as expected;
If a buffer is opened in multiple windows, the timestamp (
w_last_used
) won't get updated when you enter any of the other windows, apart from the first window that the buffer was opened in and all the windows display the same timestamp as the first window.Please note I'm completly new to this codebase and any help to pointing me to the right direction, or just any tips/guidance in general would be greatly appreciated
Background
In case anyone is curious as to why I want this;
It's to do with the qf window, specifically what happens when you select an item in the qf window that's open in multiple windows.
When I'm developing, I may have multiple windows open of the same buffer (due to me jumping around the code).
If there's an item in the qf window that's open in multiple windows, I would like that item to open in the windown that was most reccently accessed, see; https://github.com/kevinhwang91/nvim-bqf/pull/140/files
Expected behavior
I expect each window to have it's timestamp updated each time I enter it
The text was updated successfully, but these errors were encountered: