use strict;
use Irssi qw(signal_add_first signal_stop settings_get_int settings_add_int);
use vars qw($VERSION %IRSSI);

$VERSION = '0.6';
%IRSSI = (
    authors     => 'Mathieu Doidy',
    contact     => 'mdoidy at roulaize dot net',
    name        => 'start_tab',
    description => 'replaces the <tab> at the beginning of a line by a configurable number of spaces',
    license     => 'GNU GPL v2',
    url         => 'http://irssi.roulaize.net',
    changed     => '10/10/2003'
);

sub sig_complete_word {
    my $list = shift; shift;
    return if (shift() || shift());
    $_ = settings_get_int('start_tab_num_space');
    push @$list, ' 'x$_;	
    signal_stop();
}

signal_add_first('complete word', \&sig_complete_word);
settings_add_int( $IRSSI{name}, 'start_tab_num_space', 4);
