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

snippets always append a new line even though I require-final-newline to nil #102

Open
afidegnum opened this issue Nov 20, 2023 · 0 comments
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet

Comments

@afidegnum
Copy link

afidegnum commented Nov 20, 2023

What were you expecting?

I'm trying adding an attribute snippet which should behave like this: <div new-snippet="here"></div>

What actually happened?

I instead got this:

<div new-snippet="here"
></div>

Steps to reproduce

This is my snippet (I made sure it does not contain a any line break/newline):

# -*- mode: snippet -*-
# name: d-tb
# key: d-tb
# --
data-table="$1" d-field="$2" d-type="$3" $0

To enforce that, I also applied this configuration using a heuristic approach since I don't know which works and none of them didn't yield any positive result:

(defun disable-final-newline ()
  "Disable the adding of final newlines in the current buffer."
  (interactive)
  (set (make-local-variable 'require-final-newline) nil))

(add-hook 'snippet-mode 'disable-final-newline)
(add-hook 'web-mode 'disable-final-newline)
(add-hook 'web-mode-hook 'disable-final-newline)
(add-hook 'web-mode-hook (lambda () (setq-local require-final-newline nil)))
(add-hook 'html-mode-hook (lambda () (setq-local require-final-newline nil)))
(customize-set-variable 'require-final-newline nil)

Operating system

Debian Bookworm

Emacs version

GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2022-10-26

Installed commit of doom-snippets

90b1b221f

@afidegnum afidegnum added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet
Projects
None yet
Development

No branches or pull requests

1 participant