mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 04:46:21 +00:00
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>
This commit is contained in:
52
src/tools/spellcheck.h
Normal file
52
src/tools/spellcheck.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user