From cebb280fe546190e55e071b6adbf37cd47950f34 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Mon, 11 May 2026 15:07:55 -0500 Subject: initial commit --- runtime/lua/core/modes.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 runtime/lua/core/modes.lua (limited to 'runtime/lua/core/modes.lua') diff --git a/runtime/lua/core/modes.lua b/runtime/lua/core/modes.lua new file mode 100644 index 0000000..c0cb751 --- /dev/null +++ b/runtime/lua/core/modes.lua @@ -0,0 +1,20 @@ +local M = {} + +function M.set_mode(state, mode_name) + if mode_name ~= "normal" and mode_name ~= "insert" then + return false, "unknown mode: " .. tostring(mode_name) + end + + state.mode = mode_name + return true +end + +function M.is_insert(state) + return state.mode == "insert" +end + +function M.is_normal(state) + return state.mode == "normal" +end + +return M -- cgit v1.3.1