Comments (6)
Just be aware that on IE (at least 6 and 7, haven't tested 8), the white-space: pre and white-space: pre-wrap styles are so utterly broken in a contentEditable document that tabs are not going to work. I also remember other browsers having some issues, but those may have been fixed in the meantime. I'd certainly be okay with a patch that adds an optional leave-tabs-alone mode, if it works in at least a few browsers.
from codemirror-v1.
This is a show stopper for me. Every time you edit any file with hard-tabs it changes the entire file by replacing them with spaces. I'm not really sure it should ever be an "option" — I guess I just couldn't live with an editor (browser or otherwise) that changed everyone's code.
I'll probably try fixing this in my branch, I'll let you know how it goes.
from codemirror-v1.
Looks like another fizzled attempt. It seems browser vendors did not think about tabs very much when they were implementing designMode/contentEditable. On the bright side, CodeMirror 2 is more tab-friendly.
from codemirror-v1.
Quick question. Is there a way to control tabs in version2? Automatic indenting does it with 2 spaces, however pressing Tab does 8. This is with Firefox 4... not sure about other browsers.
from codemirror-v1.
Browsers fix tabs to 8 spaces, and CodeMirror has to use native browser tabs. However, you can set indentUnit to something other than 2, and you can set indentWithTabs to have it convert any leading multiples of 8 spaces to tabs when indenting.
from codemirror-v1.
Sorry, just realized that I was in the wrong repo. tabMode: 'indent'
seems to be the thing I wanted.
Thanks for the library. It's fantastic.
from codemirror-v1.
Related Issues (20)
- Autocomplete HOT 4
- PHP Parser fails for some comments HOT 1
- C# parser problem with verbatim string HOT 1
- CodeMirror enterMode config param seems to be ignored if height is set. HOT 1
- Implement electric characters HOT 1
- lostundo missing reference in undo.js HOT 1
- Uncaught ReferenceError: lostundo is not defined HOT 1
- rewrite scrollToNode to just insert a node and check its coords if it needs to
- C# parser : bug with operators (fix inside) HOT 1
- this.editor is undefined (codemirror.js row 203) HOT 1
- content does not show HOT 9
- Liquid Mode for Codemirror2 HOT 6
- setValue() clears undo history HOT 1
- HTML5 required attribute breaks hack for form submission HOT 6
- Speed up hideLine method HOT 1
- Pressing tab causes entire line to indent HOT 4
- unable to get separate history for multiple instances of codemirror HOT 4
- loadmode plugin does not work over non string modes HOT 1
- codemirror
- Mirror Demes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codemirror-v1.