Sublime Forum

"Quick Find All" action skipped by macro

#1

Here’s the setup on Sublime 3 (3083):

  1. I have a text file open, like a console log file
  2. I perform a Find which locates the first instance

At this point, I want to record a macro that does these actions:

  1. Find > Quick Find All
  2. Selection > Expand Selection to Line
  3. Selection > Invert Selection
  4. Delete selection with Delete key

However, if I run the macro, it skips over Step 1 and ends up only selecting one line in Step 2. If I create a macro just for Step 1, it fails. If I manually perform Step 1 and then create a macro for steps 2-4, then it works fine. So, something about this Quick Find All step that is not getting recorded into the macro. This is what the macro file looks like:

{
	"args": null,
	"command": "find_all_under"
},
{
	"args":
	{
		"to": "line"
	},
	"command": "expand_selection"
},
{
	"args": null,
	"command": "invert_selection"
},
{
	"args": null,
	"command": "left_delete"
}

]

Ideas? Unless there’s another way to do this, basically what I’m after is a macro that will delete all lines in a log that don’t match a search term.

  • pt
0 Likes

#2

Find commands don’t get recorded in macros. Nobody knows why. See e.g. https://forum.sublimetext.com/t/as-a-user-i-want-macro-find-replace-support-featurerequest/15868/1 from just a couple days ago, or you can search this forum and find people asking about this for years :\

0 Likes

#3

Perhaps there’s another way to do what I want? That’s a bummer though.

0 Likes