Explorar o código

[quickfix] scrolling issue

isundil %!s(int64=9) %!d(string=hai) anos
pai
achega
1a394f6e5b
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/curseOutput.cpp

+ 4 - 0
src/curseOutput.cpp

@@ -211,6 +211,8 @@ bool CurseOutput::writeContent(std::pair<int, int> &cursor, const std::pair<unsi
 
 bool CurseOutput::writeKey(const std::string &key, const std::string &after, std::pair<int, int> &cursor, const std::pair<unsigned int, unsigned int> &maxSize, OutputFlag flags)
 {
+    if (cursor.second - topleft < 0)
+        return 1;
     writeKey(key, cursor, maxSize, flags, after.size());
     write(after.c_str(), maxSize.first, flags);
     cursor.first -= INDENT_LEVEL;
@@ -219,6 +221,8 @@ bool CurseOutput::writeKey(const std::string &key, const std::string &after, std
 
 bool CurseOutput::writeKey(const std::string &key, std::pair<int, int> &cursor, const std::pair<unsigned int, unsigned int> &maxSize, OutputFlag flags, unsigned int extraLen)
 {
+    if (cursor.second - topleft < 0)
+        return 1;
     char oldType = flags.type();
     flags.type(OutputFlag::TYPE_OBJKEY);
     cursor.second += write(cursor.first, cursor.second, key, maxSize.first -extraLen -2, flags);