Closed t-fritsch closed 5 years ago
@mrmlnc really need a fix for this... it is annoying. Do you have any clue what is doing this? If you have no time and know where to start, I will try my best to make a PR to fix this.
This might help: https://github.com/Microsoft/vscode/issues/111
@tfritsch-km any way I can help solve this?
Sorry @nealoke, I really don't know. Maybe ask @mrmlnc where to start (I haven't digged into the code of this plugin yet)
Aah oops, I thought you were the author, @mrmlnc how can I help with this plugin? :)
no problem 😄
I tried to look at it, and noticed that the code that formats css is slightly different when saving file from the one that runs when formatting with the "CSSComb: Format styles" command :
on "CSSComb: Format styles" command : https://github.com/mrmlnc/vscode-csscomb/blob/65c71c40c8a5dedac9b408e7fa158e8b864ea057/src/extension.ts#L69
I don't know the difference between the two, anyone that knows vscode api sees something interesting ?
Hey,
Unfortunately, now I don't have free time to support this plugin. When I developed this plugin it was not possible to save the cursor position when we use event.waitUntil(actions)
. If you want to correct the current behavior, please send a pull request.
Thank you @mrmlnc I just did a PR, could you review it ? I haven't heavily tested it but it seems to work. Any advice on it ?
Hey, I've used the patch for about a week now, and it works fine so far, I didn't notice any regression. Would love to get some feedback.
@mrmlnc could you please merge this?
Hi,
I have tested the patch https://github.com/kumquats/vscode-csscomb/commit/8b16d5357dee6880a6b4aa7efd2bda0b263512e9 and csscomb format on save is now working as expected.
It would be great to get this merged to the repo.
🙏 merge please 😄
+1 🙏 merge please 😄
Hello,
As @mrmlnc said in the PR comments (see https://github.com/mrmlnc/vscode-csscomb/pull/116#issuecomment-422672084) , there is a regression in my code when using the File: Save all
command : only the focused editor gets formatted. This PR could however be merged if it gets a config option to enable it (current behavior by default), but I unfortunately have no time to work on it ATM. 😕
So, I just pushed a new commit to PR that should make it work event with File > save all
, I hope it produces no regressions this time 😃
@mrmlnc what's holding up this merge?
Fixed by https://github.com/mrmlnc/vscode-csscomb/releases/tag/5.2.3. @tfritsch-km, thanks a lot.
Environment
Actual behavior
When
formatonsave
is activated, saving the file places the cursor at the very end of the file, forcing the user to manually move the cursor back to its initial position. The folded sections also gets unfolded, which makes it even more difficult to go back to initial position when working on large css filesExpected behavior
when
formatonsave
is activated, saving the file should not change the cursor position, it should remain on the line that it was on.Steps to reproduce
Config
Note: this issue is there because a previous issue was closed by the reporter but never worked on : https://github.com/mrmlnc/vscode-csscomb/issues/110
Edit : this issue doesn't occur when formatOnSave is false and you run command "CSSComb: Format styles" from command palette (CTRL+SHIFT+p).