Home Download Buy Blog Forum Support

Smart search / replace within selection lost on ST3

Re: Smart search / replace within selection lost on ST3

Postby robertcollier4 on Mon Apr 01, 2013 10:14 am

Kicweed wrote:Any idea how the two could be combined? I'd like to be able to invoke the Replace panel with the setting set to on, regardless of its previous state.

Code: Select all
import sublime, sublime_plugin

class ReplaceInSelectionCommand(sublime_plugin.WindowCommand):
   def run(self):
      self.window.run_command("show_panel", {"panel": "replace"})
      self.window.run_command("toggle_in_selection")

In key-bindings:
Code: Select all
{ "keys": ["ctrl+r"], "command": "replace_in_selection"},


Kicweed wrote:Also, can you set the selection mode instead of toggling it?

I am wondering this as well. So far - I have only found "toggle_in_selection" working but don't know if I can pass it a "true" or "false" arg to deterministically set a hotkey to turn it explicitly on or off. Sublime commands not being officially documented is a huge problem. I figured out the "toggle_in_selection" command via guessing what the author might have called it and trying a couple of possible command names. Guessing command names is not how an API is supposed to be use.
robertcollier4
 
Posts: 153
Joined: Sun Feb 24, 2013 5:37 pm

Re: Smart search / replace within selection lost on ST3

Postby CrazyChoco on Mon Apr 08, 2013 1:49 pm

Sorry to be a pain, but could I minus-one this? Or at least ask that it be setting in your user preferences?

I quite often want to search for a line or multiple lines of text, and it would be quite annoying if I had to repeatedly turn "search in selection" back off after each selection.
CrazyChoco
 
Posts: 7
Joined: Mon Apr 08, 2013 1:43 pm

Re: Smart search / replace within selection lost on ST3

Postby fooziex on Tue Apr 09, 2013 5:46 pm

Build 3024
----------
Release Date: 8 April 2013

[…]
* Added setting 'auto_find_in_selection', for S2 style Find in Selection logic
[…]


Much obliged!
fooziex
 
Posts: 10
Joined: Tue Oct 02, 2012 8:22 pm

Previous

Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests