Comments (7)
Heh:
C-w runs the command isearch-yank-word-or-char
Hit this one too. I think it would be ideal if ctrlf were as close as a drop-in upgrade to isearch as possible.
from ctrlf.
Yep. Great suggestions, thanks.
from ctrlf.
I'm also in full support of this, the lack of C-w
tripped me up.
from ctrlf.
Thanks a lot for a nice package, I like it very much! I just wanted to add 1 for C-w
, which I use often, too. :-)
from ctrlf.
Hmmm... actually, not sure I can totally support C-w
as a top-level binding. Maybe we can put it under M-s
or something, and we can certainly make the keymap customizable so you could add it yourself, but one of the goals of CTRLF is that the search input behaves normally. So you'd expect C-w
to kill the region. I suppose I wouldn't be opposed to installing by default a special command that will delegate to isearch-yank-word-or-char
behavior if and only if there is no active region.
from ctrlf.
Good idea, making it depend on the active region. I tried a simple conditional which checks for active mark, but simply calling isearch-yank-word-or-char
caused an error. I couldn't find out what caused it. There's some implicit dependence in the code I couldn't figure out. I also tried to explicitly set the text buffer current before calling isearch....
, no luck. So I came up with this solution, which is at least a first workaround:
(defun ctrlf-c-w (begin end)
"Kill region if active, else yank symbol at point."
(interactive "r")
(if mark-active
(kill-region begin end)
(ctrlf-forward-symbol-at-point)))
This works. If you have any ideas how to delegate it to isearch, I'd add this. But as I said, simply calling isearch-yank-word-or-char
, either with the text buffer explicitly set as current buffer or not, does not work.
from ctrlf.
Well, looking at the source for isearch-yank-internal
, I'd say the problem is Isearch keeps point in the actual buffer being searched, while CTRLF keeps it in the minibuffer. Thus buffer-substring-no-properties
has entirely the wrong effect. Furthermore, isearch-yank-word-or-char
operates by setting a bunch of Isearch variables and calling some Isearch functions, not by just inserting text into the minibuffer. The whole thing would need to be redone for CTRLF.
Protip: there is a function use-region-p
you can use instead of checking the mark-active
variable.
from ctrlf.
Related Issues (20)
- Lacks isearch-query-replace HOT 5
- Can it support wgrep in occur mode? HOT 1
- Question: How to add Chinese pinyin support? HOT 1
- Doesn't honor search-invisible HOT 1
- C-g behaves like RET HOT 4
- first character is not deleted HOT 9
- moving the mark back into the main buffer leaves things in a goofy state HOT 4
- Renaming default branch from 'master' to 'main' HOT 1
- C-r wrong HOT 2
- Don't jump to invisible text HOT 1
- Does not open up org mode folded headings HOT 2
- How do I customise `ctrlf-minibuffer-bindings` in my config? HOT 2
- Expose match count/index for modeline segments? HOT 1
- C-s and C-r doesn't always search the next or previous occurrence. HOT 2
- Other messages in minibuffer HOT 5
- Does not work in specific special buffer HOT 1
- Go to next match after "ending" search HOT 5
- No isearch-esque unprettifying while searching HOT 2
- Mention isearch-mb in the readme HOT 1
- isearch-repeat-forward? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctrlf.