1. guillermooo
  2. VintageEx

Commits

guillermooo  committed feb25a3

rename variable, clean up

  • Participants
  • Parent commits 8efa895
  • Branches default

Comments (0)

Files changed (2)

File ex_commands.py

View file
     return [leaf, path]
 
 
-def get_region_by_range(view, line_range=None, single_lines=False):
+def get_region_by_range(view, line_range=None, as_lines=False):
     # If GLOBAL_RANGES exists, the ExGlobal command has been run right before
     # the current command, and we know we must process these lines.
     global GLOBAL_RANGES
 
     if line_range:
         vim_range = ex_range.VimRange(view, line_range)
-        if single_lines:
+        if as_lines:
             return vim_range.lines()
         else:
             return vim_range.blocks()
 
 
-def ensure_line_block(view, r):
-    """returns a string containing lines terminated by a newline character.
-    """
-    if view.substr(r).endswith('\n'):
-        r = sublime.Region(r.begin(), r.end() - 1)
-    line_block = view.substr(view.line(r)) + '\n'
-
-    return line_block
-
-
 class ExGoto(sublime_plugin.TextCommand):
     def run(self, edit, line_range=None):
         if not line_range['text_range']:
 
         replace_count = 0 if (flags and 'g' in flags) else 1
         
-        target_region = get_region_by_range(self.view, line_range=line_range, single_lines=True)
+        target_region = get_region_by_range(self.view, line_range=line_range, as_lines=True)
         for r in reversed(target_region):
             line_text = self.view.substr(self.view.line(r))
             rv = re.sub(pattern, replacement, line_text, count=replace_count)
 
     Create a new buffer.
 
-    TODO: Create new buffer by single_linesthe screen.
+    TODO: Create new buffer by splitting the screen.
     """
     def run(self, edit, line_range=None):
         self.view.window().run_command('new_file')

File vex/ex_range.py

View file
 
 
 class VimRange(object):
-    """Encapsulates calculation of regions based on supplied raw range info.
+    """Encapsulates calculation of view regions based on supplied raw range info.
     """
     def __init__(self, view, range_info, default=None):
         self.view = view