summaryrefslogtreecommitdiff
path: root/lua/clever_f/host_adapter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/clever_f/host_adapter.lua')
-rw-r--r--lua/clever_f/host_adapter.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/clever_f/host_adapter.lua b/lua/clever_f/host_adapter.lua
index 51591a9..7a71fb8 100644
--- a/lua/clever_f/host_adapter.lua
+++ b/lua/clever_f/host_adapter.lua
@@ -65,6 +65,25 @@ function HostAdapter:runtime()
return adapter_records[self].runtime
end
+function HostAdapter:read_encoding()
+ local runtime = self:runtime()
+ return runtime.api.nvim_get_option_value(
+ "encoding",
+ { scope = "global" }
+ )
+end
+
+function HostAdapter:lowercase(value)
+ if type(value) ~= "string" then
+ fail("case conversion value must be a string", 2)
+ end
+ local result = self:runtime().fn.tolower(value)
+ if type(result) ~= "string" then
+ fail("Nvim case conversion must return a string", 2)
+ end
+ return result
+end
+
local function next_identity(adapter, prefix)
local record = adapter_records[adapter]
local identity = prefix .. "-" .. tostring(record.next_identity)