fix memory leak in ledit_get_next_line(). Reset line counter when disabled. Shrink text file buffer for terminal_send_file. misc changes.