Prat_EditboxArrows = Prat:NewModule('editboxarrows')

function Prat_EditboxArrows:OnInitialize()
    local db = Prat.db.profile

    if not db.EditboxArrows then
        db.EditboxArrows = {
            on = true
        }
    end

    Prat.Options.args.editboxarrows = {
        name = 'EditboxArrows',
        desc = 'EditboxArrows',
        type = 'group',
        args = {
            toggle = {
                name = 'Toggle',
                desc = 'Toggle the module on and off',
                type = 'toggle',
                get = function() return db.EditboxArrows.on end,
                set = function(v)
                    if v then
                        self:OnEnable()
                    else
                        self:OnDisable()
                    end
                    db.EditboxArrows.on = v
                end
            }
        }
    }
end

function Prat_EditboxArrows:OnEnable()
    local eb = VisorEditBox or ChatFrameEditBox
    eb:SetAltArrowKeyMode(false)
end

function Prat_EditboxArrows:OnDisable()
    local eb = VisorEditBox or ChatFrameEditBox
    eb:SetAltArrowKeyMode(true)
end

