Skip to content

Commit

Permalink
fix o and O on feedback closed
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrc committed Jul 12, 2024
1 parent 01aa4ec commit b4fbf06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/definitions/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ return {
FitSelectedItemsByStretching = 41206,
FitNotes = { 40754, midiCommand = true },
FocusMain = "_S&M_WNMAIN",
FocusTracks = "_BR_FOCUS_TRACKS",
FocusMidiEditor = "_SN_FOCUS_MIDI_EDITOR",
FolderChildren = { "SelectFolderChildren", "ScrollToSelectedTracks" },
FolderParent = { "SelectFolderParent", "ScrollToSelectedTracks" },
Folder = { "SelectFolder", "ScrollToSelectedTracks" },
Expand Down
7 changes: 6 additions & 1 deletion internal/state_machine/state_machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local buildCommand = require('command.builder')
local handleCommand = require('command.handler')
local getPossibleFutureEntries = require('command.completer')
local config = require 'definitions.config'.general
local actions = require 'definitions.actions'
local log = require('utils.log')
local format = require('utils.format')
local feedback = require('gui.feedback.controller')
Expand Down Expand Up @@ -141,8 +142,12 @@ local function input()
feedback.update()

-- This works only when window is docked, nothing we can do otherwise
local defocus_window = section_id == 0 and "_BR_FOCUS_TRACKS" or "_SN_FOCUS_MIDI_EDITOR"
local defocus_window = section_id == 0
and actions.FocusTracks or actions.FocusMidiEditor
reaper.Main_OnCommand(reaper.NamedCommandLookup(defocus_window), 0)

-- When we insert track with feedback window closed, it steals focus and track is not renamed
if hotkey.key:lower() == "o" then reaper.Main_OnCommand(actions.RenameTrack, 0) end
end

return input

0 comments on commit b4fbf06

Please sign in to comment.