-
Notifications
You must be signed in to change notification settings - Fork 61
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
Indentation problems in <script> tags #74
Comments
|
I did some progress. |
It looks like your paste has expired. Could you dump a minimal example in a comment here? |
Oops, sorry https://0bin.net/paste/6nm9WpmEwN9ecM0S#H5om5vukLPRKvV4hVVTpa5lvSw+PYkS5Wv-I2IVyAGm |
Looks good to me; this is what I get when indenting the whole component <script>
export default {
data() {
return {
username: null,
password: null,
error: false,
}
},
methods: {
login() {
if (!this.seems_good) {
return false
}
const success = () => this.$router.push({ name: "root" })
const error = () => {
this.error = true
this.password = null
}
this.$store.dispatch('reconnect', {
username: this.username,
password: this.password,
}).then(success, error)
},
},
computed: {
seems_good() {
return !!(this.username && this.password)
},
},
}
</script> |
Hum, did you try the instructions in my 2nd post? |
Yep, still unable to reproduce. |
I think |
Hum, could be it |
i am having the same problem , the script tag and my js code is all white , sometimes it detect as js file , is there any way to fix it ? |
Hi, I had the same problem. My env
|
Same thing here. Setting
|
@aki-s, @felipebalbi How to do it automatically? Tried some hooks.. didn't work. Edit: something like this:
|
@pashinin should be something like so:
|
Setting syntax-ppss-table to nil also fixed the issue to me, are there any side effects? couldn't quite understand the docs |
for me |
I got indentation error in script tag with multi-line comment in here. Anyone having the same issue? <script>
/**
*
*/
</script> |
ran into the same issue on 26.3. Switching to 26.2 works, with the exact same packages and config. Tried the following fix but it doesn't seem to work.
Tried the following and it works.
|
For example, it was happening in vue-mode. See: AdamNiederer/vue-mode#74 (comment)
no |
didn't work for me. Emacs 26.1 |
@azzamsa The problem only occurs with Emacs 23.3 ... with 26.1 and 26.2 you should not need those lines |
@pbgc yes. Turns out I've put wrong line I am using stock Emacs, and I've documented the steps here Setup Emacs for Vue.js Development |
Works for me as well with emacs 26.3 and spacemacs distribution. I just added the expression to the user-config block. |
This worked for me (Emacs 26.3):
Note the difference in the hook name compared to some of the answers above. |
Confirmed working with Emacs 26.3 |
Do we know why this happens and can this be set upstream in |
|
Ah, it seems like some kind of fix was applied in However, indentation in |
Taking my words back, it's just that the issue is very intermittent and honestly vue-mode right now is completely unusable with emacs 27. Very often it doesn't even detect the scoped sections, in which case |
@AlexDaniel I use vue-mode with Emacs 27 (stock emacs with custom configuration) and lsp-mode everyday without any problem! |
@AlexDaniel my conf for vue is:
|
@pbgc thank you very much for your config! I think you're right. I managed to get it working more or less (but mostly more!). Knowing that it works for you, I started digging. Turns out there was a conflict with |
Actually, no, it is very broken, I'd say even unusable. There's at least one very explicit issue, which is reported here: dgutov/mmm-mode#112 When using it, it constantly loses highlighting and almost always gets confused about indentation. |
@AlexDaniel I'm using: Emacs 27.1 and I DON'T have those problems and use vue mode every single day! |
Yeah, it is much more often for me than just occasionally. Good to know that it is also buggy for you, so it's not just my setup. I tried this approach and it works: #109 We'll see how it goes, but so far it is almost perfect. |
Often, when I open a .vue file, the indentation in the
<script>
tag is broken, with new lines aligned on the left. Sometimes, the indentation is correct when I open a file, I don't know why. Are you aware of this kind of problem?I have a big spacemacs config, I will try to bisect the problem some time.
As a quick-fix, is there a way to force vue-mode to use the js indentation mode?
The text was updated successfully, but these errors were encountered: