git-watchtower 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
@@ -96,19 +96,19 @@ function renderHeader(state, write) {
96
96
  }
97
97
 
98
98
  let serverInfo = '';
99
- let serverInfoVisible = '';
99
+ let serverInfoVisibleLen = 0;
100
100
  if (state.serverMode === 'none') {
101
- serverInfoVisible = '';
101
+ serverInfoVisibleLen = 0;
102
102
  } else {
103
103
  const statusDot = state.serverRunning
104
104
  ? ansi.green + '\u25CF'
105
105
  : (state.serverCrashed ? ansi.red + '\u25CF' : ansi.gray + '\u25CB');
106
- serverInfoVisible = `localhost:${state.port} `;
106
+ serverInfoVisibleLen = 2 + `localhost:${state.port} `.length; // dot + space + "localhost:PORT "
107
107
  serverInfo = statusDot + ansi.white + ` localhost:${state.port} `;
108
108
  }
109
109
 
110
110
  const rightContent = `${modeBadge} ${serverInfo}${statusIcon}${ansi.bgBlue} ${soundIcon}${ansi.bgBlue} `;
111
- const rightVisibleLen = modeLabel.length + 1 + serverInfoVisible.length + 5;
111
+ const rightVisibleLen = modeLabel.length + 1 + serverInfoVisibleLen + 5;
112
112
 
113
113
  const usedSpace = leftVisibleLen + badgesVisibleLen + rightVisibleLen;
114
114
  const padding = Math.max(1, width - usedSpace);