UI: Console Text Operations #108626
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#108626
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:ConsoleSelect"
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?
Adds the ability to set text cursor position in the Console editor
by clicking with the mouse and many other expected operations.
There are currently quite a few deficiencies in the expected text behavior with Console. This PR adds setting text cursor by mouse click, Shift-arrows, ctrl-shift-arrows, shift-home, shift-end. deletion & movement while there is a selection, ctrl-A to select all. Cut to clipboard. Copying into a selection. Default and IC keymaps. Double-clicking on a word sets cursor position, etc.
WIP: Console Text Cursor Position With Mouseto WIP: Console Text OperationsNOTE: moved TODO's in code to: #108641.
WIP: Console Text Operationsto UI: Console Text OperationsNoticed an odd issue, where dragging the selection may place the cursor if the user hovers over the prompt, dragging away may have the selection starting & ending outside the editable prompt, now with a moved cursor.
There is another issue where a selection prevents cursor motion (the first cursor motion drops the selection, the second moves), I think it's better if the cursor always moves, ignoring the selection.
In this case I think it should reset to it's original location.
@ -1056,3 +1115,4 @@
return OPERATOR_FINISHED;
}
bool console_copy_poll(bContext *C)
Should b static.
Testing this patch, it now seems like a bug when the cursor isn't on either side of the selection (as happens in a text editor). With this change it happens in some cases and not others as it can't be ensured because selection may exist outside the editable area.
One solution could be to place the cursor on clicking but don't set the cursor position when dragging the selection, as it feels like a glitch when the selection and the cursor position get out of sync.
Not arguing at all, just talking out loud...
The complication here is that we have a combination of editable and non-editable text, but I still want all of it to be selectable. As in I really want to keep the ability to select "bpy.context" from the history.
But... this seems to naturally allow times where a selection does not include the cursor because it is non-editable. I wouldn't want to ever not display the cursor though, because it continues to indicate where new text would be inserted. So I can highlight "bpy.context" in the read-only info, ctrl-c and then ctrl-v will go exactly where the cursor is shown. This just requires a cursor that can sometimes be outside of the selection.
Unless we are talking about different things, this follows behavior in Blender Text Editor, UI text entry, and Windows Notepad. If you have a selection and then press left or right arrow the selection is first cleared and the cursor only moves on the second arrow key.
Of course this probably should only happen when the cursor is inside that selection, so what you probably are talking about is that it feels odd when the selection is in a non-editable area. That makes sense. I updated the PR so it only does this movement skip if there is a selection in the editable portion.
@ideasman42:
I made it so that the cursor is not shown if the end of the selection is outside of the editable range. This still feels fine to me and should get rid of that weirdness you felt when the cursor was shown outside of the selection:
I also fixed a bug so now if you select a portion that is mixed editable and not, hitting "delete" will remove the editable portion.
dc12774a33
tod389ac0c64
Testing the patch, the cursor is vanishing when selecting text outside the text field.
@ -3073,3 +3073,3 @@
items.extend([
("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
{"properties": [("type", 'PREVIOUS_WORD'),("select", False)]}),
"select": False
should be the default, there is no need to add it to the key-map.Chasing this down required a bit of backtracking. The idea of ever hiding the cursor is removed. The only real visible change is that when doing one type of mixed selection - starting from the editable text and then extending into the non-editable - the cursor position has to move to the start of selection. This is needed to preserve the cursor position when moving directly up. Hard to explain, but all shown in the following:
f89715b1d5
tofb4f6e4d2b
No, not sure what was up with that. Now Ctrl-X is Cut.
You mean this?
Seems pretty normal to me with this circumstance of having editable and non-editable areas but all being selectable. I wouldn't want the selection to not be shown on drag. You have objected to having the cursor not at the beginning or end of selection. And I wouldn't want the cursor to snap back to where it was before the drag. And I don't like hiding the text cursor.
Behavior in it's current state seems acceptable, I think it's probably possible to support moving the cursor with the mouse - but snapping back to the original location in the case the user moves the cursor outside the editable area (so the path traveled between two points never gives a different outcome) but also don't find it a blocking issue that the cursor is set on mouse release instead of snapping back.
Since this patch is applied, showing the console view (Shift-F4) without any interaction gives a warning:
source/blender/editors/space_console/console_draw.cc:221:33: runtime error: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int'
@ -1185,2 +1284,2 @@
ED_area_tag_redraw(CTX_wm_area(C));
}
console_cursor_set_to_pos(sc, region, scu, mval, move_cursor);
ED_area_tag_redraw(CTX_wm_area(C));
Logic that only redraws when the selection was changed has been removed. I would like to keep this logic other$wise every cursor motion is redrawing unnecessarily. It shouldn't be so involved to detect changes between this and the previous state.
Noticed pressing Home/End with a selection in the cursor area just drops the selection and doesnt move the cursor.
Thanks for noticing. Fixed!
Two issues remain:
console_delete_editable_selection
does out of bounds memory access.#
).Attached ASAN error.
Yes, I should have noticed that those mouse position values were initialized with INT_MAX. Testing for that now.
Thanks for those instructions. Very interesting. I'm now dealing with that as error detection, handling that now fine.