aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/shared.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/shared.lua')
-rw-r--r--runtime/lua/vim/shared.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 1a96ef9bc4..08f8afd087 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -138,7 +138,9 @@ function vim.gsplit(s, sep, opts)
local seg = _pass(s:find(sep, start, plain))
-- Trim empty segments from start/end.
- if trimempty and seg == '' then
+ if seg ~= '' then
+ empty_start = false
+ elseif trimempty then
while not done and seg == '' do
empty_segs = empty_segs + 1
seg = _pass(s:find(sep, start, plain))