~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/core/Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                                return offset;
105
105
                        var line = doc.GetLineByOffset (offset);
106
106
                        char first = doc.GetCharAt (offset);
107
 
 
108
107
                        while (offset >= line.Offset && offset < line.Offset + line.EditableLength) {
109
108
                                char ch = doc.GetCharAt (offset);
110
109
                                if (char.IsWhiteSpace (first) && !char.IsWhiteSpace (ch)
111
 
                                    || IsNoLetterOrDigit (first) && !IsNoLetterOrDigit (ch)
 
110
                                    || IsNoIdentifierPart (first) && !IsNoIdentifierPart (ch)
112
111
                                    || (char.IsLetterOrDigit (first) || first == '_') && !(char.IsLetterOrDigit (ch) || ch == '_'))
113
112
                                        break;
114
113
 
118
117
                                                System.Math.Max (line.Offset, offset + (forwardDirection ? 0 : 1)));
119
118
                }
120
119
                
121
 
                static bool IsNoLetterOrDigit (char ch)
 
120
                static bool IsNoIdentifierPart (char ch)
122
121
                {
123
 
                        return !char.IsWhiteSpace (ch) && !char.IsLetterOrDigit (ch);
 
122
                        return !char.IsWhiteSpace (ch) && !char.IsLetterOrDigit (ch) && ch != '_';
124
123
                }
125
124
        }
126
 
}
 
125