summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-04 10:30:55 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-03-04 10:30:55 -0800
commit18032efb5bfc4025cbe2e32cb50d575fefbf482f (patch)
tree0e37d18d005a9820e6b0619a07eeef7ce96c19e9
parent63f810e8ae115ea6838f4c1cabbd41135eca398e (diff)
downloadc-snippets-18032efb5bfc4025cbe2e32cb50d575fefbf482f.tar.gz
c-snippets-18032efb5bfc4025cbe2e32cb50d575fefbf482f.tar.bz2
c-snippets-18032efb5bfc4025cbe2e32cb50d575fefbf482f.zip
- Copyright year bump - The tabsize is now set equal to shiftwidth when expandtabs is true, so that the Tab key in Vim produces shiftwidth spacing, not 8 spaces.
-rw-r--r--autotab.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/autotab.c b/autotab.c
index 0ff3f8f..804c657 100644
--- a/autotab.c
+++ b/autotab.c
@@ -5,7 +5,7 @@
* it as a Vim command to set up the tabstop, shiftwidth and expandtab
* parameters.
*
- * Copyright 2007-2020
+ * Copyright 2007-2022
* Kaz Kylheku <kaz@kylheku.com>
* Vancouver, Canada
*
@@ -43,7 +43,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define AUTOTAB_VER 6
+#define AUTOTAB_VER 7
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -658,7 +658,7 @@ static int determine_shiftwidth(line_t *lines_in, int tabsize, int munged)
}
}
- /* The indent_history turned up nothing; maybe the file
+ /* The indent histogram turned up nothing; maybe the file
only has one level of indentation, with no deeper nesting. */
if (max_hist == 0) {
for (i = 2; i <= 8; i++) {
@@ -776,6 +776,8 @@ int main(int argc, char **argv)
if (!expandtabs)
expandtabs = determine_expandtab(lines, tabsize, shiftwidth);
+ else
+ tabsize = shiftwidth;
out_default:
printf("tabstop=%d shiftwidth=%d %sexpandtab\n", tabsize, shiftwidth,