From 2913e4605f72037ef11ecf259858a709149393a6 Mon Sep 17 00:00:00 2001 From: Aviral Dasgupta Date: Fri, 16 Sep 2016 15:38:29 +0530 Subject: [PATCH] Fix unicode completions in autocomplete. Fixes vector-im/vector-web#2208 --- src/autocomplete/AutocompleteProvider.js | 2 +- src/autocomplete/RoomProvider.js | 2 +- src/autocomplete/UserProvider.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autocomplete/AutocompleteProvider.js b/src/autocomplete/AutocompleteProvider.js index 7335262a24..9cdb774cac 100644 --- a/src/autocomplete/AutocompleteProvider.js +++ b/src/autocomplete/AutocompleteProvider.js @@ -18,7 +18,7 @@ export default class AutocompleteProvider { let commandRegex = this.commandRegex; if (force && this.shouldForceComplete()) { - commandRegex = /[^\W]+/g; + commandRegex = /\S+/g; } if (commandRegex == null) { diff --git a/src/autocomplete/RoomProvider.js b/src/autocomplete/RoomProvider.js index 1934f572fb..f3401cf1bb 100644 --- a/src/autocomplete/RoomProvider.js +++ b/src/autocomplete/RoomProvider.js @@ -6,7 +6,7 @@ import {PillCompletion} from './Components'; import {getDisplayAliasForRoom} from '../Rooms'; import sdk from '../index'; -const ROOM_REGEX = /(?=#)([^\s]*)/g; +const ROOM_REGEX = /(?=#)(\S*)/g; let instance = null; diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index e57847e2f1..4d40fbdf94 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -5,7 +5,7 @@ import Fuse from 'fuse.js'; import {PillCompletion} from './Components'; import sdk from '../index'; -const USER_REGEX = /@[^\s]*/g; +const USER_REGEX = /@\S*/g; let instance = null;