diff options
| author | Stefan Monnier | 2003-05-10 16:36:02 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-10 16:36:02 +0000 |
| commit | 0bbdffbdfcf4fc7fccc5996df7f6d8d10c3a46a0 (patch) | |
| tree | 1adcbb64e323baf7aacc2ec27558034a30e698a4 /src/keyboard.c | |
| parent | 6cd83a9a85246deed44c60cad2edd4ace0076b9f (diff) | |
| download | emacs-0bbdffbdfcf4fc7fccc5996df7f6d8d10c3a46a0.tar.gz emacs-0bbdffbdfcf4fc7fccc5996df7f6d8d10c3a46a0.zip | |
(adjust_point_for_property): Try harder to move point
to the non-sticky end of an invisible property.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 8d7e67cf294..8dcd1abd5f8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Keyboard and mouse input; editor command loop. | 1 | /* Keyboard and mouse input; editor command loop. |
| 2 | Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000, 01, 02 | 2 | Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99,2000,01,02,03 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -1874,7 +1874,10 @@ adjust_point_for_property (last_pt, modified) | |||
| 1874 | int beg, end; | 1874 | int beg, end; |
| 1875 | Lisp_Object val, overlay, tmp; | 1875 | Lisp_Object val, overlay, tmp; |
| 1876 | int check_composition = 1, check_display = 1, check_invisible = 1; | 1876 | int check_composition = 1, check_display = 1, check_invisible = 1; |
| 1877 | int orig_pt = PT; | ||
| 1877 | 1878 | ||
| 1879 | /* FIXME: cycling is probably not necessary because these properties | ||
| 1880 | can't be usefully combined anyway. */ | ||
| 1878 | while (check_composition || check_display || check_invisible) | 1881 | while (check_composition || check_display || check_invisible) |
| 1879 | { | 1882 | { |
| 1880 | if (check_composition | 1883 | if (check_composition |
| @@ -1941,7 +1944,19 @@ adjust_point_for_property (last_pt, modified) | |||
| 1941 | /* Move away from the inside area. */ | 1944 | /* Move away from the inside area. */ |
| 1942 | if (beg < PT && end > PT) | 1945 | if (beg < PT && end > PT) |
| 1943 | { | 1946 | { |
| 1944 | SET_PT (PT < last_pt ? beg : end); | 1947 | SET_PT ((orig_pt == PT && (last_pt < beg || last_pt > end)) |
| 1948 | /* We haven't moved yet (so we don't need to fear | ||
| 1949 | infinite-looping) and we were outside the range | ||
| 1950 | before (so either end of the range still corresponds | ||
| 1951 | to a move in the right direction): pretend we moved | ||
| 1952 | less than we actually did, so that we still have | ||
| 1953 | more freedom below in choosing which end of the range | ||
| 1954 | to go to. */ | ||
| 1955 | ? (PT < last_pt ? end : beg) | ||
| 1956 | /* We either have moved already or the last point | ||
| 1957 | was already in the range: we don't get to choose | ||
| 1958 | which end of the range we have to go to. */ | ||
| 1959 | : (PT < last_pt ? beg : end)); | ||
| 1945 | check_composition = check_display = 1; | 1960 | check_composition = check_display = 1; |
| 1946 | } | 1961 | } |
| 1947 | xassert (PT == beg || PT == end); | 1962 | xassert (PT == beg || PT == end); |