From 3c30e6ad0720ae41ec4559e60b5009365a508dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 6 May 2017 13:11:27 +0200 Subject: [PATCH] Ctrl-w: ignore all whitespace, not just spaces --- js/inputbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/inputbar.js b/js/inputbar.js index 725f9f0..ca4fe16 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -467,7 +467,7 @@ weechat.directive('inputBar', function() { // Ctrl-w } else if (code == 87) { var trimmedValue = $scope.command.slice(0, caretPos); - var lastSpace = trimmedValue.replace(/ +$/, '').lastIndexOf(' ') + 1; + var lastSpace = trimmedValue.replace(/\s+$/, '').lastIndexOf(' ') + 1; $scope.command = $scope.command.slice(0, lastSpace) + $scope.command.slice(caretPos, $scope.command.length); setTimeout(function() { inputNode.setSelectionRange(lastSpace, lastSpace);