Skip to content

Commit

Permalink
fix(snippet): fix cursor position for plain snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Dec 9, 2018
1 parent 565f2a8 commit e628ed6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/snippets/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export class SnippetSession {
if (snippet.isPlainText) {
// insert as text
await document.applyEdits(nvim, [edit])
await nvim.call('cursor', [position.line + 1, position.character + snippetString.length + 1])
let placeholder = snippet.finalPlaceholder
let { start } = placeholder.range
await nvim.call('cursor', [start.line + 1, start.character + 1])
return this._isActive
}
this._changedtick = document.changedtick
Expand Down

0 comments on commit e628ed6

Please sign in to comment.