diff options
author | fvogel <fvogelnew1@free.fr> | 2015-06-29 21:57:04 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-06-29 21:57:04 (GMT) |
commit | b953acd1adcee2fe7ed421057e3777dfc262d8a3 (patch) | |
tree | bc84379b885e86a9c9c10b4d3cefe33ad7ba76fe /generic/tkText.c | |
parent | 2b786624cdf7e14d43d2f2e85083bbdeee82c356 (diff) | |
download | tk-b953acd1adcee2fe7ed421057e3777dfc262d8a3.zip tk-b953acd1adcee2fe7ed421057e3777dfc262d8a3.tar.gz tk-b953acd1adcee2fe7ed421057e3777dfc262d8a3.tar.bz2 |
Fixed bug [2886436fff] - [.txt delete] deletes before start index - This is option 2: don't change the behavior of the text widget, but document it better.
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index 139e71d..5042582 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -3001,11 +3001,15 @@ DeleteIndexRange( * file (just before the dummy line) is being deleted, then back up index * to just before the newline. If there is a newline just before the first * character being deleted, then back up the first index too, so that an - * even number of lines gets deleted. Furthermore, remove any tags that - * are present on the newline that isn't going to be deleted after all - * (this simulates deleting the newline and then adding a "clean" one back - * again). Note that index1 and index2 might now be equal again which - * means that no text will be deleted but tags might be removed. + * even number of lines gets deleted. The idea is that a deletion + * involving a range starting at a line start and including the final \n + * (i.e. index2 is "end") is an attempt to delete complete lines, so the + * \n before the deleted block shall become the new final \n. Furthermore, + * remove any tags that are present on the newline that isn't going to be + * deleted after all (this simulates deleting the newline and then adding + * a "clean" one back again). Note that index1 and index2 might now be + * equal again which means that no text will be deleted but tags might be + * removed. */ line1 = TkBTreeLinesTo(textPtr, index1.linePtr); |