Skip to content

Commit

Permalink
fix: fix visual track selection not selecting last track
Browse files Browse the repository at this point in the history
  • Loading branch information
gwatcha committed May 28, 2020
1 parent cdf5d00 commit 584168b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions definitions/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ return {
SelectItems = "SelectItemsCrossingTimeAndTrackSelection",
SelectItemsUnderEditCursor = "_XENAKIOS_SELITEMSUNDEDCURSELTX",
SelectLastOfSelectedTracks = "_XENAKIOS_SELLASTOFSELTRAX",
SelectLastTouchedTrack = 40505,
SetFirstSelectedTrackAsLastTouchedTrack = 40914,
SelectNextNote = {40413, midiCommand=true},
SelectNextNoteSamePitch = {40428, midiCommand=true},
SelectNoteClosestToEditCursor = {40426, midiCommand=true},
Expand Down
5 changes: 2 additions & 3 deletions internal/command/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function runner.extendTrackSelection(movement, args)
movement(table.unpack(args))
local end_pos = runner.getTrackPosition()
local pivot_i = state_functions.getVisualTrackPivotIndex()
log.user("end: " .. end_pos .. " pivot_i: " .. pivot_i)

runner.runAction("UnselectTracks")

Expand Down Expand Up @@ -141,8 +140,8 @@ function runner.getTrackPosition()
end

runner.runAction("UnselectTracks")
runner.runAction("NextTrack")
runner.runAction("PrevTrack")
runner.runAction("SelectLastTouchedTrack")

local track_at_index = reaper.GetSelectedTrack(0, 0)
local index = reaper.GetMediaTrackInfo_Value(track_at_index, "IP_TRACKNUMBER") - 1

Expand Down

0 comments on commit 584168b

Please sign in to comment.