Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open file for edit in background when user first starts editing #4

Open
squatch opened this issue Feb 25, 2013 · 2 comments
Open

Open file for edit in background when user first starts editing #4

squatch opened this issue Feb 25, 2013 · 2 comments

Comments

@squatch
Copy link
Contributor

squatch commented Feb 25, 2013

Steps to reproduce:

  1. Enable Perforce bundle.
  2. Open a file that has not yet been 'p4 edit'ed (and is therefore read-only).
  3. Edit something.
  4. Press ⌘S to save.
  5. Edit some more.
  6. Press ⌘S to save again.

Expected result: When I first start editing the file, TextMate should 'p4 edit' it to confirm that it can successfully be opened for edit.

Actual result: TextMate waits until I save to run 'p4 edit', and it runs every time I save, even if the file is already opened for edit.

Environment:
10.8.2 12C60
TextMate version 2.0-alpha.9387
Perforce bundle

This would fix two things:

  • People who compulsively save wouldn't be nagged by continual tool tips saying the file is currently opened for edit (as every save currently triggers 'p4 edit', and file is usually already open from previous save). These can also make the UI laggy & unresponsive when the p4 command blocks waiting on the server.
  • That silly warning in the README could go away, since files would now be opened at first edit rather than on every save.
@squatch
Copy link
Contributor Author

squatch commented Feb 25, 2013

Does TextMate have the necessary hooks to do this? Or are there concerns with the flow I described?

@infininight
Copy link
Member

We unfortunately do not have any hooks that would make this work currently. What you would want is a 'first edit' type of callback. There would be some issues with this as it would be happen if you were simply looking at a file and accidentally hit a key. The manner in which Perforce operates makes this complicated to work with in the generalized manner that TextMate needs it to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants