From c934ee2b253d7cfb86bc063a8dff4f3972980607 Mon Sep 17 00:00:00 2001 From: jacoblchapman Date: Tue, 17 Mar 2015 11:02:23 +0000 Subject: [PATCH] For lineNumber use getCursorBufferPosition() When using getCursorScreenPosition() with soft wrap the line number is incorrect and the location in the document is incorrect. Instead use getCursorBufferPosition() which does not count wrapped lines. For further details see https://atom.io/docs/api/v0.187.0/TextEditor#buffer-vs-screen-coordinates Closes #68 --- lib/composer.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/composer.coffee b/lib/composer.coffee index 83c19720..5f405a98 100644 --- a/lib/composer.coffee +++ b/lib/composer.coffee @@ -148,7 +148,7 @@ class Composer editorDetails = filePath: editor.getPath() - lineNumber: editor.getCursorScreenPosition().row + 1 + lineNumber: editor.getCursorBufferPosition().row + 1 alterParentPath: (targetPath, originalPath) -> targetDir = path.dirname(targetPath)