mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
Merge pull request #764 from yannicka/master
OutdentSelection works on all cases (whatever tabsize or tabstospace values)
This commit is contained in:
commit
27f99b6309
@ -786,19 +786,12 @@ func (v *View) OutdentSelection(usePlugin bool) bool {
|
||||
|
||||
startY := start.Y
|
||||
endY := end.Move(-1, v.Buf).Y
|
||||
endX := end.Move(-1, v.Buf).X
|
||||
for y := startY; y <= endY; y++ {
|
||||
for x := 0; x < len(v.Buf.IndentString()); x++ {
|
||||
if len(GetLeadingWhitespace(v.Buf.Line(y))) == 0 {
|
||||
break
|
||||
}
|
||||
v.Buf.Remove(Loc{0, y}, Loc{1, y})
|
||||
if y == startY && start.X > 0 {
|
||||
v.Cursor.SetSelectionStart(start.Move(-1, v.Buf))
|
||||
}
|
||||
if y == endY {
|
||||
v.Cursor.SetSelectionEnd(Loc{endX - x, endY})
|
||||
}
|
||||
}
|
||||
}
|
||||
v.Cursor.Relocate()
|
||||
|
Loading…
Reference in New Issue
Block a user