WIP: VFONT: Text Object Word Selection #107519
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107519
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley:TextWordSelect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Corrections to allow better cursor keyboard movement and selection by
word and mouse word selection by double-clicking.
Corrections to selection of word boundaries when inserting the text cursor, selecting words with keyboard and with the mouse. With this PR applied the following works as expected:
Moving the text cursor a word at time backward (ctrl-left arrow) will generally move directly from the front of one word to the front of the previous word. Similarly pressing ctrl-right arrow will move directly from the end of one word to the end of the next word. Even if the word is only one character long.
However if the text cursor is placed at the end of a word, pressing ctrl-left will move to the beginning of that same word. Pressing ctrl-right will move to the end of a word if you start from the beginning. Even if the word is only a single character long.
Holding shift while using ctrl-left or ctrl-right will select a word at a time.
Double-clicking on a word will select that word even if you click on the space between words. So clicking on the right-side of the space before a word will select that word. And similarly for the end of the word. Even if the word is a single character long, starting or ending the sentence, etc.
This makes Ctrl-Arrow key cursor motion fail when stepping over multiple spaces (the cursor stops early).
It should be possible to fix this without changing
move_cursor
at all.It should be enough not to step forward/back if there is immediately before/after the cursor, the initial single character forward step also doesn't seem necessary.
Checking how firefox responds to double-clicking on whitespace, it moves the cursor backwards and select the word behind the cursor (not essential for the fix, but seems a reasonable default).
Not really because there are errors built into that function with its use of
use_init_step
forBLI_str_cursor_step_utf32
.If you start with an older version of Blender, like 3.5, before we started mucking around. Ctrl-arrow movement seems to work mostly okay but there are errors. If starting at either side of a single-character word it will move one character too far.
Similarly if your cursor is between the second and third character of a word, pressing ctrl-left will move to the beginning of the word. But if between the first and second character hitting ctrl-left will move to the end of the previous word. The same thing happens if just before the last character of a word, versus the second-to-last, and pressing ctrl-right.
I updated this PR with a
font_select_word_exec
that is probably the kind of simple thing you are expecting, while only having minimal changes tomove_cursor
that I am hoping make sense. PREV_WORD and NEXT_WORD are just changed not do that init_step in most cases.If your proposing functionality changes I rather this be handled separately, the behavior your pointing out is matched in the text-editor, python-console & text fields.
The logic is that Ctrl motion that would take a single step, always step over that character (as there is no need to hold Ctrl if a single character needed to be stepped over). Changing this may be fine but it's a separate matter.
It might be simplest not to use word stepping logic and instead and check the white space directly.
Yes, it is the same behavior all over. Following shows where the cursor goes when using Ctrl-Arrows. The incorrect move shown in red happens everywhere.
It also result in this kind of behavior around one-letter words:
This all just comes from that use_init_step happening all the time, doing that initial one-character move without any testing. We always call
BLI_str_cursor_step_utf8
andBLI_str_cursor_step_utf32
with that set true.So fixing it is messy. But I'll post a PR that we can stare at and maybe think about how it could be less messy.
VFONT: Text Object Word Selectionto WIP: VFONT: Text Object Word SelectionPull request closed