@@ -80,16 +80,32 @@ local M = setmetatable({}, {
80
80
})
81
81
82
82
function M .set_default_multiplexer ()
83
- -- if explicitly disabled or set to a different value, don't do anything
84
- if config .multiplexer_integration == false and config .multiplexer_integration ~= nil then
85
- return
86
- end
87
-
88
83
-- if running in a GUI instead of terminal TUI, disable mux
89
84
-- because you aren't in any terminal, you're in a Neovim GUI
90
85
if mux_utils .are_we_gui () then
86
+ log .debug (' Disabling multiplexer_integration because nvim is running in a GUI, not a TTY' )
91
87
config .multiplexer_integration = false
92
- return nil
88
+ return
89
+ end
90
+
91
+ -- for lazy environments, allow users to specify the mux before the plugin
92
+ -- is loaded by using a `vim.g` variable
93
+ if vim .g .smart_splits_multiplexer_integration ~= nil then
94
+ log .debug (
95
+ ' Taking multiplexer_integration from vim.g.multiplexer_integration: %s' ,
96
+ vim .g .smart_splits_multiplexer_integration
97
+ )
98
+ config .multiplexer_integration = vim .g .smart_splits_multiplexer_integration
99
+ -- if set to 0 or 1, convert to boolean
100
+ if type (config .multiplexer_integration ) == ' number' then
101
+ config .multiplexer_integration = config .multiplexer_integration ~= 0
102
+ end
103
+ return
104
+ end
105
+
106
+ -- if explicitly disabled or set to a different value, don't do anything
107
+ if config .multiplexer_integration == false and config .multiplexer_integration ~= nil then
108
+ return
93
109
end
94
110
95
111
local term = vim .trim ((vim .env .TERM_PROGRAM or ' ' ):lower ())
@@ -107,8 +123,6 @@ function M.set_default_multiplexer()
107
123
else
108
124
log .debug (' Auto-detected multiplexer back-end: none' )
109
125
end
110
-
111
- return type (config .multiplexer_integration ) == ' string' and config .multiplexer_integration or nil
112
126
end
113
127
114
128
function M .setup (new_config )
0 commit comments