Repository: qutebrowser/qutebrowser
Pull request: Add correct maximum and minimum value for tabs.switching_delay 
This Pull Request tries to fix Issue#3629 

I was not sure about whether to set minval to 0 or not as negative values seem pretty useless for this option.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/qutebrowser/qutebrowser/3733)
<!-- Reviewable:end -->

[edit by @jgkamat to link issues: Closes #3629]

Problem statement:
tabs.switching_delay doesn't have correct maximum value
```
17:57:39 DEBUG    config     config:set_str:400 Setting tabs.show_switching_delay (type Int) to 999999999999999999999999 (converted from '999999999999999999999999')
17:57:39 ERROR    misc       crashsignal:exception_hook:216 Uncaught exception
Traceback (most recent call last):
  File "/home/florian/proj/qutebrowser/git/qutebrowser/mainwindow/tabwidget.py", line 351, in _on_config_changed
    self._on_show_switching_delay_changed()
  File "/home/florian/proj/qutebrowser/git/qutebrowser/mainwindow/tabwidget.py", line 366, in _on_show_switching_delay_changed
    self._auto_hide_timer.setInterval(config.val.tabs.show_switching_delay)
OverflowError: argument 1 overflowed: value must be in the range -2147483648 to 2147483647
```

Hints from issue discussion:
@The-Compiler Hey I am newbie. Shall I give this a try?

@thakkardharmik Yup, I think this is a simple starter issue if you're interested in contributing to qb!

You probably want to take a look at [configdata.yml](https://github.com/qutebrowser/qutebrowser/blob/master/qutebrowser/config/configdata.yml#L1326), which has all the configuration settings. 

If you take a look at the other settings in the file, there's the `maxval` key on some of them, which I think should do the job in this case. I'm not sure exactly how to bound the negative side though, which would be nice too :).

Commit message: Add correct maximum and minimum value for tabs.switching_delay

Patch to review:
diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml
index a6a2d531735..9cfd6cb900b 100644
--- a/qutebrowser/config/configdata.yml
+++ b/qutebrowser/config/configdata.yml
@@ -1325,7 +1325,10 @@ tabs.show:
 
 tabs.show_switching_delay:
   default: 800
-  type: Int
+  type:
+    name: Int
+    minval: -2147483648
+    maxval: 2147483647
   desc: "Duration (in milliseconds) to show the tab bar before hiding it when
     tabs.show is set to 'switching'."
 


Code review comments:
diff_hunk: @@ -1325,7 +1325,10 @@ tabs.show:
 
 tabs.show_switching_delay:
   default: 800
-  type: Int
+  type:
+    name: Int
+    minval: -2147483648
+    maxval: 2147483647
path: qutebrowser/config/configdata.yml
text: @user1:
I think it would be a bit cleaner to set this to `maxint` rather than the literal value of the maximum int. [see this for an example](https://github.com/AlternateData/qutebrowser/blob/a52d18b700df262945384b70f1ffb58fc2fa0360/qutebrowser/config/configdata.yml#L195).