Skip to content

Commit 584168b

Browse files
committed
fix: fix visual track selection not selecting last track
1 parent cdf5d00 commit 584168b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

definitions/actions.lua

+2
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ return {
328328
SelectItems = "SelectItemsCrossingTimeAndTrackSelection",
329329
SelectItemsUnderEditCursor = "_XENAKIOS_SELITEMSUNDEDCURSELTX",
330330
SelectLastOfSelectedTracks = "_XENAKIOS_SELLASTOFSELTRAX",
331+
SelectLastTouchedTrack = 40505,
332+
SetFirstSelectedTrackAsLastTouchedTrack = 40914,
331333
SelectNextNote = {40413, midiCommand=true},
332334
SelectNextNoteSamePitch = {40428, midiCommand=true},
333335
SelectNoteClosestToEditCursor = {40426, midiCommand=true},

internal/command/runner.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ function runner.extendTrackSelection(movement, args)
110110
movement(table.unpack(args))
111111
local end_pos = runner.getTrackPosition()
112112
local pivot_i = state_functions.getVisualTrackPivotIndex()
113-
log.user("end: " .. end_pos .. " pivot_i: " .. pivot_i)
114113

115114
runner.runAction("UnselectTracks")
116115

@@ -141,8 +140,8 @@ function runner.getTrackPosition()
141140
end
142141

143142
runner.runAction("UnselectTracks")
144-
runner.runAction("NextTrack")
145-
runner.runAction("PrevTrack")
143+
runner.runAction("SelectLastTouchedTrack")
144+
146145
local track_at_index = reaper.GetSelectedTrack(0, 0)
147146
local index = reaper.GetMediaTrackInfo_Value(track_at_index, "IP_TRACKNUMBER") - 1
148147

0 commit comments

Comments
 (0)