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

surround change remove newline #170

Open
Zenoe opened this issue Sep 30, 2020 · 8 comments · May be fixed by #213
Open

surround change remove newline #170

Zenoe opened this issue Sep 30, 2020 · 8 comments · May be fixed by #213
Assignees

Comments

@Zenoe
Copy link

Zenoe commented Sep 30, 2020

steps to reproduce

  1. open emacs and new a buffer
  2. input
[
blabla  
]
  1. put cursor on [
  2. type c s [ (

the text becomes

( blabla  )

but

(
blabla  
)

is expected

System information
evil-surround: 20200603.2216
emacs: "27.0.90"
(system
(type . gnu/linux)
(config . "x86_64-pc-linux-gnu")
(shell . "/usr/bin/zsh")
(uname . "Linux 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64")
)

((emacs
  (version . "27.0.90")
  (features . "SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER GMP")
  (build . "Apr 11, 2020")
  (buildopts "--without-makeinfo --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no")
  (windowsys . batch)
  (daemonp))
 (doom
  (version . "2.0.9")
  (build . "HEAD -> develop, origin/develop 7615bacde 2020-04-11 00:35:07 -0400")
  (dir . "~/.doom.d/"))
 (system
  (type . gnu/linux)
  (config . "x86_64-pc-linux-gnu")
  (shell . "/usr/bin/zsh")
  (uname . "Linux 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64")
  (path "~/perl5/bin" "~/.nvm/versions/node/v10.16.3/bin" "~/perl5/bin" "/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "~/bin" "/usr/local/go/bin" "~/go/bin" "/usr/local/maven3/bin" "/opt/gradle/latest/bin" "/opt/jdk1.8.0_181/bin" "/opt/jdk1.8.0_181/jr
e/bin" "~/.fzf/bin" "~/bin" "/usr/local/go/bin" "~/go/bin" "/usr/local/maven3/bin" "/opt/gradle/latest/bin" "/opt/jdk1.8.0_181/bin" "/opt/jdk1.8.0_181/jre/bin" "/usr/local/libexec/emacs/27.0.90/x86_64-pc-linux-gnu"))
 (config
  (envfile . envvar-file)
  (elc-files . 0)
  (modules :completion company (helm +fuzzy) :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold multiple-cursors rotate-text
 snippets :emacs dired electric ibuffer vc :tools (eval +overlay) :checkers syntax :tools (lookup +docsets) magit :lang data emacs-lisp javascript markdown (org +dragndrop +present) sh :config (default +bindings +smartparens))
  (packages (xclip) (wgrep))
  (unpin "n/a")
  (elpa "n/a")))

@ninrod ninrod self-assigned this Sep 30, 2020
@ninrod
Copy link
Member

ninrod commented Sep 30, 2020

@Zenoe , thanks for the input.

Did you use make emacs to try to reproduce your issue in a clean environment?

@Zenoe
Copy link
Author

Zenoe commented Oct 13, 2020

@ninrod , sorry I don't quit understand what make emacs means.
I use doom emacs.

@ninrod
Copy link
Member

ninrod commented Oct 13, 2020

@Zenoe

@ninrod , sorry I don't quit understand what make emacs means.
I use doom emacs.

No worries, here.

@Zenoe
Copy link
Author

Zenoe commented Oct 14, 2020

@ninrod , I've tried make emacs, it doesn't support evil-surround. I can't find any evil-surround comand.
Steps are as follows:

@ninrod
Copy link
Member

ninrod commented Oct 14, 2020

Did you get any errors after make?

@Zenoe
Copy link
Author

Zenoe commented Oct 21, 2020

I tried make one more time and got no error.
However I did get error from make emacs minibuffer: Cannot open load file: No such file or directory, undo-tree.el

@ninrod
Copy link
Member

ninrod commented Oct 21, 2020

seems like make could not download the undo-tree.el dependency.

@Roger-Roger-debug
Copy link

I think the expected behavior would be for there to be a evil-Surround-change command that adds newlines similar to evil-Surround-region. That way the commands could behave like this

[
blabla
]

with cgs[[ -> [ blabla ] and with cgS[[ back to the original.

I thought I could mostly copy the current implementation and change the evil-surround-region call to include a newline, but doing that would add a new newline after each change. Looking a bit further I found out that evil-surround-delete will delete the opening newline, but not the closing. Maybe that's why my approach didn't work? My Elisp knowledge isn't good enough to figure that out on my own though.

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 a pull request may close this issue.

3 participants