Skip to content

Commit de4234b

Browse files
authoredJun 20, 2023
feat(autocomplete): ellipsis is shown when suggestions is longer than popover width (#5204)
* feat(autocomplete) ellipsis is shown when suggestions is longer than popover width - make meta right aligned by default
1 parent e14902e commit de4234b

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
 

‎src/autocomplete/popup.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ dom.importCssString(`
410410
}
411411
.ace_completion-meta {
412412
opacity: 0.5;
413-
margin: 0 0.9em;
413+
margin-left: 0.9em;
414414
}
415415
.ace_completion-message {
416416
color: blue;
@@ -438,13 +438,24 @@ dom.importCssString(`
438438
background: #25282c;
439439
color: #c1c1c1;
440440
}
441-
.ace_autocomplete_right .ace_text-layer {
441+
.ace_autocomplete .ace_text-layer {
442442
width: calc(100% - 8px);
443443
}
444-
.ace_autocomplete_right .ace_line {
444+
.ace_autocomplete .ace_line {
445445
display: flex;
446+
align-items: center;
446447
}
447-
.ace_autocomplete_right .ace_completion-spacer {
448+
.ace_autocomplete .ace_line > * {
449+
min-width: 0;
450+
flex: 0 0 auto;
451+
}
452+
.ace_autocomplete .ace_line .ace_ {
453+
flex: 0 1 auto;
454+
overflow: hidden;
455+
white-space: nowrap;
456+
text-overflow: ellipsis;
457+
}
458+
.ace_autocomplete .ace_completion-spacer {
448459
flex: 1;
449460
}
450461
`, "autocompletion.css", false);

‎src/ext/prompt.js

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function prompt(editor, message, options, callback) {
7272
if (options.getCompletions) {
7373
var popup = new AcePopup();
7474
popup.renderer.setStyle("ace_autocomplete_inline");
75-
popup.renderer.setStyle("ace_autocomplete_right");
7675
popup.container.style.display = "block";
7776
popup.container.style.maxWidth = "600px";
7877
popup.container.style.width = "100%";

0 commit comments

Comments
 (0)
Please sign in to comment.