Merge pull request #2360 from overleaf/hb-reinstate-shortened-cite-autocomplete

Reinstates old behaviour for long autocompletes

GitOrigin-RevId: 832499745a6a491008b30f0c31fbba46bde80c7a
This commit is contained in:
Hugh O'Brien 2019-11-18 10:57:28 +00:00 committed by sharelatex
parent 8a0b28e7c4
commit bf91fe9a05
3 changed files with 7 additions and 7 deletions

View file

@ -169,6 +169,8 @@ define([
if (previousArgs == null) {
previousArgs = ''
}
const previousArgsCaption =
previousArgs.length > 8 ? '…,' : previousArgs
const result = []
result.push({
caption: `\\${commandName}{}`,
@ -180,7 +182,7 @@ define([
references.keys.forEach(function(key) {
if (key != null) {
result.push({
caption: `\\${commandName}{${previousArgs}${key}}`,
caption: `\\${commandName}{${previousArgsCaption}${key}}`,
value: `\\${commandName}{${previousArgs}${key}}`,
meta: 'reference',
score: 50

View file

@ -1760,7 +1760,7 @@ var FilteredList = function(array, filterText) {
var upper = needle.toUpperCase();
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
var caption = item.caption || item.value || item.snippet;
var caption = item.value || item.caption || item.snippet;
if (!caption) continue;
var lastIndex = -1;
var matchMask = 0;
@ -2020,8 +2020,7 @@ require("../config").defineOptions(Editor.prototype, "editor", {
value: false
}
});
});
(function() {
}); (function() {
ace.require(["ace/ext/language_tools"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;

View file

@ -1791,7 +1791,7 @@ var FilteredList = function(array, filterText) {
var upper = needle.toUpperCase();
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
var caption = item.caption || item.value || item.snippet;
var caption = item.value || item.caption || item.snippet;
if (!caption) continue;
var lastIndex = -1;
var matchMask = 0;
@ -2614,8 +2614,7 @@ dom.importCssString(".ace_prompt_container {\
exports.prompt = prompt;
});
(function() {
}); (function() {
ace.require(["ace/ext/prompt"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;