Skip to content

Commit d12d7c6

Browse files
authored
Add an option to hide the filename from the progress text (#63)
1 parent a5990bf commit d12d7c6

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ lsp_status.config {
119119
```
120120
- `current_function`: Boolean, `true` if the current function should be updated and displayed in the
121121
default statusline component.
122+
- `show_filename`: Boolean, `true` if the filename should be displayed in the progress text.
122123
- `indicator_*`-group: strings to show as diagnostic warnings. If you don't have Nerd/Awesome Fonts you can replace defaults with ASCII chars like this:
123124
```
124125
-- Put this somewhere near lsp_status.register_progress()

doc/lsp-status.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ config({config}) *lsp-status.config()*
105105
should be updated and displayed in the default statusline
106106
component. Shows the current function, method, class,
107107
struct, interface, enum, module, or namespace.
108+
`show_filename`: Boolean, `true` if the filename should be
109+
displayed in the progress text.
108110
`indicator_separator`: a string which goes between each
109111
diagnostic group symbol and its count. Defaults to whitespace.
110112
`component_separator`: a string which goes between each

lua/lsp-status.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local default_config = {
22
kind_labels = {},
33
current_function = true,
4+
show_filename = true,
45
diagnostics = true,
56
indicator_separator = ' ',
67
component_separator = ' ',

lua/lsp-status/statusline.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ local function get_lsp_progress()
5757
end
5858
elseif msg.status then
5959
contents = msg.content
60-
if msg.uri then
60+
if config.show_filename and msg.uri then
6161
local filename = vim.uri_to_fname(msg.uri)
6262
filename = vim.fn.fnamemodify(filename, ':~:.')
6363
local space = math.min(60, math.floor(0.6 * vim.fn.winwidth(0)))

0 commit comments

Comments
 (0)