Skip to content

Fix #79 imenu-list update when same position, but different buffer#80

Open
bitterfox wants to merge 1 commit intobmag:masterfrom
bitterfox:master
Open

Fix #79 imenu-list update when same position, but different buffer#80
bitterfox wants to merge 1 commit intobmag:masterfrom
bitterfox:master

Conversation

@bitterfox
Copy link
Copy Markdown

Fix #79
The cause is comparing the new location and the last location as an integer by =.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Overview-of-Markers.html

A marker can be used to represent a position in functions that require one, just as an integer could be used. In that case, the marker’s buffer is normally ignored.

so, it's compared with position only, but we should compare with position and buffer so that we update it when the buffer is changed, using equal

@@ -539,7 +539,7 @@ imenu entries did not change since the last update."
(unless (and (null force-update)
imenu-list--last-location
(marker-buffer imenu-list--last-location)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the intention here, but if once imenu-list--last-location becomes non buffer location once, imenu-list refuses future updates? (I never experienced such case though)
We maybe should check (marker-buffer location) is nil, instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

imenu-list is not updated when change buffer if point position is the same across buffers

1 participant