foot/extract.h
Daniel Eklöf 194cf1ce87
selection: trim trailing spaces from block selections
The extract_*() family of functions can now optionally treat spaces as
empty cells.

Use this in selection_to_text() to trim trailing spaces from block
selections.

Closes #181
2020-11-10 19:47:23 +01:00

18 lines
425 B
C

#pragma once
#include <stddef.h>
#include <stdbool.h>
#include "terminal.h"
struct extraction_context;
struct extraction_context *extract_begin(
enum selection_kind kind, bool trim_trailing_spaces);
bool extract_one(
const struct terminal *term, const struct row *row, const struct cell *cell,
int col, void *context);
bool extract_finish(
struct extraction_context *context, char **text, size_t *len);