mrmlnc / vscode-stylefmt

:electric_plug: VS Code plugin for stylefmt— Format your CSS using stylefmt.
https://goo.gl/pdJJBD
MIT License
45 stars 3 forks source link

Editing causes Output panel to show and steal focus #84

Closed anvish closed 7 years ago

anvish commented 7 years ago

When adding a new rule in the middle of scss file, output panel opens and steals focus:

[Stylefmt]
CssSyntaxError: <file_path>:1:1: Unknown word

> 1 | <rule_name>
    | ^
mrmlnc commented 7 years ago

Please, provide your editor settings and steps to reproduce your problem. Will be cool if you provide GIF or video.

anvish commented 7 years ago
  1. Copy class name
  2. Open scss file
  3. Press dot
  4. Paste
  5. Error window appears

bug

mrmlnc commented 7 years ago

This is related to editor.formatOnPaste option. VS Code try to format code after paste, but since it is invalid code stylefmt throw error.

mrmlnc commented 7 years ago

Closing as we need more info to investigate this.

evanwarner commented 7 years ago

What additional info do you need? I'm getting the exact same problem.

"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.formatOnSave": false,

Super annoying as I'm constantly writing HTML then copying classes into my stylesheet.

mrmlnc commented 7 years ago

I don't fully understand your problem. You write invalid CSS code and plugin gives you an error. You want option to disable error output?

evanwarner commented 7 years ago

Well, the code is invalid in the sense that I haven't finished typing yet, yes. But the error highlighter is not the problem (that's working fine). The problem unique to this case is that the output panel pops up and steals focus. That doesn't happen when I'm just writing a class name. It only happens when I paste a class name in.

stylefmt-error

mrmlnc commented 7 years ago

Very strange, because this plugin attempts to format the code only when the command stylefmt.execute is executed or you use Format from editor.

You can provide your settings?

evanwarner commented 7 years ago

Ahhh, ok I found the culprit. I have the multiple clipboards extension installed. I just set "multiclip.formatAfterPaste": false and problem solved!

@anvish Is this the same case for you?

anvish commented 7 years ago

@evanwarner no, I don't have this extension, I have "editor.formatOnPaste": true

@mrmlnc Problem with the panel is not solved. I think the issue should be in open state. Were you able to reproduce the issue? These steps reliably reproduce it for me ("editor.formatOnPaste" should be set to true):

Output panel pops up and steals the focus. This should not happen.

mrmlnc commented 7 years ago

I'll add stylefmt.showError option. By default this option will be enabled.

mrmlnc commented 7 years ago

Will be fixed in 2.3.0. Code in master. Release very soon.

ronilaukkarinen commented 4 years ago

stylefmt.showError seems not to have any effect :(