Can't delete Parenthesis in IntelliJ/Cursive

荒凉一梦 提交于 2019-12-22 03:50:54

问题


I'm using IntelliJ/Cursive to write Clojure. I found out that the only way to erase parenthesis is to totally erase the content inside them, and only then, the parenthesis can be deleted. For example, let's say that I have the following code:

(list)

and I want to delete only the opening parenthesis. Once I hit backspace on the opening parenthesis, the IDE ignores this act. Only when I erase the word "list", the parenthesis can be deleted.

Does anyone have any idea how to solve this?


回答1:


From the docs:

Structural editing comes enabled for Clojure code by default. If you don't like it, you can turn it off at Settings→Editor→General→Smart Keys→Use structural editing. If you'd like to toggle it on and off quickly, you can use the widget in the status bar at the bottom of the screen, or you can use the Edit→Structural Editing→Toggle Structural Editing Style action. If you find yourself doing that a lot you can even assign a shortcut key to the action.




回答2:


There is another way to remove parenthesis, using the structural editing command "Splice Sexp". You can also use slurping and barfing to manipulate the parenthesis to the order that you want.




回答3:


You can delete the parenthesis while remaining in structural editing mode by selecting/highlighting it first with your cursor or shift+arrow. You'll then need to manually remove the corresponding close parenthesis too.




回答4:


Recently was moved to Edit > Structural Editing > Toggle Structural Editing Style



来源:https://stackoverflow.com/questions/35091783/cant-delete-parenthesis-in-intellij-cursive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!