Commit Graph

231 Commits

Author SHA1 Message Date
Adam Strzelecki
1f7c169bac 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-08-30 14:15:35 +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
Jacob Bandes-Storch
c976bce24d Use 64-bit: use std::thread to avoid void* cast 2012-08-28 21:32:46 +02:00
Jacob Bandes-Storch
b675c78909 Use libc++: avoid incomplete types where needed 2012-08-28 20:17:29 +02:00
Jacob Bandes-Storch
0fcb4c2d2c Use libc++: don’t rely on implicit conversions 2012-08-28 20:10:55 +02:00
Jacob Bandes-Storch
c5520a6919 Use libc++: replace typeof with decltype 2012-08-28 13:30:21 +02:00
Jacob Bandes-Storch
fd419fd0b1 Use libc++: replace __gnu_cxx with std 2012-08-28 13:30:20 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Allan Odgaard
6949361558 Release notes no longer a floating window
Floating windows are not part of the normal window cycle chain (⌘`) so should be avoided. This was mainly done to ensure that the notes are on top at launch (where other windows may open, and the order of this is sort of undefined) — what we do now is use performSelector:withObject:afterDelay: — on a general note, using the afterDelay: methods is a big no-no!!! But as long as we only have one thing do it, and it’s for showing a window, it should be predictable enough.

This closes issue #265.
2012-08-28 12:52:52 +02:00
Allan Odgaard
0cc79cf195 Add missing NULL argument to varags function
Amazing this hasn’t caused any problems, but on 64 bit it was an instant crash.
2012-08-28 11:11:33 +02:00
Allan Odgaard
5add8042c1 Create test repository with TM’s PATH/TM_SVN
This can still be fooled, as we do not read variables from TextMate’s user defaults, but I think this should solve majority of issues users are reporting.
2012-08-27 22:08:39 +02:00
Allan Odgaard
a58f424a14 Fix issue with recording macros
The recordSelector: might receive a ‘nil’ argument. Previously this was handled gracefully by using ‘dictionaryWithObjectsAndKeys:’ but not so when using the new Objective-C literal array syntax. So reverting to the old syntax.

This closes issue #38.
2012-08-27 20:19:05 +02:00
Allan Odgaard
dae55ddf95 Fix crash from file chooser
When a project was outside user’s home folder with a symbolic link to somewhere below the user’s home folder, we would calculate a wrong prefix length when user searched using full path (i.e. entering ‘/’) as the display string had the link tilde-abbreviated though the match was against the full absolute path.
2012-08-27 19:29:50 +02:00
Allan Odgaard
d956e8d7c0 Rewrote OakFileIconImage
There are mainly two reasons for this:

  1. Unexplained crashes (see issue #73).
  2. We were using lockFocus when getting the symbolic link arrow (from IconRef, as there seems to be no “modern” API to get this arrow) which caused a rasterization of the image.

The new implementation is much simpler, as all work happens in the image representation which does not have any (weak) pointer to its parent image.
2012-08-27 19:29:50 +02:00
Allan Odgaard
4cf204d0a0 Handle tilde in mate’s install path
Older versions of TextMate stored the install path with the tilde so we always need to (potentially) expand that when fetching the install location.

The lack of doing this was likely the cause of issue #302.
2012-08-27 19:29:50 +02:00
Jacob Bandes-Storch
6aeb27f02f Use Cocoa instead of Carbon for popup menus 2012-08-27 01:03:16 +02:00
Jacob Bandes-Storch
64bb4b46cf Rename bundles::menu.cc to menu.mm 2012-08-27 01:03:16 +02:00
Jacob Bandes-Storch
9057d22e06 fixup! ⌘+click a file browser icon to show in Finder
Only attempt to show the item in Finder if it is a file
2012-08-27 01:03:16 +02:00
Jacob Bandes-Storch
40db25c712 Title case tab context menu items 2012-08-27 01:03:16 +02:00
Allan Odgaard
1482c87f0c Remove executable flag from PDF files 2012-08-26 20:37:32 +02:00
Allan Odgaard
fc13d2021d Tweak gutter colors
Use the text foreground color for icons when the theme doesn’t provide a color and introduce ‘gutterSelectionIcons’ for the color of selected icons (defaults to selected foreground color).

Also changed the gutter selection border color to match the divider color (when it isn’t specified by the theme).
2012-08-26 18:52:25 +02:00
Dennis Vennink
5a80fcea95 Replace PNGs with resizable PDF template images 2012-08-26 18:26:34 +02:00
Dennis Vennink
6e02f55fff Add gutterSelectionBorder and gutterIcons theme keys 2012-08-26 18:26:34 +02:00
Lukasz Czekaj
19457ad2e8 Fixed negative height bug in htmlOutputView
After dragging the HTML Output window down below the bottom of the main
window it cannot be dragged back and negative height of HTML Output is
saved to file.
2012-08-26 17:48:47 +02:00
Allan Odgaard
c7678e9f67 If file is not on disk, use tmProperties for encoding
This happens e.g. if we do ‘ls|mate’ — here we do have content which got a charset and newline mode assigned during “load”, but from the user’s POV he is saving a new file (if he saves the buffer) so should get his configured encoding.
2012-08-26 17:33:26 +02:00
Allan Odgaard
6f45ee4a9c Use encoding::type for open related API 2012-08-26 17:06:38 +02:00