aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorAndrey Proskurin <andreyproskurin@protonmail.com>2021-05-09 18:17:20 +0000
committerRandy Palamar <palamar@ualberta.ca>2023-07-28 12:46:29 -0600
commit5d7d62c73b258d06efaf5d93026b9e556e4e84d8 (patch)
tree303ae344ee97f48a5bab4d6b98153c2f6e1a17c6 /sam.c
parent1a81e0997422f0cbe249095d1b1b8ed5f4a4f983 (diff)
downloadvis-5d7d62c73b258d06efaf5d93026b9e556e4e84d8.tar.gz
vis-5d7d62c73b258d06efaf5d93026b9e556e4e84d8.tar.xz
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
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c12
1 files changed, 12 insertions, 0 deletions
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) {