Skip to content

Commit

Permalink
fix: avoid parsing file matching multiple buffers
Browse files Browse the repository at this point in the history
See #63
  • Loading branch information
rcarriga committed Aug 18, 2021
1 parent 64545fe commit 872e1af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rplugin/python3/ultest/handler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ def run_single(self, test_id: str, file_name: str):
)

def update_positions(self, file_name: str, callback: Optional[Callable] = None):
try:
self._vim.sync_call(
"setbufvar", file_name, "_ultest_is_unique_file", "is_unique_file"
)
except Exception:
logger.warn(
f"Multiple buffers matched file name {file_name}, can't check for tests"
)
return
self._tracker.update(file_name, callback)

def get_nearest_position(
Expand Down

0 comments on commit 872e1af

Please sign in to comment.