How to set my Nvim cursor as a vertical line in insert mode? - editor

When I'm editing in normal mode in Nvim I get the cursor as a block.
That's fine. However, when I enter insert mode I get the same result.
I want the cursor shape to stay as a line in insert mode, anyone can help me?

It can be modified through guicursor. The default value(n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20) should be fine.

Related

Big Sur TextEdit delete line jumps to start of plain text file

When I delete a line in a plain text file in TextEdit on Big Sur (only), the cursor stays in the correct position, but the window scrolls up to the start of the file. I would expect no scrolling to occur.
To reproduce:
create a new file and convert it to plain text
make it 50 lines long. It can have any content, e.g. 1 character per line
reduce the height of the window to 20 lines, to ensure scrolling can be observed
scroll to end of file
use backspace to delete a line or 2 from near the end of the file.
Observed result: window scrolls to the top of the file
Expected result: no scrolling
Is there any workaround, or a setting that can be changed so that this behaviour is not observed?
The issue appears to be fixed in macOS 11.1 (20C69), released on December 14, 2020.

TRichEdit adds blanks lines when change wordwrap (any recreate property)

The following was found in Embarcardero RAD Studio 10.2. I have not looked at other versions.
If you have a TRichEdit on your form that contains existing text (more than 1021 characters), and change the WordWrap (or any other recreate window) property, then the component will sometimes insert additional blank lines in the middle of your existing text. It appears to depend on where the CR/LF characters land.
To demonstrate the problem, paste the following text into the Lines property of a TRichEdit on a form in Delphi:
01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx78
02xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
03xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
04xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
05xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
06xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
07xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
08xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
09xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
11x456789012345678901234567890123456789012345678901234567890123456789012345678
12xxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5xxxxxxxxx6xxxxxxxxx7xxxxxxxx
13x4567890123456789012345678901234567890123456789012345678901
x
The purpose of the sample text above is to have 1024 characters (counting the CR/LF at the end of the preceding lines) when you get to the last line (the 'x' on its own). What comes after does not matter.
Now, with the above text in your TRichEdit, and still in design mode, toggle the WordWrap property a few times. (The same thing should happen if you set up your form to do it at runtime.) If your Delphi does the same as mine, the last line (the 'x' on its own) will start to separate from the earlier lines as new lines are inserted.
If you change the length of the 13th line - add or remove just one character - the problem seems to go away.
I say "seems to go away" because the 1022/1023 position for CR/LF is not the only sensitive positions. I found more further on (when playing with larger text), but not always on the 1k borders (I think, not studied in detail).
I found the problem with WordWrap, but it happens with any of the properties that recreate the window handle (I think) - certainly BorderStyle does the same thing.
Has anyone else seen this? Is it too much to ask if someone could try the above test in Delphi 10.3 to see if it's fixed?
Probably the only reliable fix (if 10.3 doesn't fix it) is to avoid using TRichEdit, or - and this is my next step for testing the problem - to create and use a derivation that inserts code to save and restore content during handle recreation. Any other ideas?
UPDATE At runtime the problem only happens if the PlainText property is true. At designtime it happens whether that property is true or not.

UITextView textViewDidChange: does not recognize newline character

Trying to increase the size of a UITextView programmatically depending on what text has been inputted into it. The problem is, textViewDidChange: will only recognize new line characters if I input something after inputting them. For example, I'm trying to input the following:
Hi, my\n name is Jimmy.
This is what I'll get if I print this in NSLog in textViewDidChange:
Log: H
Log: Hi
Log: Hi,
Log: Hi, m
Log: Hi, my
Log: Hi, my (here goes the new line, but it's not recognized)
Log: Hi, my
n (it's recognized on this line, only after something is inputted after it).
If I try to input two newlines, only the first one will be recognized and only after I input the second one. Is this some sort of a bug or am I missing something, is there a way to fix this? This used to work properly on iOS 6.
EDIT --
To clarify the problem a bit more, I do get notified that the text has been changed, the problem is the new text is an empty character instead of new line.
EDIT --
It seems that currently the only proper way to find the fitting size for UITextView is by using its sizeThatFits: method while passing it the bounding size. Also if you're changing UITextView's proportions programmatically, it would be wise to remove any autoresizing masks from it.
Works for me on both iOS 6 and iOS 7. Keep in mind that NSLog will sometimes not show new lines at the end of log like you would expect, so try to log something else after textView.text, for example:
- (void)textViewDidChange:(UITextView *)textView
{
NSLog(#"TextView text changed to: \"%#\"", textView.text);
}
If it really doesn't log new lines, then it does sound like a bug that you should report.

Cursor loading issue

I have a few questions about a custom cursor in XNA, because I'm new.
I'm using:
cursorTex = Content.Load<Texture2D>("ico.png");
where cursorTex is a 2D Texture to load the cursor. However, it says file not found - even though it is in my Content directory. What's wrong and how do I fix this?
How can I set onMouseOver on certain buttons to react to change the cursor's image? And also, how do I change the image when the user is holding click?
Load the texture as
cursorTex = Content.Load<Texture2D>("ico");
instead of
cursorTex = Content.Load<Texture2D>("ico.png");
Edit: seeing you placed your file in a folder, just load it as ...<Texture2D>("other/ico");

Set tooltip for an editor

I have the following code snippet for creating an input field for entering colors:
DataSourceTextField colorField =
new DataSourceTextField(ZoneDto.ATTR_COLOR, "*localized name*", 7, true);
colorField.setEditorType(new ColorPickerItem());
colorField.setPrompt("*localized instructions*");
This works quite well, since the input field has the localized instructions in its tooltip, but the small square that opens the color picker window has the original english tooltip ("Click to select a new color").
How could I change this message to a localized one?
Is this even possible to accomplish? I read that setEditorType only sets a template, from which instances are generated whenever needed. This means it's not going to work if I add setPrompt("localized instructions") to the ColorPickerItem given to the setEditorType().
Thanks in advance!
If i get you right, why not fill a variable 'localizedStringForColorPicker' with the current selected localization upon startup. And change it, when another localization is selected?

Resources