File tree 6 files changed +13
-18
lines changed
6 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -187,9 +187,7 @@ require("no-neck-pain").setup({
187
187
NvimTree = {
188
188
-- The position of the tree, either `left` or `right`.
189
189
position = " left" ,
190
- -- When `true`, we close NvimTree if it's currently open when enabling the plugin.
191
- close = true ,
192
- -- Paired with the `close` parameter, when `false` we don't re-open the side tree.
190
+ -- When `true`, if the tree was opened before enabling the plugin, we will reopen it.
193
191
reopen = true ,
194
192
},
195
193
-- @link https://github.com/mbbill/undotree
Original file line number Diff line number Diff line change @@ -174,9 +174,7 @@ Default values:
174
174
NvimTree = {
175
175
-- The position of the tree, either `left` or `right`.
176
176
position = "left",
177
- -- When `true`, we close NvimTree if it's currently open when enabling the plugin.
178
- close = true,
179
- -- Paired with the `close` parameter, when `false` we don't re-open the side tree.
177
+ -- When `true`, if the tree was opened before enabling the plugin, we will reopen it.
180
178
reopen = true,
181
179
},
182
180
-- @link https://github.com/mbbill/undotree
Original file line number Diff line number Diff line change @@ -152,9 +152,7 @@ NoNeckPain.options = {
152
152
NvimTree = {
153
153
-- The position of the tree, either `left` or `right`.
154
154
position = " left" ,
155
- -- When `true`, we close NvimTree if it's currently open when enabling the plugin.
156
- close = true ,
157
- -- Paired with the `close` parameter, when `false` we don't re-open the side tree.
155
+ -- When `true`, if the tree was opened before enabling the plugin, we will reopen it.
158
156
reopen = true ,
159
157
},
160
158
-- @link https://github.com/mbbill/undotree
Original file line number Diff line number Diff line change @@ -40,10 +40,7 @@ function W.createSideBuffers(wins)
40
40
}
41
41
42
42
-- we close the side tree if it's already opened to prevent unwanted layout issue.
43
- if
44
- wins .external .trees .NvimTree .id ~= nil
45
- and _G .NoNeckPain .config .integrations .NvimTree .close
46
- then
43
+ if wins .external .trees .NvimTree .id ~= nil then
47
44
integrations .NvimTree = true
48
45
vim .cmd (" NvimTreeClose" )
49
46
end
@@ -120,8 +117,15 @@ function W.createSideBuffers(wins)
120
117
end
121
118
122
119
-- if we've closed the user side tree but they still want it to be opened.
123
- if integrations .NvimTree and _G .NoNeckPain .config .integrations .NvimTree .reopen == true then
124
- vim .cmd (" NvimTreeOpen" )
120
+ if integrations .NvimTree then
121
+ if _G .NoNeckPain .config .integrations .NvimTree .reopen == true then
122
+ vim .cmd (" NvimTreeOpen" )
123
+ else
124
+ wins .external .trees .NvimTree = {
125
+ id = nil ,
126
+ width = 0 ,
127
+ }
128
+ end
125
129
end
126
130
127
131
return W .resizeOrCloseSideBuffers (" W.createSideBuffers" , wins )
Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ T["setup"]["sets exposed methods and default options value"] = function()
113
113
end
114
114
115
115
eq_config (child , " integrations.NvimTree.position" , " left" )
116
- eq_config (child , " integrations.NvimTree.close" , true )
117
116
eq_config (child , " integrations.NvimTree.reopen" , true )
118
117
eq_config (child , " integrations.undotree.position" , " left" )
119
118
end
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ T["setup"]["overrides default values"] = function()
22
22
integrations = {
23
23
NvimTree = {
24
24
position = "right",
25
- close = false,
26
25
reopen = false,
27
26
},
28
27
undotree = {
@@ -32,7 +31,6 @@ T["setup"]["overrides default values"] = function()
32
31
})]] )
33
32
34
33
eq_config (child , " integrations.NvimTree.position" , " right" )
35
- eq_config (child , " integrations.NvimTree.close" , false )
36
34
eq_config (child , " integrations.NvimTree.reopen" , false )
37
35
eq_config (child , " integrations.undotree.position" , " right" )
38
36
end
You can’t perform that action at this time.
0 commit comments