Skip to content
This repository was archived by the owner on Nov 1, 2026. It is now read-only.
This repository was archived by the owner on Nov 1, 2026. It is now read-only.

Commands that write results to a new tab leave the tab empty (edit token of another view) #4

Open

Description

@dpc00

Claude reports: every command that shows its result in a new tab opens the tab but inserts nothing.

Cause: the result is written with self.view.window().new_file().insert(edit, 0, text) (lines 90, 126, 250, 298, 337, 368, 424, 441). edit belongs to the original view, so Sublime ignores the insert into the new one. There is no error in the console.

Controlled check: I replaced TranslateCommand.run for one run with a function that opens a new view, calls nv.insert(edit, 0, 'FOREIGN-EDIT') and then nv.run_command('append', {'characters': 'APPEND'}). The new tab contained exactly APPEND; the text inserted with the foreign edit was not there.

Observed with the package as shipped:

  • Translate on >s1 + ATGGCCATTGTAATGGGCCGCTGA, and on the bare sequence ATGGCCAT: a new empty tab opens (size 0).
  • Get Sequences by Id for AY818147: the console prints Downloaded AY818147 (the download worked) but the new tab is empty, so the data is lost.
  • Genbank To Fasta: new empty tab.

With the inserts redirected to append (what the fix does), Translate (FASTA and plain, several sequences), Genbank To Fasta (AY818147) and Get Sequences by Id / Search all produce correct output, so this is the only thing standing between the package and working.

Fix: write into the new view with new_view.run_command("append", {"characters": text}), not with the original edit.

Tested on Sublime Text build 4215 (portable, Windows), plugin host Python 3.14, installed through Package Control (BioPythonUtils 2017.12.18.15.00.45, which contains the fixes for #3). Line numbers are those of BioPythonUtils.py on master (de058c4).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions