Skip to content

Commit

Permalink
Better scope actions (#62)
Browse files Browse the repository at this point in the history
* Better scope actions

Find only, selections, highlights, folding are now applied to the sub matches in a scope.  This should be more intuitive in regards to what the user expects.

* Prep for 3.4.0 release

- Update version and changelog
- Open settings with new API

* Error message when rule not found

fixes #60

* Update changelog
  • Loading branch information
facelessuser authored Jun 4, 2017
1 parent 142ece0 commit 36047d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **NEW**: Scope searches will now apply highlights and actions directly to the regex find regions opposed to the whole
scope [#58](https://github.com/facelessuser/RegReplace/issues/58).
- **NEW**: Use new Sublime settings API for opening settings file.
- **NEW**: Show error message when rule not found [#60](https://github.com/facelessuser/RegReplace/issues/60).

# RegReplace 3.3.0

Expand Down
6 changes: 6 additions & 0 deletions rr_sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,17 @@ def find_and_replace(self):
# Record total regions found
results += 'Regions Found: %d regions;' % total_replacements
else:
not_found = []
for replacement in self.replacements:
# Is replacement available in the list?
if replacement in replace_list:
pattern = replace_list[replacement]
results += result_template % (replacement, self.replace_obj.search(pattern, 'scope' in pattern))
else:
not_found.append(replacement)
if not_found:
error("%d rules not found! See console." % len(not_found))
print('\n'.join(['RegReplace: "%s" not found!' % r for r in not_found]))
return results

def start_sequence(self):
Expand Down

0 comments on commit 36047d8

Please sign in to comment.