-- lx format
local format = require("core.format")

format.register({
	name = "Comma-Separated Values (CSV)",
	shortname = "CSV",
	author = "liqube",
	extensions = { "csv" },
	default_mode = "preview", -- Render delimited rows through tabpreview
	defaults = {
		word_wrap = false, -- Keep lines unwrapped by default
	},

	patterns = {
		{ pattern = "-?%.?%d+f?", type = "number" }, -- numbers
		{ pattern = "[,;|]", type = "operator" }, -- operators
		{ pattern = { '"', '"', "\\" }, type = "string" }, -- strings
		{ pattern = { "'", "'", "\\" }, type = "string" }, -- strings
	},
})
