Users should be able to drag and drop selected text anywhere in the same file to move it there. They should also be able to drag it to other text views to insert it there.
Is your feature request related to a problem? Please describe.
We should be able to find strings of text in a document and browse different occurrences.
We need to implement column selection (also known as block selection or rectangular selection) in CodeEdit, allowing users to select text in a columnar fashion. This feature is particularly useful for editing structured text, such as code, where the same changes need to be applied to multiple lines simultaneously.
Triggering Column Selection:
Users should be able to initiate column selection by either
holding down the โฅ Option key and dragging the mouse or
using the keyboard with โง Shift + โ Control + โฒ up/โผ down arrow keys
Visual Indication:
There should be a clear visual indication that column selection mode is active by changing the cursor to crosshairs
Editing Behavior:
When text is typed while in column selection mode, it should replace the selected text in all lines within the selection.
Deleting should remove the selected block of text across all lines.
Navigating and selection with the arrow keys should apply to each cursor as expected, including with modifier keys held
Clipboard Support:
Copying and pasting should respect the column selection, allowing users to copy a block of text and paste it in a similar columnar fashion.
Compatibility:
Ensure compatibility with existing selection behaviors and other editor features, such as multiple cursors.
Additional Context
This feature is common in many text editors and IDEs, such as Visual Studio Code, Sublime Text, and JetBrains IDEs, and can significantly enhance productivity, especially when working with large codebases.
Possible Challenges
Ensuring that column selection works seamlessly with all supported languages and file types.
Managing edge cases, such as selections that start or end in the middle of a tab character or mixed tab/space indentations.
The emphasis background color is yellow. The text should be black regardless of the users color scheme to be visible on this background. Currently, when the user has a light color scheme set, it is black as expected, however the text color is white when the user has a dark color scheme set.
Expected Behavior
The emphasis text color should be black regardless of color scheme so that it is visible on the yellow background.
Add an option to have selections follow the Web style. That is, selections don't select the entire visible line if the line is selected. Selection rects only follow text rects.
When changing font size the number of lines in the viewport may change if the difference in size is large enough. This causes lines to be displayed, but layout regeneration is not caused until something like a scroll action occurs.
To Reproduce
Open a document
Change the font size to something large (20)
Change the font size to something small (4)
Observe that there are lines visible with the previous font size.
Expected Behavior
Changing the font size should cause layout for all visible lines.
Version Information
CodeEditTextView: main (40d8e88)
macOS: 13.6.1
Xcode: 15.0
If selecting text beyond bottom of the text view viewport with โงโพ, the scroll isn't immediately adjusted to show the bottom of the selected text until selected a few more lines after that point.
To Reproduce
Select some text beyond the bottom of the viewport with โงโพ.
Notice scroll position isn't updated until pressing it a few more times.
Expected Behavior
The scroll should be update after the partial or complete line below the viewport is selected.
I've noticed that when editing near the bottom of a file, and using editing commands such as "Shift-ArrowKey" to select text, the editor view jumps up to the beginning of the file.
I could record it happening here (my keypresses are visible bottom right) - see attached screen recording.
To Reproduce
Edit a file near the bottom of the View
Select text using Shift-Arrow
Expected Behavior
The editor window shouldnt move on its own.
Version Information
CodeEditTextView: main branch
macOS: [e.g. 13.6.2]
The current implementation lacks a function that accepts multiple ranges and corresponding strings for replacement. We need a method similar to the following:
publicfunc replaceCharacters(in ranges:[[NSRange]], with strings:[String])
This function should allow replacing characters in multiple ranges with their respective strings.
While you can call replaceCharacters(_:with:) multiple times, each call is treated as a separate insertion, which creates a misleading undo history.
When window or pane is inactive, the textview does not handle inactive state.
Insertion point should be hidden
Selection background if any should change color to a more gray color
To Reproduce
Click out of window so it is inactive
Notice insertion point is still visible or text selection background color is still the same
Expected Behavior
When inactive (either the window or the instance of the text view not in focus if there are multiple present), the insertion point should be hidden and the text selection background color should be more gray (see Xcode for reference)
When typing Chinese, sometimes pressing a key will get several more letters,For example, pressing one m will get two m's,When you press the Delete key, text is added instead of deleted
To Reproduce
Change the input method to Chinese
Slowly type the text, press one m, then another m, and you will find that three m's appear
Press the Delete key and you will find that you are adding text instead of deleting text
Expected Behavior
In the case of Chinese input method, input a few words to get a few words, press the delete key can be deleted normally
Cursors right now share a timer. If the editor is unfocused the cursors stop blinking, but if another editor is focused all editor's cursors begin to blink.
The cursor blink timer needs to be attached to a TextView instead of a global timer.
There's a growing need for an API for emphasizing text in the editor view. This has already been implemented for bracket pair highlighting (#186), but should be separated from the bracket pair code and made into a public API.
Some things that will use this API:
Search in file
Project find (CE, when selecting a find navigator search result)
I was testing the new cursor introduced in Sonoma which has an overlay under your cursor and I ran into a similar issue when trying to use voice to text.
To Reproduce
Make sure the cursor is in the editor.
Press Dictation key (F5 on a MacBook Pro)
Say "Test"
Notice there are duplicate characters
Expected Behavior
"Test" should be in the editor instead of having duplicate characters.
Users should be able to drag and drop selected text within the file to move it.
If selecting a text range, as the user drags the text, the cursor will move to the dragged location to indicate where the text will be placed when dropping it.
If selecting a line or multiple lines, as the user drags the text, lines will animate and move out of the way to indicate where the text will move when dropped.
User should also be able to hit the esc key while dragging to cancel the drag.
Is your feature request related to a problem? Please describe.
In the enhancement requested by CodeEditApp/CodeEdit#868, the request to add configurable indentation to wrapped lines is beyond the current capabilities of CodeEditTextView.
Describe the solution you'd like
Add a parameter or option which allows custom indentation to be added for wrapped lines. May require enhancement + PR in STTextView