File tree 3 files changed +22
-14
lines changed
3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ function M.float(opts)
10
10
return require (" lazy.view.float" )(opts )
11
11
end
12
12
13
+ function M .wo (win , k , v )
14
+ if vim .api .nvim_set_option_value then
15
+ vim .api .nvim_set_option_value (k , v , { scope = " local" , win = win })
16
+ else
17
+ vim .wo [win ][k ] = v
18
+ end
19
+ end
20
+
13
21
function M .open (uri )
14
22
if M .file_exists (uri ) then
15
23
return M .float ({ style = " " , file = uri })
@@ -180,9 +188,9 @@ function M.markdown(msg, opts)
180
188
vim .tbl_deep_extend (" force" , {
181
189
title = " lazy.nvim" ,
182
190
on_open = function (win )
183
- vim .wo [ win ]. conceallevel = 3
184
- vim .wo [ win ]. concealcursor = " n"
185
- vim .wo [ win ]. spell = false
191
+ M .wo ( win , " conceallevel" , 3 )
192
+ M .wo ( win , " concealcursor" , " n" )
193
+ M .wo ( win , " spell" , false )
186
194
187
195
vim .treesitter .start (vim .api .nvim_win_get_buf (win ), " markdown" )
188
196
end ,
Original file line number Diff line number Diff line change 1
1
local Config = require (" lazy.core.config" )
2
2
local ViewConfig = require (" lazy.view.config" )
3
+ local Util = require (" lazy.util" )
3
4
4
5
--- @class LazyFloatOptions
5
6
--- @field buf ? number
@@ -124,12 +125,12 @@ function M:mount()
124
125
125
126
local function opts ()
126
127
vim .bo [self .buf ].bufhidden = self .opts .persistent and " hide" or " wipe"
127
- vim .wo [ self .win ]. conceallevel = 3
128
- vim .wo [ self .win ]. foldenable = false
129
- vim .wo [ self .win ]. spell = false
130
- vim .wo [ self .win ]. wrap = true
131
- vim .wo [ self .win ]. winhighlight = " Normal:LazyNormal"
132
- vim .wo [ self .win ]. colorcolumn = " "
128
+ Util .wo ( self .win , " conceallevel" , 3 )
129
+ Util .wo ( self .win , " foldenable" , false )
130
+ Util .wo ( self .win , " spell" , false )
131
+ Util .wo ( self .win , " wrap" , true )
132
+ Util .wo ( self .win , " winhighlight" , " Normal:LazyNormal" )
133
+ Util .wo ( self .win , " colorcolumn" , " " )
133
134
end
134
135
opts ()
135
136
Original file line number Diff line number Diff line change @@ -57,12 +57,11 @@ function M.create()
57
57
})
58
58
59
59
if Config .options .ui .wrap then
60
- vim .wo [self .win ].wrap = true
61
- vim .wo [self .win ].linebreak = true
62
- vim .wo [self .win ].breakindent = true
63
- -- vim.wo[self.win].breakindentopt = "shift:8"
60
+ Util .wo (self .win , " wrap" , true )
61
+ Util .wo (self .win , " linebreak" , true )
62
+ Util .wo (self .win , " breakindent" , true )
64
63
else
65
- vim .wo [ self .win ]. wrap = false
64
+ Util .wo ( self .win , " wrap" , false )
66
65
end
67
66
68
67
self .state = vim .deepcopy (default_state )
You can’t perform that action at this time.
0 commit comments