web-mode
web-mode copied to clipboard
No indentation allowed for inline <script> tag?
Hello, I'm coding some HTML that looks like this (its in a .ejs file if that matters):
<!doctype html>
<html lang="en">
<head>
<title>Introduction to WebRTC</title>
</head>
<body>
<video autoplay></video>
<script>
*
</script>
</body>
</html>
My cursor is on the *
. I'm trying to hit Tab here to indent to start coding the body of the script tag and it refuses to move. It just doesn't do anything at all. Interestingly, if I'm on the <script>
tag and I say "insert line below" it does in fact indent it the way I expect.
So I have 2 questions:
- Can I get it to allow me to indent inside inline script tags?
- Can I get it to never refuse to do something I request of it? I'd prefer it always indent if I request it to. For example, if I opened a and hit tab twice, I'd prefer if it did 2 indentations rather than refusing to do so.
Thanks!
This has gotten much worse as I coded, I'm not sure whats going on now but I can't get it to match the formatting of the code at all, the code is all aligned on 4 spaces inside the inline and even "insert line below" has started outdenting to the weird location:
Sometimes it just fills in and autocompletes stuff that is not relevant to what I'm typing. For example, if I want to write a new listener:
See how it autocompleted HTML tags and then added in the addEventListener
in there while I was typing?
@sontek please try with an empty .emacs
At least with the indentations, its the same:
ok, with an empty one its just wanting to use 2 characters instead of 4 and it won't let me hit tab a second time to go to 4. Can I tell it not to refuse to do what I want? I like having some sane defaults but if it can't detect the format of the code then it'd be nice to have it not try to force the default, just suggest it
HTML I'm using inside the .ejs
file
<!doctype html>
<html lang="en">
<head>
<title>Introduction to WebRTC</title>
</head>
<body>
<div>
Video: <select id="camera"></select>
</div>
<script>
</script>
</body>
</html>