diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-05-11 15:07:55 -0500 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-05-11 15:07:55 -0500 |
| commit | cebb280fe546190e55e071b6adbf37cd47950f34 (patch) | |
| tree | 6e7a7605f8832b1c1bd7e467884a8792a5e1fab4 /runtime/lua/core/modes.lua | |
initial commit
Diffstat (limited to 'runtime/lua/core/modes.lua')
| -rw-r--r-- | runtime/lua/core/modes.lua | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
