mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-05-16 21:50:20 +00:00
Compare commits
2 Commits
1dc9b9c956
...
ad67af2f8f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad67af2f8f | ||
| cc8460d366 |
@@ -1,7 +1,19 @@
|
||||
if cc.get_id() == 'msvc'
|
||||
lua_dep = cc.find_library('lua51')
|
||||
else
|
||||
lua_dep = dependency(get_option('with-lua'))
|
||||
lua_opt = get_option('with-lua')
|
||||
lua_dep = dependency(lua_opt, required: false)
|
||||
if not lua_dep.found() and lua_opt == 'lua-5.4'
|
||||
foreach lua_name : ['lua5.4', 'lua-5.3', 'lua5.3', 'lua']
|
||||
lua_dep = dependency(lua_name, required: false)
|
||||
if lua_dep.found()
|
||||
break
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
if not lua_dep.found()
|
||||
error('Dependency "' + lua_opt + '" not found')
|
||||
endif
|
||||
endif
|
||||
|
||||
shared_module('lua', 'lua.c',
|
||||
|
||||
@@ -1973,8 +1973,37 @@ replace_handle (GtkWidget *t)
|
||||
{
|
||||
ptrdiff_t found_offset = found - text;
|
||||
ptrdiff_t found_end_offset = found_offset + (ptrdiff_t) pop_len;
|
||||
gboolean start_ok;
|
||||
gboolean end_ok;
|
||||
int rank;
|
||||
ptrdiff_t distance;
|
||||
const char *before = found;
|
||||
const char *after = found + pop_len;
|
||||
|
||||
if (before > text)
|
||||
{
|
||||
before = g_utf8_find_prev_char (text, before);
|
||||
start_ok = !before || (!g_unichar_isalnum (g_utf8_get_char (before)) && g_utf8_get_char (before) != '_');
|
||||
}
|
||||
else
|
||||
{
|
||||
start_ok = TRUE;
|
||||
}
|
||||
|
||||
if (*after != '\0')
|
||||
{
|
||||
end_ok = !g_unichar_isalnum (g_utf8_get_char (after)) && g_utf8_get_char (after) != '_';
|
||||
}
|
||||
else
|
||||
{
|
||||
end_ok = TRUE;
|
||||
}
|
||||
|
||||
if (!start_ok || !end_ok)
|
||||
{
|
||||
found++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cursor_byte_offset >= found_offset && cursor_byte_offset <= found_end_offset)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user