Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@afidegnum

Description

@afidegnum
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugSomething isn't working as intendedSomething isn't working as intendedneeds-triageIssue hasn't been assessed yetIssue hasn't been assessed yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.