Commit Graph

46 Commits

Author SHA1 Message Date
Allan Odgaard
b25f716f86 Remove rforeach macro 2013-08-12 19:32:23 +02:00
Allan Odgaard
d9b446dcc2 Update some use of the iterate macro to for(… : …) 2013-08-03 17:44:30 +02:00
Allan Odgaard
c460535cf7 Add some debug output to layout_t 2013-08-03 17:30:13 +02:00
Allan Odgaard
3c1fe38190 Use a capturing lambda function instead of global variable
The code involved is only for debug output.
2013-08-03 17:25:42 +02:00
Allan Odgaard
c7764b8b14 Deleting trailing newline for line with foldings would misbehave
Here misbehave means unfold the folded text (on the same line) but as a single line.

Fixes #257
2013-08-03 17:18:53 +02:00
Allan Odgaard
560f2ce110 Inserting newline at start of line with foldings would misbehave
Here misbehave means unfolding the folded text on a single line.

Fixes #933
2013-08-03 16:59:15 +02:00
Allan Odgaard
84dc2dd871 Allow a target to use both new and old test system
Presently the new test system cannot be used for (interactive) GUI tests, so we keep the old one until we have that feature in the new.
2013-08-01 19:01:24 +02:00
Allan Odgaard
bc1fae555a Update testing system for layout framework 2013-07-26 17:37:16 +02:00
Allan Odgaard
c22ed7ce09 Make layout_t::update_metrics public 2013-06-28 17:21:11 +02:00
Allan Odgaard
715624b952 Handle failure to create folding dots image
Based on crash reports this appears to happen for some users, though only reason I can imagine is if the images are not found in the application bundle (which would happen if the application is moved after launch, but that normally cause many things to fail).
2013-04-28 11:46:35 +07:00
Allan Odgaard
9a7b440c5a Fix off-by-one when validating folding ranges
Closes #927.
2013-04-01 13:22:41 +07:00
Allan Odgaard
82c30b77db Don’t load bundles from layout test
Ideally we would have the BundlesManager load the bundles but since tests don’t have their own framework requirements, this would require that the layout framework is setup to depend on the BundlesManager framework.
2013-03-25 13:21:53 +01:00
Steven Clukey
636c321e46 Adjust scroll past end height logic
This will work properly with very long lines and soft wrap

Fixes #869.
2013-03-07 20:23:11 +01:00
Allan Odgaard
e8cd0b0df7 Reject bad folding meta data
Fixes issue #866.
2013-03-05 16:42:22 +01:00
Steven Clukey
7892eac2d4 Add “scroll past end” option to the View menu
When enabled the height of the document is increased by the height of the view port, which means the last lines of the document are not anchored to the bottom of the view port but can e.g. be centered.

Closes #513.
2013-03-03 15:14:29 +01:00
Allan Odgaard
461756bc09 Avoid typecasts 2013-02-18 15:38:27 +01:00
Allan Odgaard
d2035f1a79 Remove commented code 2013-02-18 15:38:26 +01:00
Allan Odgaard
248c9efd03 Use CGColorRef instead of cf::color_t
This is mainly to encapsulate cf::color_t creation in the theme framework, though this code change is at worst a run-time optimization.
2013-02-18 15:38:26 +01:00
Allan Odgaard
22b00f2848 Remove unused ‘textColor’ parameter 2013-02-18 15:38:26 +01:00
Allan Odgaard
b139ac5097 Change push_back → emplace_back (C++11)
This is mainly motivated by readability, so I only did a few select replacements.
2013-02-08 11:20:35 +01:00
Allan Odgaard
9eb4044fdb Switch to simpler regexp::search 2013-02-08 11:20:35 +01:00
Allan Odgaard
e75e7ec8e5 Change text::format → std::to_string (C++11) 2013-02-08 11:20:34 +01:00
Joachim Mårtensson
8de62bbc85 Don't mutate shared themes 2013-02-04 20:44:21 +01:00
Allan Odgaard
c8ab123aaf Move font name/size to theme_t
Since styles_for_scope effectively ignore the font parameters (and instead return styles based on the font parameters used when the cache entry was created) it is a better design to have theme_t own the font. This way, changing it can do the proper cache invalidation.

A minor downside is that we can now change the font of the theme without also changing the layout’s font, which wouldn’t cause proper layout invalidation — since layout_t owns theme_t though, users of a layout should always change font via layout_t (which will then change it in the theme).

Also, themes cannot be shared between views that wish to use different font settings.
2013-01-23 09:33:29 +01:00
Allan Odgaard
aa71b7ccf0 Adhere to naming convention
Given constraint-based layouts, we’re more likely to create views in code, and as helper functions are often involved, it makes sense to name them so that we can quickly get a list of all helpers (via search), either for copy/paste or for evaluating wether or not it makes sense to move all helpers to a single library.

Since helpers are declared with static storage, they do not pollute the global namespace.
2013-01-23 08:19:39 +01:00
Joachim Mårtensson
2b51ca93bd Don’t use font name / size as key values in style cache
Font name and font size was being used in the cache key as a way to avoid having to do cache invalidation. This comes at a price of a 3X slow down. Instead clear the cache when font size/name changes. Excessive font name/size switching should be deterred IMO, why not with slowdowns? so no real downside. This does not affect themes setting font name/size, as they are handled by another mechanism.
2013-01-23 08:04:17 +01:00
Allan Odgaard
e13d531d70 Render glyphs in Unicode’s “private use area”
Previously we would render these with their code point value but since there are probably a few hundred glyphs available (on OS X) in the private use area, it was a disputed choice.
2013-01-09 02:59:18 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
7e53c15b67 ARC: Update layout framework (tests) 2012-09-24 20:58:43 +02:00
Allan Odgaard
fbbe4ddac7 Cap line number when requesting info from layout
With the new constraint based layout, the gutter can issue line record requests before the layout has been updated to hold the new document buffer.
2012-09-21 16:23:35 +02:00
Allan Odgaard
0f3861fec7 Retire custom begin/endof functions
We can now use std::begin/end although for containers we explicitly call the member functions.
2012-09-20 12:22:21 +02:00
Allan Odgaard
ebab500ba3 Use std::map/set instead of C arrays
These types come with a find() method and avoids having to use helper functions to get the begin/end of the array (for linear search).
2012-09-20 12:22:20 +02:00
Allan Odgaard
536ea62f2d The indent ignore fold pattern would affect start/stop markers
When we wish to (ab)use the indented fold system to fold sections in markup languages we set the ignore pattern to ignore all but the heading markers. Some markup languages also have markup that might be suitable for folding with explicit start/stop markers, previously these were ignored, if matched by the ignore pattern.

This is an incomplete fix as we don’t correctly nest a start/stop marked block inside a section (the section will stop at the fold start marker).
2012-09-18 20:27:49 +02:00
Allan Odgaard
5ce947541c Use new theme_t API 2012-09-10 22:47:57 +02:00
Allan Odgaard
12f305f82a Spelling dot was drawn flipped 2012-09-10 14:24:05 +02:00
Allan Odgaard
b149b4215e Use image for drawing folding dots
The color of the image can be set by adding a theme style for the foreground and scoped to “deco.folding”.
2012-09-09 11:32:42 +02:00
Allan Odgaard
21e29fd011 Add support for obtaining folding dots imagery
Also remove direct access to context_t’s member data (spelling dot image).
2012-09-09 11:32:41 +02:00
Allan Odgaard
92a058b0dd Add x- and cap height to metrics_t
This is to allow potential background bezels, images, and similar to be aligned with the text.
2012-09-09 11:32:41 +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
Jacob Bandes-Storch
9584afba16 Use 64-bit: replace SELNAME with sel_getName 2012-08-28 21:32:46 +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
031fe94fd0 Fix missing underline for misspelled words
As we are using a CGImage for this, we miss out on the retina version, so this code should be revised.
2012-08-22 21:35:55 +02:00
Allan Odgaard
81af193412 Expose (effective) wrap column from layout_t 2012-08-18 23:56:58 +02:00
Allan Odgaard
be63bda3e7 Support East Asian Width
There is a bunch of functions that deal with the logical column count and these now all count code points with the “east asian width” (unicode) property set as two columns.

This closes issue #206.
2012-08-18 21:29:05 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00