Skip to content

Commit

Permalink
Fix = formatting. Fixes #263
Browse files Browse the repository at this point in the history
  • Loading branch information
nosami committed Sep 18, 2019
1 parent 1585741 commit ff1e736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
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.65.10.81"
let version = "0.65.11.81"

[<assembly: AssemblyTitle("XSVim")>]

Expand Down
23 changes: 5 additions & 18 deletions XSVim/XSVim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -971,24 +971,11 @@ module Vim =
vimState
| EqualIndent ->
// Always work top to bottom
let start, finish = min start finish, max start finish
let finish =
if editor.[finish-1] = '\n' then
finish - 1
else
finish
let startLine = editor.GetLineByOffset(start)
let endLine = editor.GetLineByOffset(finish).LineNumber

for line in [startLine.LineNumber..endLine] do
let currentIndent = editor.GetLineIndent (line)
let newIndent = editor.IndentationTracker.GetIndentationString(line-1)
editor.ReplaceText(editor.GetLine(line).Offset, currentIndent.Length, newIndent)

editor.CaretOffset <-
let startLine = editor.GetLineByOffset(start)
startLine.Offset + editor.GetLineIndent(startLine).Length
vimState
setSelection vimState editor command start finish
dispatchCommand CodeFormatting.CodeFormattingCommands.FormatBuffer
editor.ClearSelection()
EditActions.MoveCaretToLineStart editor
processCommands config 1 vimState (runOnce Move StartOfLine) false
| Substitute ->
let newState = delete vimState start finish
switchToInsertMode editor newState isInitial
Expand Down

0 comments on commit ff1e736

Please sign in to comment.