Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
98bd0eeb51
3 changed files with 31 additions and 21 deletions
|
|
@ -155,6 +155,8 @@ exports.launch = function(env) {
|
|||
var container = document.getElementById("editor");
|
||||
var cockpitInput = document.getElementById("cockpitInput");
|
||||
env.editor = new Editor(new Renderer(container, theme));
|
||||
window.env = env;
|
||||
window.ace = env.editor;
|
||||
|
||||
var modes = {
|
||||
text: new TextMode(),
|
||||
|
|
@ -337,7 +339,7 @@ exports.launch = function(env) {
|
|||
}
|
||||
|
||||
function onResize() {
|
||||
var width = (document.documentElement.clientWidth - 300);
|
||||
var width = (document.documentElement.clientWidth - 280);
|
||||
container.style.width = width + "px";
|
||||
cockpitInput.style.width = width + "px";
|
||||
container.style.height = (document.documentElement.clientHeight - 22) + "px";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ body {
|
|||
#editor {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 300px;
|
||||
left: 280px;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
background: white;
|
||||
|
|
@ -44,7 +44,7 @@ body {
|
|||
|
||||
#cockpitInput {
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
left: 280px;
|
||||
right: 0px;
|
||||
bottom: 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1010,7 +1010,7 @@ var EditSession = function(text, mode) {
|
|||
removedFolds = this.getFoldsInRange(e.data.range);
|
||||
this.removeFolds(removedFolds);
|
||||
|
||||
var foldLine = this.getFoldLine(lastRow);
|
||||
var foldLine = this.getFoldLine(end.row);
|
||||
var idx = 0;
|
||||
if (foldLine) {
|
||||
foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
|
||||
|
|
@ -1026,7 +1026,7 @@ var EditSession = function(text, mode) {
|
|||
|
||||
for (idx; idx < foldLines.length; idx++) {
|
||||
var foldLine = foldLines[idx];
|
||||
if (foldLine.start.row >= lastRow) {
|
||||
if (foldLine.start.row >= end.row) {
|
||||
foldLine.shiftRow(-len);
|
||||
}
|
||||
}
|
||||
|
|
@ -1596,21 +1596,29 @@ var EditSession = function(text, mode) {
|
|||
};
|
||||
|
||||
this.getScreenLength = function() {
|
||||
var length = this.getLength();
|
||||
var screenRows = 0;
|
||||
var lastFoldLine = null;
|
||||
var foldLine = null;
|
||||
if (!this.$useWrapMode) {
|
||||
screenRows = length;
|
||||
screenRows = this.getLength();
|
||||
|
||||
// Remove the folded lines again.
|
||||
var foldData = this.$foldData;
|
||||
for (var i = 0; i < foldData.length; i++) {
|
||||
foldLine = foldData[i];
|
||||
screenRows -= foldLine.end.row - foldLine.start.row;
|
||||
}
|
||||
} else {
|
||||
for (var row = 0; row < this.$wrapData.length; row++) {
|
||||
screenRows += this.$wrapData[row].length + 1;
|
||||
if (foldLine = this.getFoldLine(row, lastFoldLine)) {
|
||||
row = foldLine.end.row;
|
||||
screenRows += 1;
|
||||
} else {
|
||||
screenRows += this.$wrapData[row].length + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var foldData = this.$foldData;
|
||||
for (var i = 0; i < foldData.length; i++) {
|
||||
var foldLine = foldData[i];
|
||||
screenRows -= foldLine.end.row - foldLine.start.row;
|
||||
}
|
||||
return screenRows;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue