Commit Graph

62 Commits

Author SHA1 Message Date
Allan Odgaard
e1dd99a0f5 Add window to “document will save” notification
The text view needs to do a little work before saving a document (serialize folded text) and with the window as part of the user data, we can now skip that for text views in windows for which documents are not going to be saved.

This is not an ideal solution; long-term saving will be moved up to the DocumentWindowController which has the full view of all documents and text views.
2012-09-27 17:52:41 +02:00
Allan Odgaard
cf62b6e92b Improve error text for missing shell commands 2012-09-27 17:52:41 +02:00
Allan Odgaard
4ed34392d6 Use synthesized instance variables 2012-09-24 21:15:47 +02:00
Allan Odgaard
3f012ff11c Recent menu ignores files created with “New Tab” 2012-09-21 16:24:42 +02:00
Allan Odgaard
8fd7b82cbd Remove CocoaSTL.h include 2012-09-20 12:22:20 +02:00
Allan Odgaard
4273bf968b Get rid of C++ style NSIndexSet iteration 2012-09-20 12:22:19 +02:00
Allan Odgaard
22644470f8 Fix crash when clicking exactly on split view divider 2012-09-19 00:11:11 +02:00
Allan Odgaard
b049dd8892 Opening folder sets up window title/scope attributes 2012-09-18 22:57:03 +02:00
Ryan Maxwell
c24f365daa Use curly quotes in dialog text 2012-09-18 20:28:07 +02:00
Allan Odgaard
361d2daa5b Fix wrong document showing after session restore
Since documents are loaded asynchronously and we trigger a request for the first tab’s document, this might finish loading after the selected tab’s document, hence trigger a setDocument: after we loaded the selected document’s tab.
2012-09-18 19:38:01 +02:00
Allan Odgaard
48616a7ea1 Make document_t::scope private
Ideally should be removed entirely but as document presently does load/save where we need scopes (for import/export commands), we need it internally.
2012-09-18 19:38:01 +02:00
Allan Odgaard
79b0f7a14a Setup scope attributes for untitled documents
These are based on the potential save directory (i.e. the one showing in the file browser) and ensures pressing ⌥⌘N gives the new document proper project and SCM scopes (so ⌘Y and ⌘B works as expected).

This fixes issue #367.
2012-09-18 17:33:02 +02:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
848d197f7a Use DocumentController over document_t 2012-09-18 17:33:01 +02:00
Allan Odgaard
c26e5c2d36 Scope attributes are now given to editor_t
While presently it works the same, it allows us to provide better scope attributes e.g. for untitled documents (which lack SCM attributes).
2012-09-18 17:33:01 +02:00
Allan Odgaard
dabcad588d Introduce OakTextViewDelegate 2012-09-18 17:33:00 +02:00
Allan Odgaard
08666a37ba Fix type error 2012-09-18 17:33:00 +02:00
Allan Odgaard
d5b4573694 Simplify closing tab/split action methods 2012-09-17 16:42:42 +02:00
Allan Odgaard
effa1577ac Don’t call setBottomCornerRounded:NO
This is private API and no longer seems necessary.
2012-09-17 16:42:42 +02:00
Allan Odgaard
d4f6cbacf3 Simplify code
If the window hadn’t been loaded yet, we previously had to delay opening the document when changing tab (in code).

Since we now create the window in the initializer, there is no longer need for this.
2012-09-16 17:03:03 +02:00
Allan Odgaard
7cd8ae4b8e Add safety checks
Since 10% of reported crashes are in synchronizeWindowTitle and seems to be about not having a proper document pointer, I am adding these checks and some debug output — don’t understand how we would get into this situation though.
2012-09-16 11:41:25 +02:00
Allan Odgaard
5ab65ea560 fixup! Constrain size of splits in main window
Forgot to enable ‘autorecalculatesKeyViewLoop’.
2012-09-16 11:41:24 +02:00
Allan Odgaard
d5a73dfca9 Don’t present dot files as having an extension
This is just for the dialog text when user is asked to select a file type.
2012-09-16 11:41:24 +02:00
Allan Odgaard
363ba94fb8 Fix format string in xib
Was using the (undefined) ‘Extension’ variable instead of ‘X’.
2012-09-16 11:41:23 +02:00
Allan Odgaard
1fafbecd54 Remove Chinese translation
It’s not feasible to maintain the old-style xib translations while we work on the UI. We’ll soon move fully to constraint-based layout which should allow translations to be purely string-based.
2012-09-16 11:41:23 +02:00
Allan Odgaard
84104c8d9b Constrain size of splits in main window
The main window has now moved fully to constraint based layout which makes it a lot easier to tweak the layout and fixes issue #145.

Presently the option to have HTML output on the right is not supported. It will likely be back with a few other options that have been requested.

The width of file browser and height of HTML output view is always read from defaults rather than restored from previous session. Effectively this results in the same behavior except when there are multiple windows with different sizing of these splits. Unsure if per-window sizes should be brought back.
2012-09-15 15:12:58 +02:00
Allan Odgaard
baae923414 Remove resize buttons
Going forward we only allow resizing views by grabbing the dividers.
2012-09-15 15:12:57 +02:00
Allan Odgaard
3d3e44e1a4 Add TM_CURRENT_THEME_PATH
There’s a few commands which want to read settings from the current theme. So far these have been reading the theme UUID from TextMate’s settings and scanned the disk to find the corresponding property list.

This is pretty bad because theme UUID can be set in different ways, themes can be in arbitrary bundles, and the property lists can be in delta format.

The latter is not solved, though we ensure the variable point to the base theme, incase a delta exist. TextMate could simply write a non-delta version of the theme to TMPDIR and let the variable point to that, so we’re not really limiting ourself by adding this variable.
2012-09-12 18:30:37 +02:00
Allan Odgaard
28f80a791d Use project’s window title settings for untitled documents
This includes setting up SCM variables and closes issue #298.
2012-09-11 00:05:05 +02:00
Allan Odgaard
cf5b5965da Don’t send theme bundle items to OakTextView
Since the text view delegates theme switching to its parent document view, we just send the theme (bundle item) directly to the document view.
2012-09-10 22:47:58 +02:00
Allan Odgaard
111c1acd11 Refactor: Remove code duplication 2012-09-10 14:24:05 +02:00
Allan Odgaard
b475bdfdef Refactoring 2012-09-10 14:24:04 +02:00
Allan Odgaard
521b981f09 fixup! Fix warning for literal strings used with NSAlert
Since we use another way to initialize the alert, the return codes are different.
2012-09-07 16:17:18 +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
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
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
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +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
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Jacob Bandes-Storch
40db25c712 Title case tab context menu items 2012-08-27 01:03:16 +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
6f45ee4a9c Use encoding::type for open related API 2012-08-26 17:06:38 +02:00
Allan Odgaard
d1de4a8854 Use encoding::type for save related API
There is also a new document_t::encoding_for_save_as_path which returns the encoding that would be used for the document, if saved at the given path. If the document was loaded from disk, it will return the encoding used during load, otherwise it will check tmProperties for which encoding should be used for the path provided. Save dialog for untitled documents will be pre-populated with the result of the above function.
2012-08-26 16:13:20 +02:00
Allan Odgaard
0ca407b72c Move user defaults keys to Keys.{mm,h} 2012-08-25 23:14:15 +02:00
Allan Odgaard
360f7a33bd Add context menu to tab bar
This can be used to close current, other, and tabs on the right. Additionally to create a new tab (to the right of the tab showing the menu) or open the tab in a new window.

Closes issue #191.
2012-08-25 17:54:24 +02:00
Allan Odgaard
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +02:00
Gerd Knops
9d17d74b1b File Browser will now remember it's width
This closes issue #5.
2012-08-22 15:48:34 +02:00
Paul Wilde
cd84a864d2 Added Retina icons for bottom bar and file browser
As all the icons have been remade some of them should look better on non-retina also.

This closes issue #42.
2012-08-22 14:34:25 +02:00
Allan Odgaard
4e9d9414f1 Add encoding options to save dialogs
A minor caveat is that if there are encoding or newline (folder specific) settings in effect for the chosen path, these trump what’s selected in the save dialog.

If we wish to solve this, the best would be to update the options (shown in the save panel) based on selected folder/filename (and the settings in effect for that).

This closes issue #163.
2012-08-21 23:45:45 +02:00