Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add completion_empty_line setting #574

Merged
merged 1 commit into from Nov 11, 2016

Conversation

Projects
None yet
5 participants
@lotheac
Copy link
Contributor

commented Nov 8, 2016

I've been bitten a few times by trying to paste text beginning with a literal tab into a channel, only to have that text go to a query instead. I realized I don't actually want completion to do anything on an empty line, so here's a patch for an option to disable empty line completions.

@LemonBoy

This comment has been minimized.

Copy link
Member

commented Nov 9, 2016

I like this!
But I wonder if we could approach the problem from another angle and make the completion configurable (thus allowing the user to disable it) like this:

if (completion_linestart_cmd[0] == '\0')
    return;
prefix = g_strdup_printf("%c%s", *cmdchars, completion_linestart_cmd);

I wonder if that might end up being useful for someone though.

@dequis

This comment has been minimized.

Copy link
Member

commented Nov 9, 2016

Shouldn't there be a signal_stop(); before the return?

@lotheac

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2016

On Wed, Nov 09 2016 00:17:42 -0800, dx wrote:

Shouldn't there be a signal_stop(); before the return?

I'm not familiar enough with the irssi code to know that, but there
isn't one near line 669 either.

Lauri Tirkkonen | lotheac @ IRCnet

@lotheac

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2016

On Wed, Nov 09 2016 00:10:06 -0800, LemonBoy wrote:

I like this!
But I wonder if we could approach the problem from another angle and make the completion configurable (thus allowing the user to disable it) like this:

if (completion_linestart_cmd[0] == '0')
    return;
prefix = g_strdup_printf("%c%s", *cmdchars, completion_linestart_cmd);

I'm afraid I don't understand what you mean -- my patch does make it
configurable whether or not completion does anything on an empty line
(the default being to keep the current behavior). What exactly is
"completion_linestart_cmd" here?

Lauri Tirkkonen | lotheac @ IRCnet

@lotheac

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2016

On Wed, Nov 09 2016 10:19:41 +0200, Lauri Tirkkonen wrote:

On Wed, Nov 09 2016 00:17:42 -0800, dx wrote:

Shouldn't there be a signal_stop(); before the return?

I'm not familiar enough with the irssi code to know that, but there
isn't one near line 669 either.

Actually based on the other returns in this function it looks like
signal_stop() is only called if *list is non-NULL, ie. if something was
found.

Lauri Tirkkonen | lotheac @ IRCnet

@ahf

This comment has been minimized.

Copy link
Member

commented Nov 10, 2016

I think this is a good idea.

I think that turning the completion command into something that is configurable for commands other than /MSG can be handled in an additional follow-up patch, if someone is up for working on it, but do not check if the first element of the completion_linestart_cmd char array is '0' as proposed. Instead check for whether it is '\0'.

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

commented Nov 11, 2016

anything wrong with this patch?

@dequis

This comment has been minimized.

Copy link
Member

commented Nov 11, 2016

Other than being completely untested, nothing.

@ailin-nemui ailin-nemui merged commit 1aff5c2 into irssi:master Nov 11, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

niksula-mirror pushed a commit to niksula/omnios-build-scripts that referenced this pull request Nov 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.