Skip to content

Commit

Permalink
Trim vim system commands (#69)
Browse files Browse the repository at this point in the history
When vim executes a system command it gets the full string response, including the trailing newline character

This newline needs to be trimmed off the end of the return value before doing a string comparison with the value of the existing colorscheme

This prevents the focus handler resetting the colorscheme every time it's called, but rather just when an actual change has occurred
  • Loading branch information
phantomwhale authored Sep 30, 2024
1 parent 7e36149 commit 1f9b545
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ local function get_tinty_theme()
if vim.v.shell_error ~= 0 then
return default_theme
else
return theme_name
return vim.trim(theme_name)
end
end

Expand Down Expand Up @@ -258,7 +258,7 @@ function! GetTintyTheme()
if v:shell_error != 0
return g:default_theme
else
return l:theme_name
return trim(l:theme_name)
endif
endfunction
Expand Down

0 comments on commit 1f9b545

Please sign in to comment.