Skip to content

Commit

Permalink
improve completion right alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed May 11, 2023
1 parent 0472d54 commit b55a42b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/autocomplete/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class AcePopup {
}
addToken(caption.slice(lastIndex, caption.length), "");

tokens.push({type: "completion-spacer", value: " "});
if (data.meta)
tokens.push({type: "completion-meta", value: data.meta});
if (data.message)
Expand Down Expand Up @@ -236,7 +237,7 @@ class AcePopup {
return selectionMarker.start.row;
};
popup.setRow = function(line) {
line = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length, line));
line = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length - 1, line));
if (selectionMarker.start.row != line) {
popup.selection.clearSelection();
selectionMarker.start.row = selectionMarker.end.row = line || 0;
Expand Down Expand Up @@ -441,9 +442,8 @@ dom.importCssString(`
.ace_autocomplete_right .ace_line {
display: flex;
}
.ace_autocomplete_right .ace_completion-meta {
.ace_autocomplete_right .ace_completion-spacer {
flex: 1;
text-align: right;
}
`, "autocompletion.css", false);

Expand Down

0 comments on commit b55a42b

Please sign in to comment.