How can I create a single line editor? - ace-editor

I want to replace an input field with an ACE editor.
So what I need to do is to disable return/enter keys and remove all commands that create a nested popup (like find/replace).
I've tried to set the maxLines option on the renderer, but this did not work as expected.

The demo on ace has something similar see
https://github.com/ajaxorg/ace/blob/v1.1.9/demo/kitchen-sink/layout.js#L103
https://github.com/ajaxorg/ace/blob/v1.1.9/demo/kitchen-sink/demo.js#L210-L221
It sets maxLines, removes some commands and adds override for enter

Related

When I want add a text to a script in Unity it doesn't accept to add it

enter image description here
When I want add a text to a script in Unity it doesn't accept to add it. Help
Check that you used the right type. If you created, for example, TextMeshPro in your UI you should use the same type within your script.

RichEdit20A line selection mode similar to Notepad

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.

Weird Fish Prompt

I am using fish as my primary shell; along with oh-my-fish
Now the first character on the fish prompt is really weird [I] as shown in the picture
Kindly help me get rid of the character.
This is the vi mode indicator. It shows that you are using vi key bindings, and are currently in insert mode.
If you don't want to use vi bindings, and instead use the default (emacs) style, you can run fish_default_key_bindings to switch back.
If you want vi key bindings, but want to hide the mode indicator, you can define the fish_mode_prompt function as empty, and then save it:
> function fish_mode_prompt ; end
> funcsave fish_mode_prompt

Sublime Text disable goto animation

When using the goto function to bring my cursor to a particular line number, say 3017, how do I prevent Sublime from jumping around from line to line until I hit enter?
For instance, in that case, I would jump to the following lines:
3
30
301
3017 (finally)
Sublime Text 3 seems to have two "Goto Line" features:
one which is built in via the "Goto Anything" overlay. Internally, the command to execute this is show_overlay with the arguments {"overlay": "goto", "text": ":"}. This is the default, available from the Goto menu -> Goto Line, and with keybinding Ctrl+G. MattDMo is correct in his answer that it is not possible to disable fuzzy matching in this overlay.
one which is included in the "Default" package as a plugin and shows a small prompt panel at the bottom of the screen. Internally, the command to execute this is prompt_goto_line, with no arguments necessary. This implementation has the behavior you desire, and will only go to the specified line when you hit the enter key. It has no default way of accessing it, but read on... :)
The reason I have mentioned the internal commands above is because Sublime Text makes it possible to add or override keybindings, and also to change or add menu items, and the commands are used to instruct Sublime Text what action to perform.
Therefore, this means that you can choose to override the existing menu item and/or keybinding, (and/or you can create a new menu item and/or keybinding) to use the prompt_goto_line command. The two links I have just provided should give enough detail on how to perform these tasks, but if you would like more specific information, please let me know in a comment and I will provide it.
This feature is by design, and cannot be disabled. Most popup menus in Sublime feature "fuzzy matching", meaning you do not need to type the full search term, just a few letters (for example, pci finds Package Control: Install Package in the Command Palette). The menus also feature instant searching, which is what you are seeing. This means that you do not need to hit Enter to search, just start typing and the matches appear as you type.

ColdFusion Builder 2 custom keyboard shortcut

I would like to know if it is possible to create a custom keyboard shortcut in CF Builder 2 and have selected text retained and placed within the code of the inserted text. Sort of like a custom wrap.
Not quite, but you can create snippets and bind them to some trigger text. Matt Gifford's article on snippets is more useful than the official documentation.

Resources