summaryrefslogtreecommitdiff
path: root/usr.bin/mg/funmap.c
diff options
context:
space:
mode:
authorOmar Polo <op@cvs.openbsd.org>2023-04-17 09:49:05 +0000
committerOmar Polo <op@cvs.openbsd.org>2023-04-17 09:49:05 +0000
commit181c8c991bf298c1b271a09cf5182cbeea4bae5e (patch)
tree0a1446291f67a5bf70ddeb9a2d99b7ad2b5c2e6e /usr.bin/mg/funmap.c
parent0441ee96acf9f17b42b288204bfde0ac325b073a (diff)
resurrect mg' no-tab-mode
It's a mode that makes mg insert spaces up to the next tab stop upon pressing TAB, along with the various tweaks needed in other places so for e.g. auto-indent-mode also uses spaces. This is not just an unifdef NOTAB: even under no-tab-mode mg should consider literal TAB characters wide up to the next tab stop, while the hidden code considered hard tabs to be just control character (i.e. ^I) with width of two columns. I'm also introducing the helper function doindent() in utils.c to de-obfuscate the insertion of tabs/spaces until the given column. ok tb@
Diffstat (limited to 'usr.bin/mg/funmap.c')
-rw-r--r--usr.bin/mg/funmap.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/usr.bin/mg/funmap.c b/usr.bin/mg/funmap.c
index e1c59fa0fb4..fbf41217328 100644
--- a/usr.bin/mg/funmap.c
+++ b/usr.bin/mg/funmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: funmap.c,v 1.65 2022/12/26 19:16:02 jmc Exp $ */
+/* $OpenBSD: funmap.c,v 1.66 2023/04/17 09:49:04 op Exp $ */
/* This file is in the public domain */
@@ -157,9 +157,7 @@ static struct funmap functnames[] = {
{enewline, "newline", 1},
{lfindent, "newline-and-indent", 1},
{forwline, "next-line", 1},
-#ifdef NOTAB
{notabmode, "no-tab-mode", 0},
-#endif /* NOTAB */
{notmodified, "not-modified", 0},
{openline, "open-line", 1},
{nextwind, "other-window", 0},
@@ -212,9 +210,7 @@ static struct funmap functnames[] = {
{shellcommand, "shell-command", 1},
{piperegion, "shell-command-on-region", 1},
{shrinkwind, "shrink-window", 1},
-#ifdef NOTAB
{space_to_tabstop, "space-to-tabstop", 0},
-#endif /* NOTAB */
{splitwind, "split-window-vertically", 0},
{definemacro, "start-kbd-macro", 0},
{spawncli, "suspend-emacs", 0},