]> git.lizzy.rs Git - micro.git/commitdiff
UpdateRules after save is successful
authorZachary Yedidia <zyedidia@gmail.com>
Thu, 28 May 2020 17:06:29 +0000 (13:06 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Thu, 28 May 2020 17:06:29 +0000 (13:06 -0400)
internal/buffer/save.go

index 5716f22e8e454f2cfb966f8b5701c9aa93b1a49f..d037fb9250c472c69497de51e294ec5274483e82 100644 (file)
@@ -96,7 +96,6 @@ func (b *Buffer) saveToFile(filename string, withSudo bool) error {
                return errors.New("Save with sudo not supported on Windows")
        }
 
-       b.UpdateRules()
        if b.Settings["rmtrailingws"].(bool) {
                for i, l := range b.lines {
                        leftover := util.CharacterCount(bytes.TrimRightFunc(l.data, unicode.IsSpace))
@@ -195,5 +194,6 @@ func (b *Buffer) saveToFile(filename string, withSudo bool) error {
        absPath, _ := filepath.Abs(filename)
        b.AbsPath = absPath
        b.isModified = false
+       b.UpdateRules()
        return err
 }