Skip to content

Commit

Permalink
Merge branch 'ajaxorg:master' into token_test_update
Browse files Browse the repository at this point in the history
  • Loading branch information
akoreman authored Jul 31, 2023
2 parents 9fb63ef + bccff5a commit 23017d2
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 121 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

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.23.4](https://github.com/ajaxorg/ace/compare/v1.23.3...v1.23.4) (2023-07-12)


### Bug Fixes

* filterText triggered selection range removal when completions range was present ([#5249](https://github.com/ajaxorg/ace/issues/5249)) ([b586e4d](https://github.com/ajaxorg/ace/commit/b586e4d574bf780fc38f1ac0d034276272b36ad3))

### [1.23.3](https://github.com/ajaxorg/ace/compare/v1.23.2...v1.23.3) (2023-07-10)


### Bug Fixes

* android bug when deleting multiple lines ([#5248](https://github.com/ajaxorg/ace/issues/5248)) ([bd066ff](https://github.com/ajaxorg/ace/commit/bd066ffef88ca74f5ac32349d3e868cfa875a47b)), closes [#5087](https://github.com/ajaxorg/ace/issues/5087)
* update jshint version to 2.13.6; change esversion to target ECMAScript 11 ([#5243](https://github.com/ajaxorg/ace/issues/5243)) ([301aee9](https://github.com/ajaxorg/ace/commit/301aee91b5974d9fb31d646466ed301c5c3b8249))

### [1.23.2](https://github.com/ajaxorg/ace/compare/v1.23.1...v1.23.2) (2023-07-07)


### Bug Fixes

* **autocomplete:** fix a11y violations ([#5241](https://github.com/ajaxorg/ace/issues/5241)) ([decb615](https://github.com/ajaxorg/ace/commit/decb6154198105289170303b7434c524eaf9fda8))
* bug in guttertooltip when `tooltipsFollowsMouse` set to false ([#5217](https://github.com/ajaxorg/ace/issues/5217)) ([67d318e](https://github.com/ajaxorg/ace/commit/67d318ed25d5b45789462850e6b96aac2931591f))
* typo in function name ([#5229](https://github.com/ajaxorg/ace/issues/5229)) ([6e99055](https://github.com/ajaxorg/ace/commit/6e99055c46f443271161e40fe15372d1d8ae9f42))

### [1.23.1](https://github.com/ajaxorg/ace/compare/v1.23.0...v1.23.1) (2023-06-27)

## [1.23.0](https://github.com/ajaxorg/ace/compare/v1.22.1...v1.23.0) (2023-06-21)
Expand Down
2 changes: 1 addition & 1 deletion build
Submodule build updated 264 files
4 changes: 2 additions & 2 deletions demo/kitchen-sink/docs/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ print([===[
--[=[--
table.maxn is deprecated, use # instead.
--]=]--
print(table.maxn{1,2,[4]=4,[8]=8) -- outputs 8 instead of 2
print(table.maxn{1,2,[4]=4,[8]=8}) -- outputs 8 instead of 2

print(5 --[[ blah ]])
print(5 --[[ blah ]])
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,10 @@ <h1>Projects Using Ace</h1>
<div class="text-logo">Domoticz</div>
<a href="https://www.domoticz.com/">Domoticz</a>
</li>
<li>
<img lazy-src="https://nixx.dev/static/hotlink-ok/logo-alt.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://nixx.dev">Nixx Web Tools</a>
</li>
<li id="add_your_site">
<p>+</p>
<a href="https://github.com/ajaxorg/ace/issues/new?assignees=&labels=website%2Cneeds-triage&projects=&template=add-to-website.yml&title=Add+project+%28project+name%29+to+the+list+of+projects+using+Ace+on+its+website">Your Site Here</a>
Expand Down
12 changes: 6 additions & 6 deletions lib/ace/mode/javascript/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2392,13 +2392,13 @@ module.exports = slice;
exports.noConflict = function () { global._ = current; return exports; };
}()));
}(this, (function () {
// Underscore.js 1.13.4
// Underscore.js 1.13.6
// https://underscorejs.org
// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.

// Current version.
var VERSION = '1.13.4';
var VERSION = '1.13.6';

// Establish the root object, `window` (`self`) in the browser, `global`
// on the server, or `this` in some virtual machines. We use `self`
Expand Down Expand Up @@ -4461,7 +4461,7 @@ module.exports = slice;
/*exported console */

var _ = _dereq_("underscore");
_.clone = _dereq_("lodash.clone");
_.clone = _dereq_("lodash.clone");
var events = _dereq_("events");
var vars = _dereq_("./vars.js");
var messages = _dereq_("./messages.js");
Expand Down Expand Up @@ -8930,7 +8930,7 @@ var JSHINT = (function() {
var id = state.tokens.prev;
value = expression(context, 10);
if (value) {
if (value.identifier && value.value === "undefined") {
if (!isConst && value.identifier && value.value === "undefined") {
warning("W080", id, id.value);
}
if (!lone) {
Expand Down Expand Up @@ -13527,7 +13527,7 @@ var errors = {

// Constants
E011: "'{a}' has already been declared.",
E012: "const '{a}' is initialized to 'undefined'.",
E012: "Missing initializer for constant '{a}'.",
E013: "Attempting to override '{a}' which is a constant.",

// Regular expressions
Expand Down Expand Up @@ -15122,7 +15122,7 @@ exports.regexpDot = /(^|[^\\])(\\\\)*\./;
*/

var _ = _dereq_("underscore");
_.slice = _dereq_("lodash.slice");
_.slice = _dereq_("lodash.slice");
var events = _dereq_("events");

// Used to denote membership in lookup tables (a primitive value such as `true`
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/mode/javascript_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ oop.inherits(JavaScriptWorker, Mirror);
this.options = options || {
// undef: true,
// unused: true,
esnext: true,
esversion: 11,
moz: true,
devel: true,
browser: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ace-code",
"description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE",
"version": "1.23.1",
"version": "1.23.4",
"homepage": "http://github.com/ajaxorg/ace",
"engines": {
"node": ">= 0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class CompletionProvider {
// TODO add support for options.deleteSuffix
if (!this.completions)
return false;
if (this.completions.filterText) {
if (this.completions.filterText && !data.range) {
var ranges;
if (editor.selection.getAllRanges) {
ranges = editor.selection.getAllRanges();
Expand Down
52 changes: 41 additions & 11 deletions src/autocomplete_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function initEditor(value) {
return editor;
}

function afterRenderCheck(popup, callback) {
popup.renderer.on("afterRender", function wait() {
popup.renderer.off("afterRender", wait);
callback();
});
}

module.exports = {
tearDown: function() {
if (editor) {
Expand Down Expand Up @@ -95,7 +102,7 @@ module.exports = {
snippet: "will: $1",
meta: "snippet",
command: "startAutocomplete",
range: new Range(0, 4, 0, 6)
range: new Range(0, 4, 0, 7)
}, {
caption: "here",
value: "-here",
Expand All @@ -110,27 +117,50 @@ module.exports = {
editor.moveCursorTo(0, 6);
sendKey("w");
var popup = editor.completer.popup;
check(function () {
afterRenderCheck(popup, function () {
assert.equal(popup.data.length, 1);
editor.onCommandKey(null, 0, 13);
assert.equal(popup.data.length, 2);
assert.equal(editor.getValue(), "goodwill: ");
check(function () {
afterRenderCheck(popup, function () {
editor.onCommandKey(null, 0, 13);
assert.equal(editor.getValue(), "goodwill-here");
editor.destroy();
editor.container.remove();
done();
});
});

function check(callback) {
popup = editor.completer.popup;
popup.renderer.on("afterRender", function wait() {
popup.renderer.off("afterRender", wait);
callback();
});
}
},
"test: filterText does not trigger selection range removal when completions range is present": function (done) {
var editor = initEditor("{}");
editor.completers = [
{
getCompletions: function (editor, session, pos, prefix, callback) {
var completions = [
{
caption: "apple",
snippet: "apple: $1",
meta: "snippet",
range: new Range(0, 1, 0, 2)
}, {
caption: "pineapple",
value: "pineapple",
range: new Range(0, 1, 0, 2)
}
];
callback(null, completions);
}
}
];
editor.moveCursorTo(0, 1);
sendKey("a");
var popup = editor.completer.popup;
afterRenderCheck(popup, function () {
assert.equal(popup.data.length, 2);
editor.onCommandKey(null, 0, 13);
assert.equal(editor.getValue(), "{apple: }");
done();
});
},
"test: different completers tooltips": function (done) {
var editor = initEditor("");
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ var reportErrorIfPathIsNotConfigured = function() {
}
};

exports.version = "1.23.1";
exports.version = "1.23.4";


11 changes: 9 additions & 2 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2889,13 +2889,19 @@ config.defineOptions(Editor.prototype, "editor", {

var gutterKeyboardHandler;

// Prevent focus to be captured when tabbing through the page. When focus is set to the content div,
// press Enter key to give focus to Ace and press Esc to again allow to tab through the page.
// If keyboard a11y mode is enabled we:
// - Enable keyboard operability gutter.
// - Prevent tab-trapping.
// - Hide irrelevant elements from assistive technology.
// - On Windows, set more lines to the textarea.
if (value){
this.renderer.enableKeyboardAccessibility = true;
this.renderer.keyboardFocusClassName = "ace_keyboard-focus";

this.textInput.getElement().setAttribute("tabindex", -1);
// VoiceOver on Mac OS works best with single line in the textarea, the screen readers on
// Windows work best with multiple lines in the textarea.
this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0);
this.renderer.scroller.setAttribute("tabindex", 0);
this.renderer.scroller.setAttribute("role", "group");
this.renderer.scroller.setAttribute("aria-roledescription", nls("editor"));
Expand Down Expand Up @@ -2926,6 +2932,7 @@ config.defineOptions(Editor.prototype, "editor", {
this.renderer.enableKeyboardAccessibility = false;

this.textInput.getElement().setAttribute("tabindex", 0);
this.textInput.setNumberOfExtraLines(0);
this.renderer.scroller.setAttribute("tabindex", -1);
this.renderer.scroller.removeAttribute("role");
this.renderer.scroller.removeAttribute("aria-roledescription");
Expand Down
Loading

0 comments on commit 23017d2

Please sign in to comment.