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
Steven Clukey
98dfefb5e0
Add space invisible
...
The implements the space invisible using the new method of drawing the invisibles so it does not affect right-to-left text.
2014-07-31 15:36:18 +02:00
Steven Clukey
e0c6e14de0
Make CoreText manage the tabs
...
Rather than putting tabs in their own node, leave them in the text nodes and allow core text to handle the size. This fixes the issue with using tabs in right-to-left text.
2014-07-31 15:36:18 +02:00
Boris Dušek
e08a40a507
layout: Fix bol_as_eol for case where range length is 0
...
bol_as_eol was meant for non-empty ranges, but the only place where
empty ranges were attempted with bol_as_eol was for Zoom tracking,
and it seems like I did not re-test Zoom after making the bol_as_eol
commit.
Fixes textmate/bugs#4
2014-07-16 23:21:21 +02:00
Allan Odgaard
5af1ec23ca
Enable ligatures
...
If you are using the Mensch font then you need to update to version 2 to avoid problems with the ligature for ‘fi’: http://robey.lag.net/2012/08/22/mensch-2.html
2014-07-06 14:50:11 +02:00
Allan Odgaard
af3f4aaa33
Check result of most CF/CT ‘Create’ functions
2014-05-15 13:17:30 +07:00
Allan Odgaard
b8804d1164
Fix three memory leaks
...
One was per launch, one was per key event, and one was per (unique) line drawn.
2014-05-15 13:17:29 +07:00
Allan Odgaard
39b94e6ac3
Harmonize whitespace and add trailing newline
2014-04-14 14:26:52 +07:00
Allan Odgaard
f445f19287
Add assertion to check if index is within allowed range
2014-04-12 11:23:07 +07:00
Allan Odgaard
ff94480298
Check that CoreFoundation functions succeed
...
Several crash reports indicate failure to create a CFString (in ct::line_t’s constructor). As we have an explicit UTF-8 check, I am not sure why it would fail, but at least now TextMate should not crash when it happens.
2014-04-10 17:46:30 +07:00
Allan Odgaard
96de950ed1
Return initializer list instead of using std::make_pair (C++11)
2014-04-06 19:36:09 +07:00
Reza Mohammadi
54d0903c2f
No representation for usual ZERO-WIDTH chars
...
ZWNJ is so common in Persian texts, and its unicode bi-direction class in neutral.
But the representation chunk contains latin characters and are so left-to-right.
So, when ZWNJ is replaced by the representation chunk, rtl texts are rendered incorrectly.
ZWJ and ZWSP are from the same class, but less common at least in Persian texts.
2014-03-15 18:21:28 +03:30
Allan Odgaard
1e11a30a53
Remove redundant storage keywords for @property
...
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
c2397484b8
Use C++11 for loop
...
Majority of the edits done using the following ruby script:
def update_loops(src)
dst, cnt = '', 0
block_indent, variable = nil, nil
src.each_line do |line|
if block_indent
if line =~ /^#{block_indent}([{}\t])|^\t*$/
block_indent = nil if $1 == '}'
line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
$1.to_s + variable + ($2 == "->" ? "." : "")
end
else
block_indent = nil
end
elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
block_indent, variable = $1, $2
line = "#$1for(auto const& #$2 : #$3\n"
cnt += 1
end
dst << line
end
return dst, cnt
end
paths.each do |path|
src = IO.read(path)
cnt = 1
while cnt != 0
src, cnt = update_loops(src)
STDERR << "#{path}: #{cnt}\n"
end
File.open(path, "w") { |io| io << src }
end
2014-03-03 10:34:13 +07:00
Allan Odgaard
ae26988b39
If any folding pattern is set as a scoped setting, use it
...
Previously we would fallback on the grammar’s folding patterns unless ‘foldingStartMarker’ was set, which meant setting just the stop marker or indented folding patterns, would be ignored.
2014-02-22 16:00:00 +07:00
Joachim Mårtensson
0d0ee4c51c
refactor duplicate folding code into one method
2014-02-08 01:31:09 +01:00
Allan Odgaard
26f60bc52a
Change ASSERT_NE → ASSERT
...
Since we do not have a to_s function defined for the iterator type, we cannot use “semantic assertions”.
2013-12-21 11:20:15 +07:00
Allan Odgaard
bc56cc240f
Add API to unfold a range
...
The function will unfold anything completely within the range that also touches one of the range’s end points.
This is because the layout will show adjoining folded ranges as a single image, so if the user clicks this, it is unclear which of the ranges to actually unfold (the layout return a range that encompass all the adjoining folds).
2013-12-20 09:55:29 +07:00
Allan Odgaard
43d3ead3e3
Add API to get folded range for a point
...
This is required to show tool tips when hovering a fold marker or to unfold the fold marker clicked.
2013-12-20 09:13:48 +07:00
Boris Dušek
c7fbcf06ed
Fix accessibility visual bounds ending at line boundary
...
Accessibility visual bounds for a range of a single softline should always
be also visually restricted to the softline. This is in order to be consistent
with implementation in Apple's apps (e.g. TextEdit).
2013-11-15 17:58:28 +07:00
Boris Dušek
e0298cf29c
Provide conversions between softlines and buffer positions
2013-11-15 17:58:11 +07:00
Boris Dušek
b8cad485d9
Track softline count in layout
2013-11-15 17:04:50 +07:00
Allan Odgaard
c5449af10f
Revert "Added spaces as an invisible"
...
Fixes #1145
This reverts commit 8cea97aeca .
Conflicts:
Frameworks/layout/src/paragraph.cc
2013-10-18 20:31:56 +02:00
Steven Clukey
49c949d65e
Add layout_t::set_character_mapping
...
This allow configuring which characters should be used to render tabs, spaces, and newlines (when “show invisibles” is enabled).
2013-10-08 23:03:40 +02:00
Steven Clukey
8cea97aeca
Added spaces as an invisible
2013-10-08 22:00:11 +02:00
Allan Odgaard
51a7424c90
Add additional crash report info
2013-10-08 21:59:54 +02:00
Allan Odgaard
40233245e2
Add crash report info to code involved in a crash
2013-10-04 16:51:27 +02:00
Allan Odgaard
fb8627d077
Intersect left/right scope for rendering soft break nodes
...
This is only relevant for indented soft wrap where e.g. the text following the soft break is underlined: Previously we would then render an underline for the soft break node itself (which normally consists of whitespace).
2013-09-12 23:46:04 +02:00
Allan Odgaard
1c308c810d
Use map::emplace instead of inserting std::pair (C++11)
2013-09-05 20:59:11 +02:00
Allan Odgaard
e4e80a946c
Use std::make_shared
2013-09-03 12:27:20 +02:00
Allan Odgaard
d93b20d571
Use new scope_t API
2013-08-28 00:23:08 +02:00
Allan Odgaard
057096af5b
Rename API to make searching easier
...
Using generic names like ‘append’ is not good when analyzing code for potential refactoring.
2013-08-27 15:30:09 +02:00
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