Skip to content

Commit

Permalink
package 16.11.22
Browse files Browse the repository at this point in the history
  • Loading branch information
anester-aws committed Nov 16, 2022
1 parent 5795b1b commit fdab4a6
Show file tree
Hide file tree
Showing 15 changed files with 5,524 additions and 5,490 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.13.1](https://github.com/ajaxorg/ace/compare/v1.13.0...v1.13.1) (2022-11-16)


### Bug Fixes

* Change curly braces insertion behavior for Markdown to act the same as for other braces ([#4994](https://github.com/ajaxorg/ace/issues/4994)) ([2760234](https://github.com/ajaxorg/ace/commit/2760234d3d8d1acba72a42df7763482655af5ebc))
* incorrect cursor position for very long lines ([#4996](https://github.com/ajaxorg/ace/issues/4996)) ([e57a9d9](https://github.com/ajaxorg/ace/commit/e57a9d9eef0c056cd38a07c77c460bea39cc9551))

## [1.13.0](https://github.com/ajaxorg/ace/compare/v1.12.5...v1.13.0) (2022-11-11)


Expand Down
2 changes: 1 addition & 1 deletion kitchen-sink.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="author" content="Fabian Jakobs">
<!--
Ace
version 1.13.0
version 1.13.1
commit
-->

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ace-builds",
"main": "./src-noconflict/ace.js",
"typings": "ace.d.ts",
"version": "1.13.0",
"version": "1.13.1",
"description": "Ace (Ajax.org Cloud9 Editor)",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion src-min-noconflict/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/mode-markdown.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/mode-slim.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/mode-markdown.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/mode-slim.js

Large diffs are not rendered by default.

67 changes: 42 additions & 25 deletions src-noconflict/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ var reportErrorIfPathIsNotConfigured = function () {
reportErrorIfPathIsNotConfigured = function () { };
}
};
exports.version = "1.13.0";
exports.version = "1.13.1";

});

Expand Down Expand Up @@ -14784,6 +14784,7 @@ var Text = function (parentEl) {
this.SPACE_CHAR = "\xB7";
this.$padding = 0;
this.MAX_LINE_LENGTH = 10000;
this.MAX_CHUNK_LENGTH = 250;
this.$updateEolChar = function () {
var doc = this.session.doc;
var unixMode = doc.getNewLineCharacter() == "\n" && doc.getNewLineMode() != "windows";
Expand Down Expand Up @@ -15024,6 +15025,18 @@ var Text = function (parentEl) {
"rparen": true,
"lparen": true
};
this.$renderTokenInChunks = function (parent, screenColumn, token, value) {
var newScreenColumn;
for (var i = 0; i < value.length; i += this.MAX_CHUNK_LENGTH) {
var valueChunk = value.substring(i, i + this.MAX_CHUNK_LENGTH);
var tokenChunk = {
type: token.type,
value: valueChunk
};
newScreenColumn = this.$renderToken(parent, screenColumn + i, tokenChunk, valueChunk);
}
return newScreenColumn;
};
this.$renderToken = function (parent, screenColumn, token, value) {
var self = this;
var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g;
Expand Down Expand Up @@ -15083,18 +15096,15 @@ var Text = function (parentEl) {
}
}
valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element));
var span = this.dom.createElement("span");
if (!this.$textToken[token.type]) {
var classes = "ace_" + token.type.replace(/\./g, " ace_");
var span = this.dom.createElement("span");
if (token.type == "fold")
span.style.width = (token.value.length * this.config.characterWidth) + "px";
span.className = classes;
span.appendChild(valueFragment);
parent.appendChild(span);
}
else {
parent.appendChild(valueFragment);
}
span.appendChild(valueFragment);
parent.appendChild(span);
return screenColumn + value.length;
};
this.renderIndentGuide = function (parent, value, max) {
Expand Down Expand Up @@ -15251,12 +15261,12 @@ var Text = function (parentEl) {
chars -= value.length;
}
if (chars + value.length < splitChars) {
screenColumn = this.$renderToken(lineEl, screenColumn, token, value);
screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value);
chars += value.length;
}
else {
while (chars + value.length >= splitChars) {
screenColumn = this.$renderToken(lineEl, screenColumn, token, value.substring(0, splitChars - chars));
screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value.substring(0, splitChars - chars));
value = value.substring(splitChars - chars);
chars = splitChars;
lineEl = this.$createLineElement();
Expand All @@ -15268,7 +15278,7 @@ var Text = function (parentEl) {
}
if (value.length != 0) {
chars += value.length;
screenColumn = this.$renderToken(lineEl, screenColumn, token, value);
screenColumn = this.$renderTokenInChunks(lineEl, screenColumn, token, value);
}
}
}
Expand All @@ -15285,13 +15295,17 @@ var Text = function (parentEl) {
if (!value)
continue;
}
if (screenColumn + value.length > this.MAX_LINE_LENGTH)
return this.$renderOverflowMessage(parent, screenColumn, token, value);
screenColumn = this.$renderToken(parent, screenColumn, token, value);
if (screenColumn + value.length > this.MAX_LINE_LENGTH) {
this.$renderOverflowMessage(parent, screenColumn, token, value);
return;
}
screenColumn = this.$renderTokenInChunks(parent, screenColumn, token, value);
}
};
this.$renderOverflowMessage = function (parent, screenColumn, token, value, hide) {
token && this.$renderToken(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn));
if (token) {
this.$renderTokenInChunks(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn));
}
var overflowEl = this.dom.createElement("span");
overflowEl.className = "ace_inline_button ace_keyword ace_toggle_wrap";
overflowEl.textContent = hide ? "<hide>" : "<click to see more...>";
Expand Down Expand Up @@ -15985,10 +15999,11 @@ var lang = require("../lib/lang");
var event = require("../lib/event");
var useragent = require("../lib/useragent");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var CHAR_COUNT = 256;
var DEFAULT_CHAR_COUNT = 250;
var USE_OBSERVER = typeof ResizeObserver == "function";
var L = 200;
var FontMetrics = exports.FontMetrics = function (parentEl) {
var FontMetrics = exports.FontMetrics = function (parentEl, charCount) {
this.charCount = charCount || DEFAULT_CHAR_COUNT;
this.el = dom.createElement("div");
this.$setMeasureNodeStyles(this.el.style, true);
this.$main = dom.createElement("div");
Expand All @@ -15998,7 +16013,7 @@ var FontMetrics = exports.FontMetrics = function (parentEl) {
this.el.appendChild(this.$main);
this.el.appendChild(this.$measureNode);
parentEl.appendChild(this.el);
this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT);
this.$measureNode.textContent = lang.stringRepeat("X", this.charCount);
this.$characterSize = { width: 0, height: 0 };
if (USE_OBSERVER)
this.$addObserver();
Expand Down Expand Up @@ -16061,18 +16076,20 @@ var FontMetrics = exports.FontMetrics = function (parentEl) {
}
};
this.$measureSizes = function (node) {
var size = {
height: (node || this.$measureNode).clientHeight,
width: (node || this.$measureNode).clientWidth / CHAR_COUNT
node = node || this.$measureNode;
var rect = node.getBoundingClientRect();
var charSize = {
height: rect.height,
width: rect.width / this.charCount
};
if (size.width === 0 || size.height === 0)
if (charSize.width === 0 || charSize.height === 0)
return null;
return size;
return charSize;
};
this.$measureCharWidth = function (ch) {
this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT);
this.$main.textContent = lang.stringRepeat(ch, this.charCount);
var rect = this.$main.getBoundingClientRect();
return rect.width / CHAR_COUNT;
return rect.width / this.charCount;
};
this.getCharacterWidth = function (ch) {
var w = this.charSizes[ch];
Expand Down Expand Up @@ -16332,7 +16349,7 @@ var VirtualRenderer = function (container, theme) {
row: 0,
column: 0
};
this.$fontMetrics = new FontMetrics(this.container);
this.$fontMetrics = new FontMetrics(this.container, this.$textLayer.MAX_CHUNK_LENGTH);
this.$textLayer.$setFontMetrics(this.$fontMetrics);
this.$textLayer.on("changeCharacterSize", function (e) {
_self.updateCharacterSize();
Expand Down
Loading

0 comments on commit fdab4a6

Please sign in to comment.