From 310afed6846021f9b46ee783e7f2a25d41b630a4 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 12 Dec 2024 19:38:13 +0200 Subject: Implemented f/t/F/T motions in viminput --- internal/client/ui/viminput/helpers.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/client/ui/viminput/helpers.go') diff --git a/internal/client/ui/viminput/helpers.go b/internal/client/ui/viminput/helpers.go index c3dcdb1..bd12957 100644 --- a/internal/client/ui/viminput/helpers.go +++ b/internal/client/ui/viminput/helpers.go @@ -18,3 +18,16 @@ func IsGrouped(r1, r2 rune) bool { } return !IsKeyword(r2) && !unicode.IsSpace(r2) } + +func SearchChar(line []rune, i, dir int, c rune) (index int, ok bool) { + found := false + for i > 0 && i < len(line) { + if line[i] == c { + found = true + break + } + i += dir + } + + return i, found +} -- cgit v1.3.1