Skip to content

Commit

Permalink
Update amagalma_Move edit cursor to previous visible grid line.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
amagalma authored May 10, 2024
1 parent 857ae61 commit 829b69b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
-- @description Move edit cursor to previous visible grid line
-- @author amagalma
-- @version 1.07
-- @changelog
-- - Fixed case: edit cursor a bit to the right of a grid line
-- @version 1.08
-- @changelog Fix: freeze if grid lines are not visible
-- @about
-- # Moves the edit cursor to the previous grid line that is visible


if reaper.GetToggleCommandState(40145) == 0 then return end
reaper.PreventUIRefresh( 1 )
reaper.Main_OnCommand(40755, 0) -- Snapping: Save snap state
reaper.Main_OnCommand(40754, 0) -- Snapping: Enable snap
local cursorpos = reaper.GetCursorPosition()
Expand Down Expand Up @@ -44,4 +45,5 @@ if cursorpos > 0 then
reaper.SetEditCurPos(grid,1,1)
end
reaper.Main_OnCommand(40756, 0) -- Snapping: Restore snap state
reaper.PreventUIRefresh( -1 )
reaper.defer(function() end)

0 comments on commit 829b69b

Please sign in to comment.