aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/osc52.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-12-06 10:55:50 -0800
committerGitHub <noreply@github.com>2023-12-06 10:55:50 -0800
commit08545bd45b80e3056fc8c6c4eb25e2ef1fddd897 (patch)
tree798ac51dc30ebc95617ffdbaaa4c474d70b3d226 /runtime/plugin/osc52.lua
parentca7f8786a0eb578895400e23cd21e25cc0f91800 (diff)
parenta5a346678a8211ea07f318de42e557ad3909f65e (diff)
downloadrneovim-08545bd45b80e3056fc8c6c4eb25e2ef1fddd897.tar.gz
rneovim-08545bd45b80e3056fc8c6c4eb25e2ef1fddd897.tar.bz2
rneovim-08545bd45b80e3056fc8c6c4eb25e2ef1fddd897.zip
Merge pull request #26407 from gpanders/default-tgc
feat(defaults): enable 'termguicolors' by default when supported by terminal
Diffstat (limited to 'runtime/plugin/osc52.lua')
-rw-r--r--runtime/plugin/osc52.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/plugin/osc52.lua b/runtime/plugin/osc52.lua
index 374b70066f..7a90518966 100644
--- a/runtime/plugin/osc52.lua
+++ b/runtime/plugin/osc52.lua
@@ -6,7 +6,11 @@ if not tty or vim.g.clipboard ~= nil or vim.o.clipboard ~= '' or not os.getenv('
return
end
-require('vim.termcap').query('Ms', function(cap, seq)
+require('vim.termcap').query('Ms', function(cap, found, seq)
+ if not found then
+ return
+ end
+
assert(cap == 'Ms')
-- Check 'clipboard' and g:clipboard again to avoid a race condition
@@ -16,7 +20,7 @@ require('vim.termcap').query('Ms', function(cap, seq)
-- If the terminal reports a sequence other than OSC 52 for the Ms capability
-- then ignore it. We only support OSC 52 (for now)
- if not seq:match('^\027%]52') then
+ if not seq or not seq:match('^\027%]52') then
return
end