Files
profanity/src/tools/spellcheck.h
Michael Vetter 4922366366 feat: add spellcheck highlighting support
Introduce optional spellcheck highlighting in the input window using
the Enchant-2 library.

```
/spellcheck on
/spellcheck lang en_US
```

New theme color `input.misspelled`.

Fixes: https://github.com/profanity-im/profanity/issues/183
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-26 23:34:06 +01:00

53 lines
865 B
C

/*
* spellcheck.h
* vim: expandtab:ts=4:sts=4:sw=4
*
* Copyright (C) 2026 Michael Vetter <jubalh@iodoru.org>
*
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
*/
#ifndef TOOLS_SPELLCHECK_H
#define TOOLS_SPELLCHECK_H
#include "config.h"
#include <glib.h>
#ifdef HAVE_SPELLCHECK
void spellcheck_init(void);
void spellcheck_deinit(void);
gboolean spellcheck_is_misspelled(const char* word);
gboolean spellcheck_set_lang(const char* lang);
const char* spellcheck_get_lang(void);
#else
static inline void
spellcheck_init(void)
{
}
static inline void
spellcheck_deinit(void)
{
}
static inline gboolean
spellcheck_is_misspelled(const char* word)
{
return FALSE;
}
static inline gboolean
spellcheck_set_lang(const char* lang)
{
return FALSE;
}
static inline const char*
spellcheck_get_lang(void)
{
return NULL;
}
#endif
#endif