Improved save with sudo

This commit is contained in:
Zachary Yedidia
2019-12-22 17:24:00 -05:00
parent fc706bc404
commit 3f22501b1a
2 changed files with 67 additions and 49 deletions

View File

@@ -118,12 +118,12 @@ func (w *BufWindow) Clear() {
// but if softwrap is enabled things get complicated since one buffer
// line can take up multiple lines in the view
func (w *BufWindow) Bottomline() int {
// b := w.Buf
b := w.Buf
// TODO: possible non-softwrap optimization
// if !b.Settings["softwrap"].(bool) {
// return w.StartLine + w.Height
// }
if !b.Settings["softwrap"].(bool) || !w.hasCalcHeight {
return w.StartLine + w.Height
}
prev := 0
for _, l := range w.lineHeight {