Merge branch 'dev' into debugging-server
This commit is contained in:
@@ -1211,13 +1211,12 @@ void TextBox::setCaret(size_t position) {
|
||||
}
|
||||
int lcaret = caret - rawTextCache.getTextLineOffset(line);
|
||||
int realoffset =
|
||||
rawTextCache.metrics.calcWidth(labelText, lcaret) - static_cast<int>(textOffset) + 2;
|
||||
rawTextCache.metrics.calcWidth(labelText, 0, lcaret) - static_cast<int>(textOffset) + 2;
|
||||
|
||||
if (realoffset - width > 0) {
|
||||
setTextOffset(textOffset + realoffset - width);
|
||||
} else if (realoffset < 0) {
|
||||
setTextOffset(std::max(textOffset + realoffset, static_cast<size_t>(0))
|
||||
);
|
||||
setTextOffset(std::max(textOffset + realoffset, static_cast<size_t>(0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,9 @@ void lua::init_state(State* L, StateType stateType) {
|
||||
pushnil(L);
|
||||
setglobal(L, "io");
|
||||
|
||||
createtable(L, 0, 0);
|
||||
setglobal(L, "__vc__pack_envs");
|
||||
|
||||
const char* removed_os[] {
|
||||
"execute", "exit", "remove", "rename", "setlocale", "tmpname", nullptr};
|
||||
remove_lib_funcs(L, "os", removed_os);
|
||||
|
||||
@@ -181,7 +181,17 @@ std::unique_ptr<Process> scripting::start_coroutine(const io::path& script) {
|
||||
lua::setfield(L, "PACK_ENV");
|
||||
lua::pushstring(L, pack.id);
|
||||
lua::setfield(L, "PACK_ID");
|
||||
|
||||
lua::dump_stack(L);
|
||||
if(!lua::getglobal(L, "__vc__pack_envs")) {
|
||||
lua::createtable(L, 0, 0);
|
||||
lua::setglobal(L, "__vc__pack_envs");
|
||||
lua::pushvalue(L, -1);
|
||||
}
|
||||
lua::pushenv(L, id);
|
||||
lua::setfield(L, pack.id);
|
||||
lua::pop(L);
|
||||
|
||||
return std::shared_ptr<int>(new int(id), [=](int* id) { //-V508
|
||||
lua::remove_environment(L, *id);
|
||||
delete id;
|
||||
|
||||
Reference in New Issue
Block a user