Auto-complete channel names

Closes: https://todo.sr.ht/~emersion/gamja/84
This commit is contained in:
Simon Ser 2021-08-23 15:21:24 +02:00
parent aa9ce73d5a
commit dd67e0789e

View File

@ -1068,6 +1068,17 @@ export default class App extends Component {
return repl.map(cmd => "/" + cmd); return repl.map(cmd => "/" + cmd);
} }
// TODO: consider using the CHANTYPES ISUPPORT token here
if (prefix.startsWith("#")) {
let chanNames = [];
for (const buf of this.state.buffers.values()) {
if (buf.name.startsWith("#")) {
chanNames.push(buf.name);
}
}
return fromList(chanNames, prefix);
}
let buf = this.state.buffers.get(this.state.activeBuffer); let buf = this.state.buffers.get(this.state.activeBuffer);
if (!buf || !buf.members) { if (!buf || !buf.members) {
return []; return [];