Commit Graph

14 Commits

Author SHA1 Message Date
Allan Odgaard
80bf684510 Don’t disallow snippet expansion in last placeholder
This was (temporarily) disallowed by previous commit. We do however need to allow it in the last placeholder since that is used for chaining snippets. See issue #182.
2012-08-21 19:43:30 +02:00
Allan Odgaard
40822e87e6 Limit recursive snippet expansion
If caret is at the first position of a place holder then we no longer look for tab expansions, should the user press tab.

This address the issue where a placeholder has optional content and the word to the left of this optional content is a tab trigger. Previously deleting the placeholder text and pressing tab would insert a new snippet, which would generally not be expected.

This closes issue #226.
2012-08-21 19:43:10 +02:00
Allan Odgaard
74085dd53c Don’t mark empty snippet placeholders ‘unanchored’
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.
2012-08-20 15:44:48 +02:00
Allan Odgaard
4c66bfd213 Fix copy to find/replace clipboard with non-standard selections
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.
2012-08-18 23:56:58 +02:00
Allan Odgaard
a84f597b82 Use wrap column from layout
This closes issue #158.
2012-08-18 23:56:58 +02:00
Allan Odgaard
12d700a8a9 fixup! Fix trailing whitespace in text reformat
We still got the extra (double) newline after the paragraph.
2012-08-18 22:11:10 +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
Damon McDougall
36b2e82e3a Fix trailing whitespace in text reformat
On a ^Q text reformat, trailing whitespaces were not removed. Typically
whitespace is typically considered undesirable.
2012-08-18 19:06:14 +02:00
Allan Odgaard
4a22d1af54 Split disableIndentCorrections into two settings
The `disableIndentCorrections` setting now only disables the (aggressive) indent corrections that TextMate does while you type.

There is an additional `indentOnPaste` which you can set to:

1. `simple` — this is the indent behavior which was previously implied when setting `disableIndentCorrections`. It indents the paste to the position of the caret and works well for Python.
2. `disable` — the text is inserted as-is without indenting it.
3. «unset» — indent the paste based on the indent patterns of the current scope.
2012-08-15 22:59:51 +02:00
Allan Odgaard
d8c73a82c8 Pasting on empty line no longer inserts newline
This closes issue #69.
2012-08-15 22:53:47 +02:00
Allan Odgaard
3f00d23de7 Consecutive deletes extend the yank clipboard
This turned out to be a little more involved due to how we need to make a distinction between a forward delete (prepend) and backward delete (append).

Implements issue #118.
2012-08-13 21:30:57 +02:00
Allan Odgaard
4594b08c46 Improve variable names 2012-08-13 21:27:03 +02:00
Nathaniel Tagg
99ab4e6578 Implement ⌃Y for yanking last deletion 2012-08-11 22:41:02 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00