127 Commits

Author SHA1 Message Date
Allan Odgaard
94d3b9b670 Remove old build files 2021-02-15 16:01:50 +01:00
Allan Odgaard
f7d765ba0e Add build files (for new build system) 2021-02-15 16:01:50 +01:00
Allan Odgaard
c93030b385 Remove all debug output from custom log macros
This provided value during early development, but has been unused for years, and it would generate too much noise if converted to os_log.

So better to just remove it all and add os_log statements as needed.
2020-06-05 21:22:50 +07:00
Allan Odgaard
4ec10c0923 Don’t annotate types and classes with PUBLIC
This was required when we linked each framework as its own thing, which we do not do anymore, and if we do go back to this system, we can simply have symbols public by default.
2020-06-05 21:22:50 +07:00
Allan Odgaard
caaa36161d Change most fprintf log statements to using os_log 2020-05-04 19:20:04 +07:00
Allan Odgaard
8f685ff25c Use std::clamp instead of oak::cap (C++17) 2019-08-01 10:23:55 +02:00
Allan Odgaard
1f97f479e7 Update CoreText constants to use “modern” names 2018-11-09 13:57:06 +07:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
Ronald Wampler
4a7e774196 Use oak::random_shuffle instead of std::random_shuffle
The latter is deprecated in C++14 and will be removed in C++17
2016-10-18 23:06:49 +02:00
mathbunnyru
9632a8d804 Deleted unused variables 2016-10-18 23:06:48 +02:00
Allan Odgaard
2feb4a497a Use crash_reporter_info_t’s convenience constructor
Also change most ‘crashInfo’ variable names to just ‘info’ to be consistent.
2016-10-07 22:14:33 +02:00
Allan Odgaard
a378b3d241 Limit CTLine objects to a length of 2048 bytes when creating layout
While it may break some unicode features (mainly mixing in text drawn right-to-left) it improves performance significantly (for files with long lines and no soft wrap).
2016-10-02 22:51:24 +02:00
Allan Odgaard
d9995df674 Improve performance when toggling foldings at all Levels
Fixes #1137.
2016-10-02 08:08:05 +02:00
Allan Odgaard
e6ed50c107 Introduce kMacClassicThemeUUID since we reference it in multiple places 2016-09-26 11:09:32 +02:00
Allan Odgaard
b97a3fc3f8 More crash report info related to drag’n’drop issue 2016-08-25 09:41:21 +02:00
Allan Odgaard
c488d25555 Add support for rendering strikethrough text 2016-08-24 21:22:26 +02:00
Allan Odgaard
6954185e8f fixup! Simplify code to obtain font’s em-space
This was supposed to obtain the font’s en-space, not em-space.
2016-08-09 12:57:25 +02:00
Allan Odgaard
002b17e4da fixup! Ensure we have a CTLineRef before asking for line metrics 2016-08-07 17:08:06 +02:00
Allan Odgaard
1f23a34c15 Ensure we have a CTLineRef before asking for line metrics
Closes textmate/bugs#22.
2016-08-05 22:51:48 +02:00
Allan Odgaard
f487c5d575 Simplify code to obtain font’s em-space 2016-07-05 14:20:08 +02:00
Allan Odgaard
ec430fe375 Don’t let layout_t rely on caller to set the theme’s font
The theme_t::copy_with_font_name_and_size is an implementation detail that would be nice to get rid of.
2016-07-05 12:13:05 +02:00
Allan Odgaard
669928f4de Remove use of @synthesize in miscellaneous files 2016-06-22 20:44:41 +02:00
Allan Odgaard
371d426c5f Add ‘char const*’ insertion API to ng::buffer_t 2016-06-21 23:23:44 +02:00
Allan Odgaard
4758061719 Do not add final newline to hex dump 2016-06-21 10:51:55 +02:00
Allan Odgaard
a60e32b41a Draw selection in left/right margin when line is fully selected 2016-06-13 13:02:49 +02:00
Allan Odgaard
b2ce37f1c4 Add getter for a layout’s wrap column
Also rename wrapping member function to soft_wrap.
2016-06-13 13:01:11 +02:00
Allan Odgaard
f7e61679b9 Add missing space (coding style) 2016-06-13 13:00:04 +02:00
Allan Odgaard
c136a21804 Use indexed_map_t to track foldable lines
It is not clear to me whether there was a reason that this code was using the basic_tree_t directly or if it was just written before the indexed_map_t layer was introduced.
2016-06-13 12:59:31 +02:00
Allan Odgaard
ec42982b13 Simplify code to setup folding patterns 2016-06-13 12:59:31 +02:00
Allan Odgaard
0af49d6d27 Folding indented blocks no longer include trailing empty lines
The rationale for this is that when empty lines are included it leaves no whitespace between functions.

Example and TextMate 1.x behavior described here: http://pastie.org/private/lgtnlvc8tdvghoppocob5q
2016-05-29 20:51:57 +02:00
Allan Odgaard
e83fee564c Refactor: use emplace_back(…) instead of push_back(make_pair(…)) 2016-05-28 22:12:46 +02:00
Allan Odgaard
63ce297012 Fix issue with lines matched by multiple folding patterns
Previously when a line was a start or stop marker, and was also matched by `foldingIndentedBlockIgnore` then we would set the line’s indent to INT_MAX to ensure the line would not terminate a foldable indented section, i.e. basically storing the “line should be ignored” in the indent since the line’s type was already set to start or stop marker (rather than “ignored line”).

However, the indent is used to pair start/stop markers, so if only one of a start/stop pair was also matched as an ignored line, they would not be considered a pair because of the different indent levels. The opposite could also be the case, where two lines with different indent were both ignored, and this was seen to share the same indent.

This partially reverts commit 337ac1219d.
2016-05-28 22:07:11 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Josh Bernitt
263da53c81 Optionally draw a horizontal line for every tab stop
This can be toggled using View → Show/Hide Indent Guides or controlled per file type via the `showIndentGuides` setting in `.tm_properties`.
2016-05-02 19:58:01 +02:00
Allan Odgaard
337ac1219d Preserve indent ignore matches for start/stop fold markers
See issue at http://lists.macromates.com/textmate/2016-January/039183.html

This is a continuation of 536ea62f2d
2016-04-18 20:10:17 +07:00
Orta Therox
34fa11ab3d Add a horizontal 2px margin on the Folding closed indicator 2016-04-15 00:25:24 +07:00
Allan Odgaard
edf2923f3a Allow obtaining character rectangle placed on the baseline 2015-11-19 22:29:27 +07:00
Allan Odgaard
f06f447ede Avoid referencing private types by using std::remove_pointer 2015-08-27 22:46:53 +02:00
Allan Odgaard
123471a6e8 Use arc4random_uniform (in tests) to avoid modulus bias 2014-12-16 16:02:09 +07:00
Allan Odgaard
5b39bdc98b Remove double semi-colons at end of line 2014-11-14 10:21:34 +01:00
Allan Odgaard
fe71fa1aaf Use CGImageRelease instead of CFRelease 2014-10-14 12:29:46 +02:00
Allan Odgaard
9a326d1f5f Do not prevent empty lines from being a fold start/stop marker
This is compatible with how TextMate 1.x works. We identify empty lines because we want to ignore them when finding the last line in an indented block, though this commit should not break that, unless the language in question have one of the folding patterns match empty lines and have also enabled indent based foldings.
2014-10-03 21:49:13 +02:00
Allan Odgaard
c9a13a82c5 Fix deprecation warnings 2014-09-03 17:02:25 +02:00
Allan Odgaard
6bdad1733e Move handling of invisible character mapping to ng::context_t 2014-09-03 16:06:44 +02:00
Allan Odgaard
06b6802d05 Do not export ng::paragraph_t and supporting to_s function 2014-09-03 16:05:14 +02:00
Allan Odgaard
2f1c4c05c4 Do not use ‘timeIntervalSinceNow’ with dates in the past
We previously negated the result but now we instead ask for [[NSDate date] timeIntervalSinceDate:startDate].
2014-08-21 16:07:23 +02:00
Allan Odgaard
833d724779 Check for failure when creating CTLineRef related objects 2014-07-31 15:36:19 +02:00
Allan Odgaard
bb3b997a56 Do not create temporary CTLineRef for lines without tabs
This also avoids creating the paragraph style object for these lines.
2014-07-31 15:36:19 +02:00
Allan Odgaard
082c665457 Do not create tab stop at location zero
I do not understand what the point of this tab stop is.
2014-07-31 15:36:19 +02:00