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
+ - ** 2021/07/09** : ** 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 it inside
8
+ ` %{} ` 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
@@ -235,6 +238,12 @@ function! LspStatus() abort
235
238
return ''
236
239
endfunction
237
240
241
+ " Manually set 'statusline'
242
+ set statusline+=%{LspStatus()}
243
+
244
+ " ... or use a statusline plugin, e.g. lightline:
245
+ let g:lightline.active.right = [..., ['lsp_status']]
246
+ let g:lightline.component_function = {'lsp_status': 'LspStatus'}
238
247
```
239
248
240
249
## 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