Closed gulyasm closed 6 years ago
I have ran into this as well and it would be very welcome addition.
@jroimartin Is there anything I can do to move this PR forward?
First of all, thanks for the contribution and sorry for my late response.
It looks good to me. Should we also add a similar method for ViewBuffer
? Something like ViewBufferLines()
? It could be useful for wrapping views.
Thanks, @jroimartin, I updated the PR. 🍦
Thanks! Rebased and merged :)
What is the problem this PR tries to solve?
Many times you want to operate on the individual lines of a View. Example use cases:
Currently, the
Buffer
function returns a concatenated string, that has to be split to use the individual lines. It's unnecessary wasting of computational resource.How this PR solves the problem?
By returning individual lines as strings in an array, you don't have to split the string.
How to manually test this?
For an existing use case try the new
BufferLines
orViewBufferLines
function.Risk
None that I know of.