Skip to content

Commit 561bf0e

Browse files
committed
insert a new line in log before every rendering error
1 parent 2e08cdf commit 561bf0e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lua/flutter-tools/log.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ local previousCompilerErrorNotification
8484
local previousCompilerErrorNotificationTime = 0
8585
local accumulatedCompilerErrorCount = 0
8686
local function append(buf, lines)
87-
vim.bo[buf].modifiable = true
88-
api.nvim_buf_set_lines(M.buf, -1, -1, true, lines)
89-
vim.bo[buf].modifiable = false
9087
local errorCount = 0
9188
local validStr = {}
89+
local newLines = {}
9290
for _, line in ipairs(lines) do
9391
if string.starts(line, "══╡") then
92+
table.insert(newLines, "")
9493
tmpStopNotifyingDevLogOutput = true
9594
ui.notify("Encountered Layout issues", ui.WARN, {
9695
timeout = 1000,
@@ -107,7 +106,11 @@ local function append(buf, lines)
107106
errorCount = errorCount + 1
108107
end
109108
end
109+
table.insert(newLines, line)
110110
end
111+
vim.bo[buf].modifiable = true
112+
api.nvim_buf_set_lines(M.buf, -1, -1, true, newLines)
113+
vim.bo[buf].modifiable = false
111114

112115
local str = table.concat(validStr, "\n")
113116
if str ~= "" then

0 commit comments

Comments
 (0)