[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make company-backends buffer-local?

From: Jefferson Carpenter
Subject: Make company-backends buffer-local?
Date: Sun, 4 Mar 2018 01:47:04 -0600
User-agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

First post to this list -- sorry if this is either not a good suggestion at all, not right format, or too irrelevant.

The company-backends variable is currently a global variable. The backend that serves completions is the first one that returns a prefix for the location at point.

Are there any barriers to making company-backends a buffer-local variable? I don't see any drawbacks - it would take a pretty small amount of extra memory to create a copy for each buffer. The advantages include:

1: You can specify backends mode by mode. I at least feel this makes far more sense philosophically.

2: Would fix a possible issue where a backend at the beginning of the list is actually for a different file type - maybe for a similar language, say Java vs C++ - however still happens to return a prefix, and subsequently doesn't return any of the right completions.

3 (extremely minor): Might speed up completions for backends that were at the end of the list, since each mode can be programmed with a specific list of backends.

Jefferson Carpenter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]