Skip to content

Commit

Permalink
endsWith instead of equals for line end and snippet prefix, fixes #10824
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Aug 24, 2016
1 parent e9f2882 commit 85c02e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vs/editor/contrib/suggest/browser/tabCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {RawContextKey, IContextKeyService, ContextKeyExpr} from 'vs/platform/con
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
import {ISnippetsRegistry, Extensions, getNonWhitespacePrefix, ISnippet} from 'vs/editor/common/modes/snippetsRegistry';
import {Registry} from 'vs/platform/platform';
import {endsWith} from 'vs/base/common/strings';
import {IDisposable} from 'vs/base/common/lifecycle';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {CommonEditorRegistry, EditorCommand} from 'vs/editor/common/editorCommonExtensions';
Expand Down Expand Up @@ -49,7 +50,7 @@ class TabCompletionController implements editorCommon.IEditorContribution {

if (prefix) {
snippetsRegistry.visitSnippets(editor.getModel().getModeId(), s => {
if (prefix === s.prefix) {
if (endsWith(prefix, s.prefix)) {
this._currentSnippets.push(s);
}
return true;
Expand Down

2 comments on commit 85c02e9

@joselee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@jrieken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Please sign in to comment.