Skip to content

Commit

Permalink
Fixed some issues from last release. Disabled auto-indent for now. En…
Browse files Browse the repository at this point in the history
…abled bracket matching.
  • Loading branch information
coreh committed Sep 9, 2011
1 parent ffa0e0b commit 5e4e516
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "nide",
"keywords": ["ide", "integrated", "development", "environment", "editor", "coding", "tool"],
"description": "Beautiful IDE for Node.js",
"version": "0.1.1",
"version": "0.1.2",
"repository": {
"url": ""
},
Expand Down
15 changes: 13 additions & 2 deletions public/css/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,21 @@
span.CodeMirror-selected {
background: #ccc !important;
color: HighlightText !important;
padding: 2px 0;
border-radius: 0 !important;
}
.CodeMirror-focused span.CodeMirror-selected {
background: Highlight !important;
}

.CodeMirror-matchingbracket {color: #0f0 !important;}
.CodeMirror-nonmatchingbracket {color: #f22 !important;}
.CodeMirror-matchingbracket {
color: #641 !important;
background: #fe7;
box-shadow: 0 0 10px #fe7;
border-radius: 4px;
}
.CodeMirror-nonmatchingbracket {
color: #f22 !important;
box-shadow: 0 0 2px #f22;
border-radius: 4px;
}
35 changes: 20 additions & 15 deletions public/js/nide.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,18 @@ socket.on('version-error', function(data) {
})

var CodeEditor = function(entry) {
var createCodeMirror = function(parentNode, file, path, options) {
return CodeMirror(parentNode, {
value: file,
mode: "javascript",
lineNumbers: true,
onChange: options.onChange,
readOnly: options.readOnly,
enterMode: 'keep',
electricChars: false,
matchBrackets: true
});
}
var codeMirror;
var galaxyBackground = document.createElement('div')
galaxyBackground.innerHTML =
Expand Down Expand Up @@ -411,12 +423,10 @@ var CodeEditor = function(entry) {
}, time).addClass('windowed');
(function(versionEditor, i) {
loadVersion(version.uuid, function(err, contents) {
var codeMirror = CodeMirror(versionEditor, {
value: contents || err,
readOnly: 'true',
mode: "javascript",
lineNumbers: true
})
if (err) {
contents = '<ERROR: Could not load file contents>'
}
var codeMirror = createCodeMirror(versionEditor, contents, entry.path, { readOnly: true })
versions[i].content = contents;
})
})(versionEditor, i);
Expand Down Expand Up @@ -513,15 +523,10 @@ var CodeEditor = function(entry) {
editor.appendChild(actionsBar)
editor.className = 'code-editor'
loadFile(entry.path, function(err, file) {
codeMirror = CodeMirror(editor, {
value: file,
mode: "javascript",
lineNumbers: true,
onChange: function(editor) {
content = editor.getValue()
changed = true
}
});
codeMirror = createCodeMirror(editor, file, entry.path, { onChange: function(editor) {
content = editor.getValue()
changed = true
}})

var content = file
var changed = false;
Expand Down

0 comments on commit 5e4e516

Please sign in to comment.