From 06c4906d5aada45158ae53d79eb8cf42ab58bb36 Mon Sep 17 00:00:00 2001 From: Jason Poon Date: Sat, 6 Aug 2016 11:33:22 +1000 Subject: [PATCH] Hack to mitigate #569 and prevent extension from locking up (#576) --- gulpfile.js | 6 ++---- src/actions/actions.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8df1468ac1a..7353a0f7c49 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -73,10 +73,8 @@ gulp.task('tslint', ['fix-whitespace'], function() { return merge(srcs, tests); }); -gulp.task('compile', shell.task([ - 'node ./node_modules/vscode/bin/compile -p ./', -])); - +gulp.task('compile', shell.task(['npm run vscode:prepublish'])); +gulp.task('watch', shell.task(['npm run compile'])); gulp.task('init', ['typings']); gulp.task('default', ['tslint', 'compile']); gulp.task('release', ['default', 'patch']); diff --git a/src/actions/actions.ts b/src/actions/actions.ts index ad59fb760e9..3522dca270d 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -573,6 +573,14 @@ class CommandHash extends BaseCommand { vimState.searchState = new SearchState(SearchDirection.Backward, vimState.cursorPosition, currentWord); + // hack start + // temporary fix for https://github.com/VSCodeVim/Vim/issues/569 + let text = TextEditor.getText(new vscode.Range(vimState.cursorPosition, vimState.cursorPosition.getRight())); + if (text === " ") { + return vimState; + } + // hack end + do { // use getWordLeft() on position to start at the beginning of the word. // this ensures that any matches happen ounside of the word currently selected,