Skip to content

Commit 5d7027f

Browse files
committed
fix(completion): avoid invalid position
1 parent 1d53fb2 commit 5d7027f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ typings/
6363
.env
6464

6565
out/
66+
.DS_Store

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vim-language-server",
3-
"version": "2.2.10",
3+
"version": "2.2.11",
44
"description": "vim language server",
55
"keywords": [
66
"viml",

src/common/util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ export function getWordFromPosition(
131131
return;
132132
}
133133

134+
// invalid character which less than 0
135+
if (position.character < 0) {
136+
return
137+
}
138+
134139
const character = doc.getText(
135140
Range.create(
136141
Position.create(position.line, position.character),

0 commit comments

Comments
 (0)