Text Editor: Copy/Cut Line #112396

Open
Matheus Santos wants to merge 4 commits from Matheus-Santos/blender:text_copy_cut_line into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

Copy the entire line when pressing CTRL + C and CTRL + X, in the later it also removes the current line.
This matches the functionality of text editors like VSC and Pycharm.

Copy the entire line when pressing CTRL + C and CTRL + X, in the later it also removes the current line. This matches the functionality of text editors like VSC and Pycharm.
Iliya Katushenock added this to the Python API project 2023-09-14 21:20:45 +02:00
Iliya Katushenock added the
Interest
Text Editor
label 2023-09-14 21:20:49 +02:00
Iliya Katushenock reviewed 2023-09-14 21:28:12 +02:00
@ -1084,3 +1084,3 @@
if (!txt_has_sel(text)) {
return;
buf = static_cast<char *>(MEM_mallocN(text->curl->len + 1, "Clipboard"));

MEM_cnew_array<char>(text->curl->len + 1, AT)

`MEM_cnew_array<char>(text->curl->len + 1, AT)`
Matheus-Santos marked this conversation as resolved
@ -1132,2 +1132,4 @@
ED_text_undo_push_init(C);
if (!txt_has_sel(text)) {
/* Select the current line */
Comment style: https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Comments
Matheus-Santos marked this conversation as resolved
@ -1471,3 +1477,3 @@
for (j = 1;
(j < tab_len) && (a + j < text_check_line_len) && (text_check_line[a + j] == ' ');
j++) {
j++)

Wrong formatting change

Wrong formatting change
Author
Contributor

Reverted this one. It was caused by the clang-format though, is there an specific add-on for VSC that you would suggest?

Reverted this one. It was caused by the clang-format though, is there an specific add-on for VSC that you would suggest?

Well, usually I just use make format formatting.

Well, usually I just use `make format` formatting.
Author
Contributor

Cool, I'll stick to that from now on then!

Cool, I'll stick to that from now on then!
Matheus Santos force-pushed text_copy_cut_line from 544c674f64 to 8978c8dad1 2023-09-14 22:15:49 +02:00 Compare

Not sure of this feature, Is this something common in other editors?

I wouldn't expect copy without a selection to copy the line, I'm not aware of other editors doing this.

Would it respect word-wrap or not?

Not sure of this feature, Is this something common in other editors? I wouldn't expect copy without a selection to copy the line, I'm not aware of other editors doing this. Would it respect word-wrap or not?
First-time contributor

Not sure of this feature, Is this something common in other editors?

Yeah, at least for me, not having this is a bit of a pain when I use the text editor. I'm pretty sure being able to cut and paste entire lines is standard among code editors, and it can be very useful.

> Not sure of this feature, Is this something common in other editors? Yeah, at least for me, not having this is a bit of a pain when I use the text editor. I'm pretty sure being able to cut and paste entire lines is standard among code editors, and it can be very useful.
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u text_copy_cut_line:Matheus-Santos-text_copy_cut_line
git checkout Matheus-Santos-text_copy_cut_line
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112396
No description provided.