Skip to content

Commit

Permalink
fix line endig selector icon if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
asiloisad committed Nov 18, 2024
1 parent c04a141 commit 1eb6491
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/line-ending-selector/lib/status-bar-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = class StatusBarItem {
setLineEndings(lineEndings) {
this.lineEndings = lineEndings;
this.element.textContent = lineEndingName(lineEndings);
this.element.style.display = blockStyle(lineEndings);
this.emitter.emit('did-change');
}

Expand Down Expand Up @@ -55,3 +56,12 @@ function lineEndingDescription(lineEndings) {
return 'unknown';
}
}

function blockStyle(lineEndings) {
switch (lineEndingName(lineEndings)) {
case '':
return 'none';
default:
return 'inline-block';
}
}

0 comments on commit 1eb6491

Please sign in to comment.