kemayo / sublime-text-git

Plugin for some git integration into sublime text
MIT License
2.83k stars 390 forks source link

fix press Enter key to goto diff lines of file when no opend working folder here #496

Open watergear opened 8 years ago

watergear commented 8 years ago

What to fix?

491


Why it is failed?

Git root is failed to get after create new view window. Because a new view window will be created by new_file() and later active_view() return the new view window without git root.


How to fix?

  1. backup git root
  2. create new view window
  3. set the backup git root into new view window settings
watergear commented 6 years ago

Hi, @kemayo

I see you have merged #524. @vanrijn said it might help for #491 but it actually doesn't.

see my reply in #524

Thank you for your work. But the #496 can not be solved by this change. I pull your commit and test failed.

As my said at #496, active view is changed and the new view window can not get the file path. That means it is too late to get the git root path. At the moment, self.active_file_path() and window.folders()[0] are both None. It is no way to get git root path back again.

The solution is to get the git root path before creating new scratch view, and then store the git root path into new view.

I sincerely hope you can take the time to look at my problem and try to merge it.

Thanks watergear