Sublime Forum

Limit Ctrl+D to current function

#1

Hi,

I’m using Ctrl+D (find_under_expand) occasionally when renaming variables in a function.

Is there any way to make it stop at the end of a function?

0 Likes

#2

I don’t think there is, no. I think the closest functionality to that would be to select the whole function first and then use the Find panel with the option to search only within the selection, but that’s a bit more cumbersome.

0 Likes

#3

Thanks for the idea, but I fear using the outlined way wouldn’t be very smooth.

0 Likes

#4

Yeah, I’ve wanted this a time or two myself and I always fall back to being really careful about each key press. It’s particularly problematic when the code you’re working with doesn’t all fit on the screen at once.

I generally end up going slightly too far and then having to use soft undo to take the selection back one in cases like that.

1 Like

#5

Good grief, wish I knew this 3 years ago. Thanks. It’s not even hidden, it’s right there in the Menu with a sensible keybinding. Going to set aside a few hours to just stroll through the menu and command palette to see what else I’ve ignorantly ignored.

3 Likes

#6

Thanks for the hint to use “soft undo”!
I never realized there’s this option to help undoing the latest selection and was using “ESC” combined with careful Ctrl+D & counting instead.

0 Likes

#7

oh my god the soft undo is amazing! I wish I knew that many years earlier

0 Likes