Make tabwidth a global variable. - sam - An updated version of the sam text editor.
 (HTM) git clone git://vernunftzentrum.de/sam.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 71c66d8c4077758f7f74ffae154d164577f1186c
 (DIR) parent 64ce996d964cb54a14d344c0ea242a73aaedd4f9
 (HTM) Author: Rob King <jking@deadpixi.com>
       Date:   Tue, 17 May 2016 23:46:45 -0500
       
       Make tabwidth a global variable.
       
       Diffstat:
         include/frame.h                     |       2 ++
         libframe/frinit.c                   |       3 ++-
       
       2 files changed, 4 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/include/frame.h b/include/frame.h
       @@ -69,5 +69,7 @@ Point        _frptofcharptb(Frame*, ulong, Point, int);
        Point        _frptofcharnb(Frame*, ulong, int);
        int        _frstrlen(Frame*, int);
        
       +extern int tabwidth;
       +
        #define        NRUNE(b)        ((b)->nrune<0? 1 : (b)->nrune)
        #define        NBYTE(b)        strlen((char*)(b)->a.ptr)
 (DIR) diff --git a/libframe/frinit.c b/libframe/frinit.c
       @@ -4,10 +4,11 @@
        #include <libg.h>
        #include <frame.h>
        
       +int tabwidth = 8;
       +
        void
        frinit(Frame *f, Rectangle r, XftFont *ft, Bitmap *b)
        {
       -        int tabwidth = 8;
                int tabs = atoi(getenv("TABS") ? getenv("TABS") : "");
                if (tabs > 0 && tabs < 12)
                        tabwidth = tabs;