Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69ca754 commit 74c01eeCopy full SHA for 74c01ee
1 file changed
Source/SLKTextInput+Extension.m
@@ -88,8 +88,9 @@ - (NSString *)wordAtRange:(NSRange)range rangeInText:(NSRangePointer)rangePointe
88
89
if (location > 0) {
90
NSString *characterBeforeCursor = [text substringWithRange:NSMakeRange(location-1, 1)];
91
+ NSRange whitespaceRange = [characterBeforeCursor rangeOfCharacterFromSet:[NSCharacterSet whitespaceCharacterSet]];
92
- if ([characterBeforeCursor isEqualToString:@" "]) {
93
+ if (whitespaceRange.length == 1) {
94
// At the start of a word, just use the word behind the cursor for the current word
95
*rangePointer = NSMakeRange(location, rightPart.length);
96
0 commit comments