From 5d7d62c73b258d06efaf5d93026b9e556e4e84d8 Mon Sep 17 00:00:00 2001 From: Andrey Proskurin Date: Sun, 9 May 2021 18:17:20 +0000 Subject: view.c: add word wrapping this is contolled by the wrapcolumn/wc and breakat/brk options related #142: Word wrap and line breaks related #932: Vis for Prose? related #1092: Disabling line wrapping --- sam.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sam.c') diff --git a/sam.c b/sam.c index 5a8a0b1..60d204e 100644 --- a/sam.c +++ b/sam.c @@ -301,6 +301,8 @@ enum { OPTION_CHANGE_256COLORS, OPTION_LAYOUT, OPTION_IGNORECASE, + OPTION_BREAKAT, + OPTION_WRAP_COLUMN, }; static const OptionDef options[] = { @@ -394,6 +396,16 @@ static const OptionDef options[] = { VIS_OPTION_TYPE_BOOL, VIS_HELP("Ignore case when searching") }, + [OPTION_BREAKAT] = { + { "breakat", "brk" }, + VIS_OPTION_TYPE_STRING|VIS_OPTION_NEED_WINDOW, + VIS_HELP("Characters which might cause a word wrap") + }, + [OPTION_WRAP_COLUMN] = { + { "wrapcolumn", "wc" }, + VIS_OPTION_TYPE_NUMBER|VIS_OPTION_NEED_WINDOW, + VIS_HELP("Wrap lines at minimum of window width and wrapcolumn") + }, }; bool sam_init(Vis *vis) { -- cgit v1.2.3