Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-04-08 14:56:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-08 15:15:51 +0300
commit89b3c9da48cf685361105df1ca2e9ed27ef240ae (patch)
treea1b2aa4e43fc556d1966ac73838373d824e73fab /source/blender/makesrna/intern/rna_space.c
parent945b1143df1686f705fd8bf2ff05d04460aa52fa (diff)
Text Editor: don't force other views to follow the cursor
While the existing behavior worked as intended, it wasn't possible to have two views on the same file at different locations. Since there isn't much use in having two views open at the same location allow one view to be at a different scroll location. UI edit-source and selecting a text data block now need explicit calls to scroll to the cursor location. Resolves T87284
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 361c0e82b3b..b6c0bce4342 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1793,7 +1793,13 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr,
st->text = value.data;
- WM_main_add_notifier(NC_TEXT | NA_SELECTED, st->text);
+ ScrArea *area = rna_area_from_space(ptr);
+ if (area) {
+ ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
+ if (region) {
+ ED_text_scroll_to_cursor(st, region, true);
+ }
+ }
}
static bool rna_SpaceTextEditor_text_is_syntax_highlight_supported(struct SpaceText *space)