From b9f6ed875854a8b0fbcf7420151622e94c83cc72 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:51:57 +0200 Subject: [PATCH] feat: Add more common utils --- common/lsp.go | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 common/lsp.go diff --git a/common/lsp.go b/common/lsp.go new file mode 100644 index 0000000..eede1be --- /dev/null +++ b/common/lsp.go @@ -0,0 +1,5 @@ +package common + +func CursorToCharacterIndex(cursor uint32) uint32 { + return max(0, cursor-1) +}