buffer: Rework to retain support of combined characters

This commit is contained in:
Jöran Karl
2026-01-25 15:38:08 +01:00
parent 2e1249cc67
commit 187ba51fd6
4 changed files with 137 additions and 74 deletions

View File

@@ -249,7 +249,7 @@ func (b *Buffer) saveToFile(filename string, withSudo bool, autoSave bool) error
if !autoSave && b.Settings["rmtrailingws"].(bool) {
for i, l := range b.lines {
leftover := strings.TrimRightFunc(string(l.runes), unicode.IsSpace)
leftover := strings.TrimRightFunc(l.String(), unicode.IsSpace)
linelen := len(l.runes)
b.Remove(Loc{len(leftover), i}, Loc{linelen, i})
}