Commit Graph

278 Commits

Author SHA1 Message Date
Adam Strzelecki
414d0e1baa 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-05 15:29:08 +02:00
Allan Odgaard
8849899007 Fix crash for missing grammars
Incase our index is out-of-date and we try to load and parse a grammar that does not exist on disk, we would get a grammar_t with a “null” root rule, this would later crash when trying to use the grammar.

As a simple fix we now ensure a dummy rule always exist.
2012-09-05 15:23:40 +02:00
Allan Odgaard
b3f5960546 Resolve path when Bundles folder is a link
This would cause a crash if the Bundles folder was a symbolic link (e.g. to DropBox) since we assumed the entry itself had entries (but only directory nodes have entries).

This closes issue #321.
2012-09-05 15:21:03 +02:00
Allan Odgaard
2b555aef7b Move spelling dot to OakTextView
We now load the image via NSImage and creates a CGImageRef from that (based on the current graphics context). This ensures we get the @2px version when on a HiDPI display.
2012-09-04 23:53:37 +02:00
Allan Odgaard
b6ed16251e Use wrapper for CGContextRef
This allows us to add a few other things like the “misspelled word” image.
2012-09-04 23:53:37 +02:00
Allan Odgaard
81de007bd4 Use new API for better bundle item display names 2012-09-04 20:34:54 +02:00
Allan Odgaard
4b8f7389fb Make hasSelection a public property 2012-09-04 20:33:28 +02:00
Allan Odgaard
1bc81ed7dc Introduce API for proper bundle item titles
When a bundle item’s title contains “«unit» / Selection” then the UI should only show either “«unit»” or “Selection” depending on whether or not the text view has selected text.
2012-09-04 20:32:43 +02:00
Allan Odgaard
a026e4ad11 Improve snippet choice menu
We filter out items that doesn’t have the current prefix and deselect current item if the user deletes the selection.

Some of this logic should probably be encapsulated by a filterPrefixString property added to OakChoiceMenu. This will also avoid the visual flash which arise when filtering the menu and selection changes (since we do one redraw w/o any items selected).
2012-09-04 19:22:53 +02:00
Allan Odgaard
141c0bd525 Don’t scroll selected item to top in choice menu
We now only ensure it is scrolled into the visible area.
2012-09-04 19:22:53 +02:00
Allan Odgaard
b136fcbca4 Proper implementation of setChoices:
This will now reload the table view and resize the pop-up (if necessary).
2012-09-04 19:22:52 +02:00
Allan Odgaard
949c074f9d Factor out choice menu sizing code 2012-09-04 19:22:52 +02:00
Allan Odgaard
17720e4d57 Don’t dispose bundle menus after close
Since we overload performKeyEquivalent: for the main menu to not search the bundle menus, there should no longer be a need to try and prevent the system from interpreting key equivalents for bundle menu items.
2012-09-04 19:22:52 +02:00
Allan Odgaard
18175e455a Position filter lists relative to parent window
I am not sure if this is desired for the Go to Symbol as some people prefer to keep this open at all time.
2012-09-04 19:22:51 +02:00
Allan Odgaard
e3e238f712 Filter lists: Allow showing relative to parent window 2012-09-04 19:22:51 +02:00
Allan Odgaard
0fd7d2a41b Implement Wrap Column → Other…
This is done using an alert with an accessory view. Not the best user experience, but given how rarely the user interacts with this, I wasn’t really in the mood to spend a lot of time on this part now (can always be improved later).

Closes issue #200.
2012-09-03 22:35:12 +02:00
Allan Odgaard
aa2b194341 Better ordering of keys when editing bundle items
This closes issue #338.
2012-09-03 21:52:44 +02:00
Allan Odgaard
f8db67153b Support custom sort order of plist keys 2012-09-03 21:51:31 +02:00
Allan Odgaard
709882fa53 Drag-selecting beyond visible document lacked refresh
This closes issue #297.
2012-09-03 17:59:41 +02:00
Allan Odgaard
59b47e76f0 Fix parent for smart folders 2012-09-03 17:37:11 +02:00
Allan Odgaard
8c55703dea Show Package Contents work for packages with own data source
For example Xcode projects now have their target (URL) set to xcodeproject://path/to/project/file which would cause Show Package Contents to not work, as it expected a file URL.
2012-09-03 17:37:11 +02:00
Zach Drayer
55c0109fa9 Add support for reading xcodeproj files 2012-09-03 17:37:11 +02:00
Zach Drayer
99fd86dab6 Fix warning for literal strings used with NSAlert
__attribute__((format(...))) was added to NSAlert's class-based initializer in 10.7, and due to using string objects instead of literals as informative text, Clang is unable to guarantee the safety of the formatter, and, as such, issues a warning.
2012-09-03 16:42:16 +02:00
Zach Drayer
158c931810 Fix a leak in OakHistoryController 2012-09-03 15:32:03 +02:00
Allan Odgaard
460185724d fixup! If path no longer have SCM info, include it in change set
The iterator checks were wrong.
2012-09-03 15:28:59 +02:00
Allan Odgaard
2b3e0bd7dc 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 15:28:59 +02:00
Allan Odgaard
161d4b7fd2 Don’t prune items from SCM drivers tracking directories 2012-09-03 15:28:58 +02:00
Allan Odgaard
3a47ad6c03 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 15:28:58 +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