From eddb0ef41b430572edc873d8953b8ab2c954cfe5 Mon Sep 17 00:00:00 2001 From: amagalma Date: Thu, 6 Feb 2025 12:58:11 +0200 Subject: [PATCH] Update amagalma_Move cursor to equivalent position inside next similarly named Region.lua --- ...osition inside next similarly named Region.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Regions/amagalma_Move cursor to equivalent position inside next similarly named Region.lua b/Regions/amagalma_Move cursor to equivalent position inside next similarly named Region.lua index f5f0e3c6f..0e7dfeb6d 100644 --- a/Regions/amagalma_Move cursor to equivalent position inside next similarly named Region.lua +++ b/Regions/amagalma_Move cursor to equivalent position inside next similarly named Region.lua @@ -1,8 +1,13 @@ -- @description Move cursor to equivalent position inside next similarly named Region -- @author amagalma --- @version 1.00 +-- @version 1.01 +-- @changelog Slightly changed logic for matching -- @donation https://www.paypal.me/amagalma +if reaper.GetPlayState() & 4 == 4 then + return reaper.defer(function() end) +end + local cur_pos = reaper.GetCursorPosition() local cur_region, _ = {} _, cur_region.idx = reaper.GetLastMarkerAndCurRegion( 0, cur_pos ) @@ -11,9 +16,9 @@ _, _, cur_region.start, _, cur_region.name = reaper.EnumProjectMarkers( cur_regi local cur_pos_in_Region = cur_pos - cur_region.start -local function KeepWords(str) +local function KeepLetters(str) local t, c = {}, 0 - for word in str:gmatch("%w+") do + for word in str:gmatch("%a+") do if not tonumber(word) then c = c + 1 t[c] = word @@ -33,7 +38,7 @@ local function compareStrings(A, B) return numB >= numA end - return KeepWords(A) == KeepWords(B) + return KeepLetters(A) == KeepLetters(B) end @@ -52,3 +57,5 @@ while true do end i = i + 1 end + +reaper.defer(function() end)