From: op Date: Fri, 28 Apr 2023 10:02:03 +0000 (+0000) Subject: fix lfindent (newline-and-indent) comment and description in the man page X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=af4c3b2e07d8940a0be60ab84985f758badd0fbe;p=openbsd fix lfindent (newline-and-indent) comment and description in the man page for a while it has used only spaces when no-tab-mode is enabled and respected the current buffer tab width. --- diff --git a/usr.bin/mg/mg.1 b/usr.bin/mg/mg.1 index 3e9c59ad3ff..2387b29a106 100644 --- a/usr.bin/mg/mg.1 +++ b/usr.bin/mg/mg.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mg.1,v 1.133 2023/04/28 09:50:50 op Exp $ +.\" $OpenBSD: mg.1,v 1.134 2023/04/28 10:02:03 op Exp $ .\" This file is in the public domain. .\" .Dd $Mdocdate: April 28 2023 $ @@ -760,8 +760,9 @@ Process a negative argument for keyboard-invoked functions. Insert a newline into the current buffer. .It Ic newline-and-indent Insert a newline, then enough tabs and spaces to duplicate the indentation -of the previous line. -Assumes tabs are every eight characters. +of the previous line, respecting +.Ic no-tab-mode +and the buffer tab width. .It Ic next-line Move forward .Va n diff --git a/usr.bin/mg/util.c b/usr.bin/mg/util.c index acb3714b28d..dd42085a24a 100644 --- a/usr.bin/mg/util.c +++ b/usr.bin/mg/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.49 2023/04/21 14:14:13 op Exp $ */ +/* $OpenBSD: util.c,v 1.50 2023/04/28 10:02:03 op Exp $ */ /* This file is in the public domain. */ @@ -363,9 +363,9 @@ doindent(int cols) /* * Insert a newline, then enough tabs and spaces to duplicate the indentation - * of the previous line. Assumes tabs are every eight characters. Quite - * simple. Figure out the indentation of the current line. Insert a newline - * by calling the standard routine. Insert the indentation by inserting the + * of the previous line, respecting no-tab-mode and the buffer tab width. + * Figure out the indentation of the current line. Insert a newline by + * calling the standard routine. Insert the indentation by inserting the * right number of tabs and spaces. Return TRUE if all ok. Return FALSE if * one of the subcommands failed. Normally bound to "C-m". */