File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 3
3
This is a Neovim plugin/library for generating statusline components from the built-in LSP client.
4
4
5
5
## Notices
6
+ - ** 2022/05/05** : ** Breaking change** . ` progress() ` no longer escapes ` % ` in the returned string. If
7
+ you were using ` progress() ` or ` status() ` in your ` statusline ` option, you should wrap the
8
+ expression inside ` %{} ` to escape ` % ` . See [ below] ( #all-together-now ) for an example.
6
9
- ** 2021/03/13** : Some users report success using the Google "Noto Emoji" font for ` status_symbol `
7
10
and ` indicator_hint ` .
8
11
- ** 2020/11/19** : Please note that the default diagnostics symbols require Font Awesome or a [ Nerd
@@ -236,6 +239,12 @@ function! LspStatus() abort
236
239
return ''
237
240
endfunction
238
241
242
+ " Manually set 'statusline'
243
+ set statusline+=%{LspStatus()}
244
+
245
+ " ... or use a statusline plugin, e.g. lightline:
246
+ let g:lightline.active.right = [..., ['lsp_status']]
247
+ let g:lightline.component_function = {'lsp_status': 'LspStatus'}
239
248
```
240
249
241
250
## Status
Original file line number Diff line number Diff line change @@ -47,9 +47,7 @@ local function get_lsp_progress()
47
47
contents = msg .title
48
48
if msg .message then contents = contents .. ' ' .. msg .message end
49
49
50
- -- this percentage format string escapes a percent sign once to show a percentage and one more
51
- -- time to prevent errors in vim statusline's because of it's treatment of % chars
52
- if msg .percentage then contents = contents .. string.format (" (%.0f%%%%)" , msg .percentage ) end
50
+ if msg .percentage then contents = contents .. string.format (" (%.0f%%)" , msg .percentage ) end
53
51
54
52
if msg .spinner then
55
53
contents = config .spinner_frames [(msg .spinner % # config .spinner_frames ) + 1 ] .. ' ' ..
You can’t perform that action at this time.
0 commit comments