Skip to content

Commit

Permalink
Return to normal mode shouldn't move caret past start of line. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
nosami committed Jun 13, 2018
1 parent eddef41 commit 3c4446d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions XSVim.Tests/MiscTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ module ``Miscellaneous tests`` =
let ``<C-[> escapes``() =
assertText " abc$" "i<C-[>" " ab$c"

[<Test>]
let ``Return to normal mode doesn't move past start of line``() =
assertText "abc\nd$ef" "i<esc>" "abc\nd$ef"

[<Test>]
let ``dot repeats at start of line``() =
assertText
Expand Down
2 changes: 1 addition & 1 deletion XSVim/Properties/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open System.Runtime.CompilerServices
[<AutoOpen>]
module AddinVersion =
[<Literal>]
let version = "0.60.5"
let version = "0.60.6"

[<assembly: AssemblyTitle("XSVim")>]
// The assembly version has the format {Major}.{Minor}.{Build}.{Revision}
Expand Down
2 changes: 1 addition & 1 deletion XSVim/XSVim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ module Vim =
// https://github.com/mono/monodevelop/blob/fdbfbe89529bd9076e1906e7b70fdb51a9ae6b99/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs#L153
if editor.SelectionMode = SelectionMode.Normal then EditActions.ToggleBlockSelectionMode editor
vimState.undoGroup |> Option.iter(fun d -> d.Dispose())
if vimState.mode = InsertMode then
if vimState.mode = InsertMode && editor.CaretColumn > 1 then
EditActions.MoveCaretLeft editor
{ vimState with mode = NormalMode; lastSelection = lastSelection; undoGroup = None; statusMessage = None }

Expand Down

0 comments on commit 3c4446d

Please sign in to comment.