diff options
| author | William Boman <william@redwill.se> | 2022-05-25 05:03:39 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2022-05-25 14:18:24 +0200 |
| commit | 4dfe6a5d5dfb7e76d22e59eca510dacb91116945 (patch) | |
| tree | d5bf3a020004742e27ee7855720f466965f27802 | |
| parent | chore(issue_template): add sections for :LspLog (#718) (diff) | |
| download | mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar.gz mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar.bz2 mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar.lz mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar.xz mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.tar.zst mason-4dfe6a5d5dfb7e76d22e59eca510dacb91116945.zip | |
fix(ui): setlocal undolevels=-1
Without having profiled things, this should greatly reduce memory
footprint because this UI buffer is:
1) updated very frequently
2) the way it's currently updated is extremely inefficient (it
essentially recreates the buffer contents on every render)
| -rw-r--r-- | lua/nvim-lsp-installer/core/ui/display.lua | 1 | ||||
| -rw-r--r-- | tests/core/ui_spec.lua | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/core/ui/display.lua b/lua/nvim-lsp-installer/core/ui/display.lua index 10fe1e45..c80738cd 100644 --- a/lua/nvim-lsp-installer/core/ui/display.lua +++ b/lua/nvim-lsp-installer/core/ui/display.lua @@ -317,6 +317,7 @@ function M.new_view_only_win(name) bufhidden = "wipe", buflisted = false, filetype = "lsp-installer", + undolevels = -1 } local win_opts = { diff --git a/tests/core/ui_spec.lua b/tests/core/ui_spec.lua index 1ca2f4c7..c591a66d 100644 --- a/tests/core/ui_spec.lua +++ b/tests/core/ui_spec.lua @@ -194,7 +194,7 @@ describe("integration test", function() assert.spy(win_set_option).was_called_with(match.is_number(), "colorcolumn", "") assert.spy(win_set_option).was_called_with(match.is_number(), "cursorline", true) - assert.spy(buf_set_option).was_called(9) + assert.spy(buf_set_option).was_called(10) assert.spy(buf_set_option).was_called_with(match.is_number(), "modifiable", false) assert.spy(buf_set_option).was_called_with(match.is_number(), "swapfile", false) assert.spy(buf_set_option).was_called_with(match.is_number(), "textwidth", 0) @@ -202,6 +202,7 @@ describe("integration test", function() assert.spy(buf_set_option).was_called_with(match.is_number(), "bufhidden", "wipe") assert.spy(buf_set_option).was_called_with(match.is_number(), "buflisted", false) assert.spy(buf_set_option).was_called_with(match.is_number(), "filetype", "lsp-installer") + assert.spy(buf_set_option).was_called_with(match.is_number(), "undolevels", -1) assert.spy(set_lines).was_called(1) assert.spy(set_lines).was_called_with( |
