Merge pull request #908 from lorenzhs/altoption
Allow users to disable the alt+%d buffer switching
This commit is contained in:
commit
5ed67d871f
3 changed files with 13 additions and 2 deletions
10
index.html
10
index.html
|
@ -484,6 +484,16 @@ npm run build-electron-{windows, darwin, linux}</pre>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="desktop">
|
||||||
|
<form class="form-inline" role="form">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" ng-model="settings.enableQuickKeys">
|
||||||
|
Use Alt+[0-9] to switch buffers
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
|
@ -44,6 +44,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
'readlineBindings': false,
|
'readlineBindings': false,
|
||||||
'enableJSEmoji': (utils.isMobileUi() ? false : true),
|
'enableJSEmoji': (utils.isMobileUi() ? false : true),
|
||||||
'enableMathjax': false,
|
'enableMathjax': false,
|
||||||
|
'enableQuickKeys': true,
|
||||||
'customCSS': '',
|
'customCSS': '',
|
||||||
"currentlyViewedBuffers":{},
|
"currentlyViewedBuffers":{},
|
||||||
});
|
});
|
||||||
|
|
|
@ -247,7 +247,7 @@ weechat.directive('inputBar', function() {
|
||||||
$scope.iterCandidate = null;
|
$scope.iterCandidate = null;
|
||||||
|
|
||||||
// Left Alt+[0-9] -> jump to buffer
|
// Left Alt+[0-9] -> jump to buffer
|
||||||
if ($event.altKey && !$event.ctrlKey && (code > 47 && code < 58)) {
|
if ($event.altKey && !$event.ctrlKey && (code > 47 && code < 58) && settings.enableQuickKeys) {
|
||||||
if (code === 48) {
|
if (code === 48) {
|
||||||
code = 58;
|
code = 58;
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ weechat.directive('inputBar', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alt key down -> display quick key legend
|
// Alt key down -> display quick key legend
|
||||||
if ($event.type === "keydown" && code === 18 && !$event.ctrlKey && !$event.shiftKey) {
|
if ($event.type === "keydown" && code === 18 && !$event.ctrlKey && !$event.shiftKey && settings.enableQuickKeys) {
|
||||||
$rootScope.showQuickKeys = true;
|
$rootScope.showQuickKeys = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue