redguardtoo / emacs.d

Fast and robust Emacs setup.
http://blog.binchen.org
GNU General Public License v3.0
2.41k stars 616 forks source link

ep/expand-region中,不能正确的扩展区域 #994

Open moxuetianya opened 2 years ago

moxuetianya commented 2 years ago

2022-08-08 16-22-16 的屏幕截图 当光标所在位置,位于343行的大括号}位置时,按 vv 键盘正常应该选中为整个大括号中的内容, 但是扩展后的区域如下图所示:

2022-08-08 16-23-03 的屏幕截图

可以复现: 项目为开源代码 git clone https://github.com/google/syzkaller emacs syzkaller/executor/executor.cc

emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2022-07-05, unofficial emacs-snapshot build: http://emacs.ganneff.de/, git commit 83f059793af0d7191529582ce674f0af349cd1b7 应该与emacs版本没有关系, 用其他版本时也会出现这个现象;

redguardtoo commented 2 years ago

It's not my setup. You need raise a ticket to https://github.com/magnars/expand-region.el

If you know evil text object, you could use vi{ to select region between {}. In my setup, you can also use vig

moxuetianya commented 2 years ago

https://github.com/magnars/expand-region.el 这个项目好像只有pr没有issues, 学会elisp再提吧,不紧急:)

redguardtoo commented 2 years ago

https://github.com/magnars/expand-region.el 这个项目好像只有pr没有issues, 学会elisp再提吧,不紧急:)

你可以在cc-mode-hook里改er/try-expand-list,只留下最基本的选项。

不过我主要用evil-mode,较大的region操作都用定制的evil text object, expand-region就是用来快速地选变量名。