瀏覽代碼

LibLine: Default to resetting styles when a cell has no styles set

AnotherTest 5 年之前
父節點
當前提交
679a84d44c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Libraries/LibLine/Editor.cpp

+ 2 - 2
Libraries/LibLine/Editor.cpp

@@ -998,14 +998,14 @@ void VT::move_relative(int x, int y)
 Style Editor::find_applicable_style(size_t offset) const
 {
     // Walk through our styles and merge all that fit in the offset.
-    Style style;
+    auto style = Style::reset_style();
     auto unify = [&](auto& entry) {
         if (entry.key >= offset)
             return;
         for (auto& style_value : entry.value) {
             if (style_value.key <= offset)
                 return;
-            style.unify_with(style_value.value);
+            style.unify_with(style_value.value, true);
         }
     };