Ranges can be unanchored which is when they are made (mainly) by a unit selection, for example “select to enclosing braces”. What it means is that if we later use shift + movement actions (to “move” the selection end point) we will always extend it (as we don’t know which of the two end points should be considered the anchor).
Though the unanchored flag has a double role, for snippet placeholders we also set it, when we select the placeholder field, and when user press tab, we ignore tab expansions if there is an unanchored selection. So this disables recursive snippet expansion if the user immediately press tab when reaching a snippet placeholder.
Turns out that when we reach the last field of a snippet, some users want a new snippet expansion.
This fix is not ideal, but by far the easiest, and it achieves the goal.
This closes issue #182.
It now takes key path and destination (github repostiory) as arguments. The generated build.ninja assumes the user local build.ninja sets these variables.
This means pressing e.g. ⌘/ (using the slash on the numeric keypad) will still work to toggle comments.
It also means that we can no longer bind specifically to the numeric keypad keys, but I don’t think anyone actually does that (given that few have numeric keypads).
The ideal solution would be to first do a literal check and then, if there was no match and the key event had the numeric keypad flag set, do a test with this flag removed, but that would change the simple string compare we presently use plus the easy caching and binary search of finding the item that matches a key event, i.e. it would add complexity to the code with no known argument in favor of this flexibility.
This was also done prior to commit 806cb44. I just assumed that now that we are back using the system’s named image stuff, we would benefit from their cache, but clearly we are not (especially file browser seemed sluggish because of (re)loading the file type images).
Previously it would place either the column or discontinuous selection on the find/replace clipboard, which wasn’t useful.
Now it only places the “first” range (of a discontinuous) selection on the clipboard, or first row of a column selection.
When we need to work on a paragraph (reflow, unwrap, select, etc.) we now extend upward until we see a blank line, and likewise move downward until there is a blank line.
This is related to issue #154.
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.
This checks if the character needs to be counted as double-width (for soft wrap and similar).
I used the following script to generate the tables, it should be improved to collapse the ranges:
#!/usr/bin/ruby
fixed, start, stop = [ ], [ ], [ ]
open('|curl -Ls http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt') do |io|
io.grep(/^([0-9A-F]+)(?:..([0-9A-F]+))?;[A-Za-z]*W/) do
if $2
start << "0x#$1"
stop << "0x#$2"
else
fixed << "0x#$1"
end
end
end
puts "static uint32_t Fixed[] = { #{fixed.join(', ')} };\n"
puts "static uint32_t RangeBegin[] = { #{start.join(', ')} };\n"
puts "static uint32_t RangeEnd[] = { #{stop.join(', ')} };\n"
This makes it easier to allow third parties to add their bundle to our index. They will sign the bundle themselves and we’ll include their info (download URL and description) plus public key in the index.
The index (with the public keys) is itself signed and delivered over a secure connection (https), so there should be no way for a non-trusted person to add a public key to the index.
For uncommitted items we no longer show folders if items from these folders are already shown.
For untracked items we only show the top-level (untracked) directory and not the items it contains.
Previously we would select the n’th file in the result list so one would have to then use arrow down to get to the first match of this file. Now we go directly to the first match in the file (unless the matches for the item is collapsed).
This means having a test file open (in TextMate) and using ⌘B, the test will always run, even if it has previously succeeded and none of the test’s dependencies have been updated.
This also works as a (quick) way to deselect all in the file browser (i.e. hit ⌃⌘R twice) which is useful when one wants to run commands on the entire project (e.g. Git → Show Uncommitted Changes).
I feel that the better API would be to make the selectedURLs property r/w (instead of read-only), but that is more involved since there is the case of setting a selection while the file browser is still loading items.
This is implemented by invoking “go back” if already showing an SCM URL. If there is no history (unlikely) then we instead “go up (parent)” which should take us to the root of the repository.