Commit Graph

255 Commits

Author SHA1 Message Date
Adam Strzelecki
4fca951c5d Provide TM_SCM_* variables for untitled document
When opening SCM manager folder TM opens untitled document in the editor area and the target folder in file browser. When one sets `windowTitle` to display SCM branch this is not displayed for untitled document. So one needs to open some existing file first.

This change sets SCM variables also for untitled document as if it was saved in selected file browser folder, effectively showing current SCM branch.
2012-09-03 12:10:25 +02:00
Allan Odgaard
57692fbedf fixup! If path no longer have SCM info, include it in change set
The iterator checks were wrong.
2012-09-03 12:10:25 +02:00
Allan Odgaard
869ff6093d Fix excessive SCM status updates for clean repositories
The problem is that we used to treat an empty status map as meaning we hadn’t yet requested status for this repository, however, now that we no longer need status for all files, we would have an empty status map for clean (svn) repositories, leading to needlessly requesting status updates all the time (and on main thread).
2012-09-03 12:10:24 +02:00
Allan Odgaard
6d19f2c13f Don’t prune items from SCM drivers tracking directories 2012-09-03 12:10:24 +02:00
Allan Odgaard
217dce5477 SCM driver reports if system tracks directories
This can be used to make decisions about whether or not we should assign a virtual status to directories, prune them from a status display, or similar.
2012-09-03 12:10:24 +02:00
Allan Odgaard
c332ae69e6 Allow disabling SCM status from .tm_properties
This is done by adding the following (which can be limited to a folder):

    scmStatus = false
2012-09-02 17:53:50 +02:00
Allan Odgaard
92e31ec8d1 Exclude clean files from svn status
Subversion itself is roughly 30% faster if we do not ask for status of all files, the XML processing though is magnitudes faster, since it will only have to deal with a few records (in the general case) rather than a record per file (xsltproc seems to do around ~10,000 files per second on my Mac Pro, though I have no idea if it scales linearly).
2012-09-02 17:53:50 +02:00
Allan Odgaard
2d2dd62351 Change scm::status::versioned → none
The scm::status::versioned status has now been removed.

The upshot of this is that SCM drivers can leave out files that are “clean” from their status map, and TextMate will assume they have status “none” (clean). This cuts down on the amount of data that needs to be sent (and/or processed) by the SCM drivers.
2012-09-02 17:53:50 +02:00
Allan Odgaard
02b2ef3982 Change scm::status::note → unknown where applicable 2012-09-02 17:53:50 +02:00
Allan Odgaard
f3429d8aad Remove code duplication
The SCM status enumeration is now only declared once.

I also introduced an ‘unknown’ status which should be used instead of ‘none’.
2012-09-02 17:53:50 +02:00
Allan Odgaard
01e7f6df75 Use xsltproc to parse svn (XML) status output
For a repository with 7,767 files it takes 3.5 seconds for Python to convert a full file listing from XML to the simpler line-based format. Using xsltproc the same takes 0.74 seconds.

According to issue #340 TextMate “freeze for up to about 5 - 10 minutes” when doing svn status. Not sure how much this change helps on that, no doubt it’s an improvement.
2012-09-02 17:53:49 +02:00
Jeremy Whitlock
52d321b510 Replaced contents of skeleton svn_status.xsl with real content.
* Note: Column delimiter is back to four spaces due to XML/XSL not allowing control characters
2012-09-02 17:53:49 +02:00
Allan Odgaard
df3da106e0 Add svn status xslt to scm target
This is presently not used, it’s skeleton code for @whitlockjc.
2012-09-02 17:53:49 +02:00
Allan Odgaard
be6b36be08 If path no longer have SCM info, include it in change set
This allows the SCM drivers to not report status for non-modified versioned files.

The problem was previously that if a driver didn’t report status for such files, having a file go from modified → clean wouldn’t always cause a refresh, since no change notification was generated for the path.

For the svn driver there is a 50% overhead by svn itself in reporting status for files without status, this overhead is likely magnified by the following XML step (where XML for all files in the working copy needs to be parsed).
2012-09-01 14:17:47 +02:00
Allan Odgaard
49ae19c527 Keep (installed) auth server up-to-date
The recent move to 64 bit broke the (binary) protocol used between TextMate and the server for authenticated reads/writes (since size_t is now 64 bit).

This fixes issue #354.
2012-08-31 23:16:39 +02:00
Allan Odgaard
022e29689b Remove debug output 2012-08-31 23:16:39 +02:00
Dennis Vennink
a2fd40db29 Lower the minimum value for the tab size slider to 1. 2012-08-31 23:16:39 +02:00
Dennis Vennink
4acbbf6b25 Added the ellipsis icon for folded text. 2012-08-31 23:16:38 +02:00
Dennis Vennink
007e498a02 fixup! Incorporated scalable icons.
Implemented proper alignment of the icons with the line number font.
2012-08-31 23:16:38 +02:00
Allan Odgaard
74961834e0 Make svn status parser more robust
I assume issue #340 is because of unexpected output from svn which would cause problems for the parser.
2012-08-31 00:04:28 +02:00
Allan Odgaard
8a7710e93e Use std::tuple instead of boost::tuple 2012-08-30 23:04:20 +02:00
Allan Odgaard
593b6052f5 fixup! Incorporated scalable icons. 2012-08-30 18:59:27 +02:00
Allan Odgaard
6c6ba400ff Revert "Don’t refresh gutter from OakTextView"
Turns out this is required in the situation where the document occupy less space than the visible document rect.

In this case, inserting new lines will not resize the text view, since it has been artificially enlarged to fit the visible document rect, therefore the gutter view will not update properly when inserting new lines.

I think there is a better solution than have the text view refresh the gutter, reverting is just meant as a quick fix.

This reverts commit 4e2ae3c508.
2012-08-30 18:52:49 +02:00
Dennis Vennink
6eca51ab33 Incorporated scalable icons. 2012-08-30 16:40:14 +02:00
Allan Odgaard
4e2b5f91ca Process working directory not always setup
This is a fairly subtle bug: We were implicitly creating a temporary std::string object and requesting c_str from this object.

This C string’s lifetime was that of the temporary std::string, and as we did a lot of std::string creation in the following line, with the new libc++, there was a good chance that the temporary string buffer would be re-used and so, our working directory would be set to a bogus value.

This closes issue #329.
2012-08-30 15:46:42 +02:00
Allan Odgaard
bea35eac35 Use regular font for key equivalent control
Previously we used the fixed width font, not really sure why.
2012-08-30 14:05:21 +02:00
Allan Odgaard
4e2ae3c508 Don’t refresh gutter from OakTextView
I suspect that this was added because some operations were not properly detected, though the only thing I can find, that doesn’t properly update the gutter, is when deleting folded code in a way that doesn’t change the bounds of the text view. This code however does not address that issue.
2012-08-30 10:17:12 +02:00
Allan Odgaard
46786ec60d Gutter: Don’t draw same row rectangle twice
Incase the last line of a file is folded (has no newline) then the gutter would first receive a row record for the line starting this fold, and then when querying for the next row, it would get the last line of the layout, this had a different line number but shared same coordinates as the previously rendered line, so the gutter would draw on top of that.

Closes issue #256.
2012-08-30 00:30:59 +02:00
Allan Odgaard
4e9c5c4693 OakDocumentView now manage gutter’s size 2012-08-30 00:30:59 +02:00
Allan Odgaard
9af3c2ff1a Limit amount of refresh
In theory there should be no reason to redraw more than the divider line and the gutter, after changing gutter styles.
2012-08-30 00:30:59 +02:00
Allan Odgaard
5a2869ea3c Remove pointless indirection 2012-08-29 23:34:24 +02:00
Dennis Vennink
69919fd329 Update gutter images 2012-08-29 22:08:59 +02:00
Allan Odgaard
3d2a3b09d6 Remove automatic resizing from gutter view
There is a somewhat frequent crash caused by infinite “did resize” notifications. It’s unclear exactly why this happens, but basically a subview shouldn’t resize itself unless asked, and it shouldn’t resize siblings either.

We now have an explicit sizeToFit which takes care of sizing the gutter view. It is the responsibility of the owner (of this gutter view) to resize the gutter’s parent scroll view and any siblings that may need adjustment (after calling sizeToFit).

Additionally it is the responsibility of the owner to call sizeToFit when there is a chance the gutter view size needs updating. Generally though, the owner should know, as it is the data source for everything.
2012-08-29 21:55:10 +02:00
Allan Odgaard
ad8977d849 Change how we render gutter images
Previously we would lock focus on our source image. This is bad because we do rasterization (to a fixed pixel format / density) and it (potentially) destroys / mutates the source image.

We now use a second (new) image for the compositing. This is still not ideal, as this second image still is “off screen” so lack the proper graphics context during rendering. A better approach might be to create a CGImage using the graphics context and use that as an (image) mask and do a stroke, but this would require the images to be changed and I am not really certain it will work.
2012-08-29 21:44:23 +02:00
Allan Odgaard
d58389e103 Use NSDictionary instead of retained_image_t
The main reason for this is that we wish to resize the images when the font is changed. This can now be done in the gutterImage: method.
2012-08-29 21:41:57 +02:00
Allan Odgaard
68ed829313 Show alert if readlink fails
I am seeing crash reports from resolve_links and I can’t think of any other reason for this crash, than readlink() returning a value which is neither -1 nor in the range [0..len].
2012-08-29 17:43:04 +02:00
Allan Odgaard
0e96a04d76 Remove compatibility checks
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
2012-08-29 16:02:29 +02:00
Allan Odgaard
f96de9319e Fix/change path::with_tilde
We now leave a potential trailing slash in the result.

This fixes the issue of the missing slash in ⌘T — while I normally prefer the slash to be stripped, I think path::with_tilde should be an exception since effectively it is just replacing the path prefix, it shouldn’t do any real processing (although we do actually normalize the string).

Also fix a bug where we would use tilde for paths pointing to a user folder for a user with current user’s name as prefix.
2012-08-29 15:43:55 +02:00
Jeremy Whitlock
260e3d8b9d Fix missing svn status for long committer names
* Changed the Subversion status command to output XML
* Updated the status parsing to handle new XML output
2012-08-29 14:46:12 +02:00
Allan Odgaard
32a4f76244 Use initializer list syntax 2012-08-29 14:27:35 +02:00
Allan Odgaard
cbe91ff831 Assume compiler support for explicit keyword
Since we require a fairly recent clang for other features, there is no reason to test for this one.
2012-08-29 14:27:35 +02:00
Allan Odgaard
aa49e26fb7 Find dialog’s Find All for untitled file caused crash
Closes issue #318.
2012-08-28 23:27:05 +02:00
Adam Strzelecki
c658687d08 New TM_SCM_NAME variable
This can be used together with `TM_SCM_BRANCH` to customize `windowTitle`.
2012-08-28 22:36:02 +02:00
Adam Strzelecki
c28d2ec2fd Update window title when application is activated.
Variables customizing `windowTitle` such as `$TM_SCM_BRANCH` can change while TM is inactive, while user is working in command line or different app. So it is better to refresh `windowTitle` once we get back to TM.
2012-08-28 22:36:02 +02:00
Jacob Bandes-Storch
d4ce498f60 Use 64-bit: numeric type fixes
Unfortunately a printf precision specifier (‘%.*s’) can not come with a width specifier so we have to cast to int. The width specifier ‘t’ is used for ptrdiff_t.
The int → NSInteger change fixed a bug with popup menu positioning, but there was no associated warning or error. It's possible there are more such bugs that we haven't found yet!
2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
a79c9d0377 Use 64-bit: miscellaneous fixes
- Property using superclass ivar
- Multiple methods matching selector
2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
5634ebbf28 Use 64-bit: CF byte order functions & 64b version 2012-08-28 21:32:46 +02:00
Jacob Bandes-Storch
db73ca4c92 Use 64-bit: stop using Carbon
As we are no longer using Carbon functions to set menu key equivalents, this means that bundle menu items which have the same key equivalents as main menu items will unfortunately not display their key equivalents in the menu.
2012-08-28 21:32:46 +02:00
Jacob Bandes-Storch
9584afba16 Use 64-bit: replace SELNAME with sel_getName 2012-08-28 21:32:46 +02:00