mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Trivial changes from the lazy-trees branch
This commit is contained in:
parent
c4a6113800
commit
703d863a48
62 changed files with 394 additions and 248 deletions
|
@ -1594,6 +1594,21 @@ std::string stripIndentation(std::string_view s)
|
|||
}
|
||||
|
||||
|
||||
std::pair<std::string_view, std::string_view> getLine(std::string_view s)
|
||||
{
|
||||
auto newline = s.find('\n');
|
||||
|
||||
if (newline == s.npos) {
|
||||
return {s, ""};
|
||||
} else {
|
||||
auto line = s.substr(0, newline);
|
||||
if (!line.empty() && line[line.size() - 1] == '\r')
|
||||
line = line.substr(0, line.size() - 1);
|
||||
return {line, s.substr(newline + 1)};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Sync<std::pair<unsigned short, unsigned short>> windowSize{{0, 0}};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue