Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to skip certain filetypes. #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

yyk
Copy link

@yyk yyk commented Sep 4, 2022

For example, markdown's trailing spaces has special meanings.

@GNOMES
Copy link

GNOMES commented Nov 7, 2022

If this gets approved, I think there should be an update to the repo's README.md file with config that can be used in a dedicated config file that can be sourced by init.lua

If someone wanted to do multiple exclusions, it can be messy to add these to the Packer Use Lua (in the way the included example does).

@@ -19,6 +19,11 @@ local function stripWhitespace(top, bottom)
return
end

-- print(vim.inspect(require("spaceless").options.ignore_filetypes))
if vim.tbl_contains(require("spaceless").options.ignore_filetypes, vim.api.nvim_buf_get_option(0, "filetype")) then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if vim.tbl_contains(require("spaceless").options.ignore_filetypes, vim.api.nvim_buf_get_option(0, "filetype")) then
if vim.tbl_contains(M.options.ignore_filetypes, vim.bo.filetype) then

@@ -83,9 +88,15 @@ local function onBufEnter()
end
end

local M = {}
local M = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants