Skip to content
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

Marks lost on refresh #179

Open
mpela81 opened this issue Mar 30, 2020 · 6 comments
Open

Marks lost on refresh #179

mpela81 opened this issue Mar 30, 2020 · 6 comments
Assignees
Milestone

Comments

@mpela81
Copy link

mpela81 commented Mar 30, 2020

All marks are lost when you refresh a file, using the reload button or when a file is modified externally. This does not happen on the original glogg.

@variar variar self-assigned this Mar 31, 2020
@variar
Copy link
Owner

variar commented Mar 31, 2020

Looks like some bug after marks and matches cache refactoring. Thank for pointing this out. I don't use file refreshing so this area lacks testing.

@variar variar added this to the 2020.01 milestone Mar 31, 2020
@variar variar removed the type: bug label Apr 2, 2020
@variar
Copy link
Owner

variar commented Apr 2, 2020

After some thought this is not simple issue. After reloading a file from disk we do not know if previously marked lines have same line numbers in new file, so klogg drops them because keeping marks on wrong line numbers is in my opinion much more confusing.

I can try to check if file checksum stays the same after reloading and keep marks in that case, but that will require considerably more work.

@variar variar modified the milestones: 2020.04, 2020.next Apr 2, 2020
@mpela81
Copy link
Author

mpela81 commented Apr 4, 2020

I think one of the most common usages of these tools is examining logs in real time. When the log file keeps growing as new lines are appended at the end, while existing lines do not change. Keeping marks in their place makes perfectly sense in this case.

@variar variar modified the milestones: 2020.next, 2020.08 May 9, 2020
@variar
Copy link
Owner

variar commented May 10, 2020

Thanks, this case looks valid. I don't use file refreshing in daily job and thus don't encounter many such issues.

There is already detection of changes at the end/in the middle of file, that can be used to keep marks.

@wizzard0
Copy link

wizzard0 commented Sep 20, 2020

relatively resilient suggestion: cache offsets+data, keep marks w\original text but flag\highlight them if the file data at that offset does not match cache anymore

@variar
Copy link
Owner

variar commented Sep 21, 2020

After fixing detection of file updates vs file truncates in latest builds, marks should not be lost on auto-refresh. They are still lost on manual refresh though.

@variar variar modified the milestones: 2020.10, 2020.next Sep 21, 2020
@variar variar modified the milestones: 2023.next, 2024.next Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants