diff options
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r-- | src/nvim/lua/vim.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index 38a8795680..9cd8e232d5 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -161,8 +161,7 @@ end --@returns String with whitespace removed from its beginning and end local function trim(s) assert(type(s) == 'string', 'Only strings can be trimmed') - local result = s:gsub('^%s+', ''):gsub('%s+$', '') - return result + return s:match('^%s*(.*%S)') or '' end local function __index(t, key) |