Skip to content

Commit 3c4446d

Browse files
committed
Return to normal mode shouldn't move caret past start of line. Fixes #230
1 parent eddef41 commit 3c4446d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

XSVim.Tests/MiscTests.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ module ``Miscellaneous tests`` =
7676
let ``<C-[> escapes``() =
7777
assertText " abc$" "i<C-[>" " ab$c"
7878

79+
[<Test>]
80+
let ``Return to normal mode doesn't move past start of line``() =
81+
assertText "abc\nd$ef" "i<esc>" "abc\nd$ef"
82+
7983
[<Test>]
8084
let ``dot repeats at start of line``() =
8185
assertText

XSVim/Properties/AssemblyInfo.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ open System.Runtime.CompilerServices
55
[<AutoOpen>]
66
module AddinVersion =
77
[<Literal>]
8-
let version = "0.60.5"
8+
let version = "0.60.6"
99

1010
[<assembly: AssemblyTitle("XSVim")>]
1111
// The assembly version has the format {Major}.{Minor}.{Build}.{Revision}

XSVim/XSVim.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ module Vim =
741741
// https://github.com/mono/monodevelop/blob/fdbfbe89529bd9076e1906e7b70fdb51a9ae6b99/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs#L153
742742
if editor.SelectionMode = SelectionMode.Normal then EditActions.ToggleBlockSelectionMode editor
743743
vimState.undoGroup |> Option.iter(fun d -> d.Dispose())
744-
if vimState.mode = InsertMode then
744+
if vimState.mode = InsertMode && editor.CaretColumn > 1 then
745745
EditActions.MoveCaretLeft editor
746746
{ vimState with mode = NormalMode; lastSelection = lastSelection; undoGroup = None; statusMessage = None }
747747

0 commit comments

Comments
 (0)