- In VI-Mode, using :e filename or :tabe filename in the empty unmodified initial document makes Kate crash. The caller is deleted by closing the document.
- Reusing the already opened document avoids the problem.
Details
- Reviewers
cullmann - Group Reviewers
Kate - Commits
- R40:e3ece7bd45d2: Reuse unmodified empty document instead of closing it
- use :e filename in VI-Mode from a fresh kate instance
Diff Detail
- Repository
- R40 Kate
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Hmm, isn't there some potential problem that the next call might use that untitled document again before the event loop call happens and we close it then?
Perhaps a better fix would be to defer the open call in the vi mode?
That might happen, yes. Deferring the open call is probably not an option, since the return value is used. Maybe one could remove the document and its view from all of the lists but call deleteLater() instead of delete. Somehow this already sounds like a hack though.
Hmm, perhaps a different approach would fix the issue:
Instead of creating a new document and closing untitled afterwards, perhaps just use untitled for the opening.
Then you get no race anymore.
Could you try that out?
Please give my idea an try, if you don't find an obvious flaw in it.
Besides: Thanks already for caring about the crashs!
If that change does the trick for you, feel free to push this.
This avoids any race-conditions we would introduce with the single shot variant.