Commit Graph

12 Commits

Author SHA1 Message Date
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
bae6270d6c Add indent aware begin/end of line action methods
The methods going to “begin of indented line” will go to the first non-whitespace character on the line, unless the caret is already there or to the left of this character, in which case it will go to the actual beginning of the line.

The “end of indented line” methods work similarly.

If you want [⇪]⌘⇠/⇢ and ⌘⌫/⌦ to use this behavior, you can add the following to your key bindings file:

	"@\UF702"  = "moveToBeginningOfIndentedLine:";
	"$@\UF702" = "moveToBeginningOfIndentedLineAndModifySelection:";
	"@\UF703"  = "moveToEndOfIndentedLine:";
	"$@\UF703" = "moveToEndOfIndentedLineAndModifySelection:";
	"@\U007F"  = "deleteToBeginningOfIndentedLine:";
	"@\UF728"  = "deleteToEndOfIndentedLine:";
2012-09-21 20:29:58 +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
2ab6f4bfc8 Introduce an “extend selection” find option
This will find (forwards or backwards) but preserve the existing selection.

Presently if the current selection is a zero-width selection (i.e. caret) then we still preserve it. This might not be desired, but one could imagine “extend selection” used with a regular expression which use a look-around assertion (resulting in zero-width matches).
2012-09-06 23:10:55 +02:00
Allan Odgaard
2c572b5921 Add initializer list constructor to ng::ranges_t
This is primarily for using in tests.
2012-09-06 23:10:55 +02:00
Allan Odgaard
2076f80ca8 Make selections created from string unanchored
The selection string syntax doesn’t support specifying an anchor and mainly it is used in situations where the selection should be unanchored.
2012-09-06 14:08:08 +02:00
Allan Odgaard
cbe91ff831 Assume compiler support for explicit keyword
Since we require a fairly recent clang for other features, there is no reason to test for this one.
2012-08-29 14:27:35 +02:00
Allan Odgaard
1477288795 Redefine definition of paragraph
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.
2012-08-18 21:52:08 +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
c7c45b448b Make code to obtain character class public
This includes renaming the constants from using a rather generic kType prefix to kCharacterClass.
2012-08-15 16:00:28 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00