RichEdit20A line selection mode similar to Notepad - windows

I'm trying to change the way RichEdit20A Windows control selects line so it's similar to how it works in Notepad.
By default, if I select a line (e.g. Shift-End), then all the characters and the end of line is selected:
Sample text
^^^^^^^^^^^^ <- this is the selection
In Notepad it selects just the text:
Sample text
^^^^^^^^^^^
As a result, pressing delete (or backspace) in RichEdit20A control removes the line while in Notepad it just removes the text and keeps the line empty.
Is there any simple way (other than handling selection on my own) to configure the RichEdit20A control to keep formatting but make the line selection to work like in Notepad?

I don't know such a setting to influence the RTF control. But pressing Shift+End is a key input that is possible to trap with a WM_KEYDOWN handler, when you subclass the control.
You can use EM_LINEINDEX with -1 to get the current line start index.
Now with this index you can use EM_LINELENGTH.
Get the current selection (EM_GESTEL) and now you are free to use EM_SETSEL with the values you like to extend it.

Related

Is there any ReturnType functionality for the Editor control like the Entry control contains?

The last field in my form is an Editor and I would like the Done option to appear on the keyboard. I know this can interfere with the function of skipping to the next line.

How to insert text at the beginning of a multi-line selection on GVim?

I have a large block of text, and I want to insert comment delimiters // at the beginning of every line. I am using X11 forwarding to run GVim from a remote Linux box on my local windows machine. I can use the Ctrl+Q to enter the block selection mode as suggested in this post. When I try to press Shift+i to insert in the selected block, it deletes what I have selected and instead inserts the letter "I" at the top line of my selection and puts me in insert mode.
Any suggestions on how I can insert comment delimiters at the beginning of every line in a block? I would love to solve the problem with block insert, but a work-around would also be appreciated.
have you tried :s command?
select those lines
then :s#^#//#
Your Vim is set to behave mswin. You can use :behave xterm to make it behave in the default manner, and then the other suggestions should work.
The behavior of replacing the selection is a characteristic of select mode. You need to use visual mode for the column-insert via I.
How you got into select mode depends on your configuration. If <C-Q> gets you there, you likely have the cmd value in the 'selectmode' setting.
This is a comma separated list of words, which specifies when to start
Select mode instead of Visual mode, when a selection is started.
Possible values:
mouse when using the mouse
key when using shifted special keys
cmd when using "v", "V" or CTRL-V
Also check the options listed under :help :behave. You may have turned on :behave mswin, and that causes all such unexpected effects.

Increase the height of Windows native edit control as the user is typing in text

We have a text box which is in fact an instance of the standard native Windows edit control used to enter text. The control was created using CreateWindowsEx without the ES_AUTOHSCROLL flag specified. It implies that word wrapping for entered text is used automatically.
Our goal is to fix the control's width and increase the height of the control automatically as the number of text lines is increased to show all them. An example: by default, the text box is empty. The user starts typing, and as soon as the end of the first line is reached, the text box automatically increases its height by one text line so the last word is put into the beginning of the second line due to word wrap.
How to gain this? Our development environment is VB6, but any WinAPI-based code is also welcome.

Deleting Line of Text Using Xcode Find and Replace

I'm wondering if it's possible to search for a certain line of a text using Xcode's Find & Replace feature, and fully delete the line so not even blank space is left over. Is this possible and if so how?
Copy the line you want to delete, including the newline character at the end of the line by triple-clicking on it (the selection should go all the way to the far right side of the editor pane). Perform a find and replace; paste the line into the the top field, and leave the replace field blank. Click Replace All.
On the latest Xcode you can just insert line break in the search field. Click on magnifying glass icon -> insert pattern -> Line Break

Visual Studio - Scroll AND move cursor

As a preface I'm using ViEmu although I dont think this affects anything. I would simply like to scroll up in the Text Editor along with moving the cursor to the relative screen position.
As an example, if my text editor displays 100 lines of viewable code (1 - 100) and my cursor is on line 20, when I scroll down to the next viewable 100 lines (101 -200) I would like the cursor to be at 120.
Using the VS command Edit.ScrollDown scrolls the code down as expected but leaving the cursor at line 20 instead of moving it to 120. Is there another command to use or any way to alter this behavior?
As noted in the question you seem to be wanting to re-map Page Down to another key (due to limited keyboard).
To identify which command a key is mapped to open the keyboard customisation dialogue and type in the current key into the short key text box and then look at what it is currently mapped to.
Unfortunately this doesn't work for page down (control-page down does work, but that doesn't help here).
Entering "page" into the command filter does: Edit.PageDown is mapped to Page Down in the text editor. Map this command to another shortcut.

Resources