Permalink
Browse files

changing some logic behind show symbols multi

  • Loading branch information...
1 parent b47eb33 commit 7d48587e11086b2896fc28d0e9c34f1d5a26168b @hanoii hanoii committed Dec 4, 2012
Showing with 14 additions and 30 deletions.
  1. +11 −7 ctags.py
  2. +3 −23 ctagsplugin.py
View
18 ctags.py
@@ -217,16 +217,20 @@ def __len__(self):
def get(self, *tags):
with open(self.p, 'r+') as fh:
- self.fh = mmap.mmap(fh.fileno(), 0)
+ if tags:
+ self.fh = mmap.mmap(fh.fileno(), 0)
- for tag in (t.encode() for t in tags):
- b4 = bisect.bisect_left(self, tag)
- fh.seek(b4)
+ for tag in (t.encode() for t in tags):
+ b4 = bisect.bisect_left(self, tag)
+ fh.seek(b4)
- for l in self.match_as(fh, tag):
- yield l
+ for l in self.match_as(fh, tag):
+ yield l
- self.fh.close()
+ self.fh.close()
+ else:
+ for l in fh.readlines():
+ yield l
def get_by_suffix(self, suffix):
with open(self.p, 'r+') as fh:
View
26 ctagsplugin.py
@@ -325,26 +325,11 @@ def commonfolder(m):
return os.path.sep.join(s1)
-def tagged_project_files(view, tag_dir):
- window = view.window()
- if not window: return []
- project = None #window.project()
- fn = view_fn(view)
-
- if not project or ( project and
- not fn.startswith(dirname(project.fileName())) ):
- prefix_arg = fn
- files = glob.glob(join(dirname(fn),"*"))
- else:
- prefix_arg = project.fileName()
- mount_points = project.mountPoints()
- files = list( chain(*(d['files'] for d in mount_points)) )
-
- common_prefix = commonfolder([tag_dir, prefix_arg])
+def files_to_search(view, tags_file, multiple=True):
- return [fn[len(common_prefix)+1:] for fn in files]
+ if multiple:
+ return []
-def files_to_search(view, tags_file, multiple=True):
fn = view.file_name()
if not fn: return
@@ -353,11 +338,6 @@ def files_to_search(view, tags_file, multiple=True):
common_prefix = commonfolder([tag_dir, fn])
files = [fn[len(common_prefix)+1:]]
- if multiple:
- files.pop()
- more_files = tagged_project_files(view, tag_dir)
- files.extend(more_files)
-
return files
def get_current_file_suffix(view):

0 comments on commit 7d48587

Please sign in to comment.