JavaScript Mode Forces Tabs
See original GitHub issuehttp://codemirror.net/mode/javascript/index.html
editor.setOption("indentWithTabs", false);
Should stop inserting tabs and start using spaces, but still inserts tabs.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
JavaScript Mode Forces Tabs · Issue #3278 · codemirror ...
And that works great in the editor for HTML and CSS, but for a reason I haven't been able to figure out, fails...
Read more >Forcing IE into opening new tab instead of window? ...
I want a script that makes a user's Internet Explorer open a new tab instead of a new window whenever someone clicks on...
Read more >How To Create Tabs
Create buttons to open specific tab content. All <div> elements with class="tabcontent" are hidden by default (with CSS & JS). When the user...
Read more >Code Style. JavaScript | WebStorm Documentation
Use tab character. If this checkbox is selected, tab characters are used: On pressing the Tab key. For indentation. For reformatting code.
Read more >How to Always Open Files in a New Tab - VSCode
Simply right-click on the Preview Mode tab on the tab at the top of your screen (while it's italicized) and click on "Keep...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chriscoyier, I know this is an old issue, but I came across the following code via this Stack Overflow question / example: http://jsfiddle.net/nktvt8vf/12/
This maintains normal tab behavior (spaces/tabs depending on your settings) on an empty line as well as multi-line indenting, but also indents the beginning of a line of code. It also plays nice with Emmet.
I could see how this might be useful in CodePen… thought I’d give you a shout.
This remains an issue that has nothing to do with the CodeMirror core, but I found this page when I had the same problem with emmet and eventually came to a solution that I thought would be valuable to share.
Previously, I had the following settings:
This wasn’t working because emmet would sometimes choose to indent automatically using two spaces, but whenever there was nothing to expand, emmet would pass off the tab key event to the default CodeMirror handler, which indented using a tab character.
The solution for this was to handle the pass-off action manually:
Again, sorry for continuing an issue that’s not a problem with CodeMirror directly, but I think it’s valuable to have this answer here to save others time in the future.