I suggest stop exporting buffer in view, we should just export some necessary functionality through view e.g functions currently included in view_buffer_generated.go so we will have Fullline, Line, Substr, ... as separate methods for View.
My main reasons are:
There is no need for other packages to access whole buffer functionality through view
Also we are making some changes directly to buffer like v.Buffer().SetFileName(filename)here that should be STH like v.SetFileName(filename) so we can manage it from view
While looking in commands saw this(using v.Buffer().Erase instead of v.Erase) exporting buffer without necessity results in people using it in a wrong way.
There are more examples in commands package specially in tests.
I suggest stop exporting buffer in view, we should just export some necessary functionality through view e.g functions currently included in view_buffer_generated.go so we will have
Fullline
,Line
,Substr
, ... as separate methods forView
.My main reasons are:
v.Buffer().SetFileName(filename)
here that should be STH likev.SetFileName(filename)
so we can manage it from view