Revisión | 736eb83f9b6832d6112d1de4e0a1a86bcf39d0d9 (tree) |
---|---|
Tiempo | 2023-04-18 15:54:05 |
Autor | badcoff33 <none@none> |
Commiter | badcoff33 |
finetuning popup messages
@@ -92,12 +92,21 @@ export def CloseCb(ch: channel) | ||
92 | 92 | errors += e.type ==? "e" ? 1 : 0 |
93 | 93 | endfor |
94 | 94 | UpdatePopupPosition() |
95 | - popup_create( | |
96 | - printf("DONE | %d lines | %d warnings | %d errors", | |
97 | - lines, | |
98 | - warnings, | |
99 | - errors), | |
100 | - g:WinoptsDone()) | |
95 | + var done_str = printf("%s took %dsec | %d lines", | |
96 | + d.short_cmd, | |
97 | + localtime() - d.started, | |
98 | + lines) | |
99 | + if warnings == 1 | |
100 | + done_str ..= printf(" | %d warning", warnings) | |
101 | + elseif warnings > 1 | |
102 | + done_str ..= printf(" | %d warnings", warnings) | |
103 | + endif | |
104 | + if errors == 1 | |
105 | + done_str ..= printf(" | %d error", errors) | |
106 | + elseif errors > 1 | |
107 | + done_str ..= printf(" | %d errors", errors) | |
108 | + endif | |
109 | + popup_create(done_str, g:WinoptsDone()) | |
101 | 110 | if has_key(d, "winid") |
102 | 111 | popup_close(d.winid) |
103 | 112 | endif |
@@ -154,9 +163,8 @@ var indicator = ["-", "\\", "|", "/"] | ||
154 | 163 | var indicator_index = 0 |
155 | 164 | |
156 | 165 | def GetIndicator(): string |
157 | - if indicator_index < 3 | |
158 | - indicator_index += 1 | |
159 | - else | |
166 | + indicator_index += 1 | |
167 | + if indicator_index == 4 | |
160 | 168 | indicator_index = 0 |
161 | 169 | endif |
162 | 170 | return indicator[indicator_index] |
@@ -172,12 +180,12 @@ def RunJobMonitoringCb(tid: number) | ||
172 | 180 | popup_setoptions(d.winid, g:Winopts()) |
173 | 181 | if has_key(d, "timer") && d.timer == tid |
174 | 182 | popup_settext(d.winid, |
175 | - printf("%s %s %s | %d lines | %d sec", | |
183 | + printf("%s %s %s | %d lines", | |
176 | 184 | GetIndicator(), |
177 | 185 | toupper(job_status), |
178 | 186 | d.short_cmd, |
179 | - getbufinfo(d.bufnr)[0].linecount, | |
180 | - localtime() - d.started)) | |
187 | + getbufinfo(d.bufnr)[0].linecount | |
188 | + )) | |
181 | 189 | break |
182 | 190 | endif |
183 | 191 | else |