Fixes artifacts shown in REPL input window.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
56538a5552
commit
856c37a583
|
@ -16,12 +16,18 @@ void UpdateScriptWithParseInfo(WINDOW* inputWindow, const std::u8string& script,
|
|||
if (diag != nullptr) {
|
||||
auto start = diag->GetSpan().GetStart();
|
||||
auto end = diag->GetSpan().GetEnd() + 1;
|
||||
if (end > script.size()) {
|
||||
end = script.size();
|
||||
if (start == end && start > 0) {
|
||||
start--;
|
||||
}
|
||||
}
|
||||
|
||||
waddnstr(inputWindow, (char*)script.c_str(), start);
|
||||
wattron(inputWindow, COLOR_PAIR(1));
|
||||
waddnstr(inputWindow, (char*)script.c_str() + start, end - start);
|
||||
waddnstr(inputWindow, (char*)script.substr(start).data(), end - start);
|
||||
wattroff(inputWindow, COLOR_PAIR(1));
|
||||
waddnstr(inputWindow, (char*)script.c_str() + end, script.size() - end);
|
||||
waddnstr(inputWindow, (char*)script.substr(end).data(), script.size() - end);
|
||||
|
||||
if (start >= script.size() - 1) {
|
||||
wattron(inputWindow, COLOR_PAIR(1));
|
||||
|
|
Loading…
Reference in New Issue