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

File is scrolled up after file save #172

Open
rafalcwiek opened this issue Jul 14, 2022 · 8 comments
Open

File is scrolled up after file save #172

rafalcwiek opened this issue Jul 14, 2022 · 8 comments

Comments

@rafalcwiek
Copy link

I have LHM installed in vs 2022
I set checkbox: "Automatically insert license headers in new files"
I assigned LHM with action: After Project.AddNewItem
When I save a file, file view is scrolled up the content. It means that when working with large file, press Ctrl+S my view is jumping up the page.
image

@MichaelKetting
Copy link
Member

@rafalcwiek I'm sorry to hear that. Unfornately, I can't reproduce this issue on my system. Do you observe this problem when LHM is the only extension in Visual Studio? From the settings you show, it would seem that LHM is only active directly during file creation, not during regular file-save.

@rafalcwiek
Copy link
Author

@MichaelKetting
Hi. in attached screen there are two actions defined: 1. Before File.SaveSelectedItems and 2. After Project.AddNewItem.
I have some other extensions: here is the list
image

We could compare VS version
image

I thought that it might be related with the fact, that I use ReSharper. But this issue happens when RS is disabled as well.

@rafalcwiek
Copy link
Author

I have also noticed that when I press Ctrl+S and then Ctrl+Z, file becomes empty. Like if extension took whole content cleaned it and pasted modified content with header. As a result, when Ctrl+Z pressed. File is empty - it gets back to state before pasting new content with header - which is empty file.

@MichaelKetting
Copy link
Member

@rafalcwiek Thanks for pointing out "Before File.SaveSelectedItem". I didn't notice that one in the first screenshot since you didn't add it to the description. Yes, I can confirm that this particular optons is incompatible with LHM, I recommend not using it.

@rafalcwiek
Copy link
Author

@MichaelKetting , thanks for quick response. Is there any other option that I can use? I need to update license header when saving file. There might be old version of header and it would be nice to have new one updated on save.

@MichaelKetting
Copy link
Member

@rafalcwiek I'm using "After Resharper.ReSharper_SilentCleanupCode" but that's not a save-option. Other than that, I'm sorry, you'll need to look through the list and thry them out. You could also check if there's an obvious problem in the LHM source code causing this problem and create a PR for it.

@rafalcwiek
Copy link
Author

@MichaelKetting Thanks for your help :)

@rosshjb
Copy link

rosshjb commented Sep 1, 2022

+1

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