4coder » Forums » How to read from a buffer that has no file backing
edrickhong
2 posts
#20854 How to read from a buffer that has no file backing
3 months, 2 weeks ago Edited by edrickhong on April 4, 2019, 12:55 p.m. Reason: Initial post

I use cmake for my build system and I'm trying to hack in a cmake formatter into 4coder. Currently, I am calling exec_system_command to call the cmake-format python script on the target file and it outputs the formatted text into an output 4coder buffer that has no file backing. I now want to copy the contents from this 4coder buffer to the target file buffer but I am not sure how. I tried calling get_buffer after the exec_system_command call and the returned size from the buffer summary is still 0. I tried manually ready 4 bytes or so with buffer_read_range and it seems to read in 0 bytes anyway.