Change delimiter on keyevent - vorpal.js

When setting the delimiter via vorpal.delimiter('foo'), it does not update immediately, but waits until a command was submitted.
I'd like to update the delimiter on receiving a keypress event. Is there any way to force the visual change?

As you stated, vorpal.ui.delimiter will induce a temporary change in the delimiter. For a permanent change that redraws right away, do this:
vorpal.delimiter('foo');
vorpal.ui.refresh();

The vorpal wiki went up since I asked this, and it included some additional documentation.
What I needed was vorpal.ui.delimiter rather than vorpal.delimiter.
Working code:
vorpal.ui.delimiter('foo');

Related

How do I have my plugin fire before another in docpad so I can preprocess the content?

I would like to create a plugin which preprocesses content like markdown before it is passed to marked.
I don't want to create yet another extension to tack on the filename but would rather just search for a pattern in the content and if found do a substitution before marked has a chance to render.
I tried using the render event but my plugin seems to fire after marked even though its name sorts below it. What order do the plugins get used in?
I also tried using a renderBefore event but I can't figure out how to manipulate the content from there.
Any help would be appreciated.
Thanks in advance!
Jeff
Adding a plugin.priority will affect the order in which plugins are called with greater priorities being executed first.
The default plugin priority is 500.

Xcode auto completion to replace function call name - how to drop placeholders?

Xcode's auto-completion is often getting in my way by giving me argument placeholders when I already have them. Here's an example:
I want to change that second MoveToPoint to AddLineToPoint, so I delete part of the name, and hit control + space for the Show Completions command. I get something like:
You see the annoyance. I tab complete the name, but now I have to delete the 3 arguments, the commas, and the parentheses. This kind of thing annoys me and throws off my flow when writing code.
Ideally I'd like a way to delete these placeholders with one command, or have a separate auto-complete command, so along with Show Completions (control + space), I could bind something like Show Completions without Placeholders. Does anyone know how to do that?
XCode does support this actually. They call it "Select Previous Completion". Check it out here (under Code Sense).
You essentially just hit ⌃> (hold control and press >) for XCode to choose your previous completion. It think it only works well though if the new method you're calling takes the same number of arguments as the previous one.
Hope this helps

how to skip read command in visual fox pro

i am calling an old vfp procedure through DO WITH PARA COMMANDS
when the command executes, it displays a form and Waits(Read command)
Can i skip this Read, through programing? so that it doesn't wait..
Sounds like a VERY OLD program with an explicit "READ" command... If you just comment out the read, will that work for you. Are you trying to otherwise bypass some functionality based on parameters and just have the function continue? If so, you could put an IF around the read for only the condition that you NEED it to stop.
Also, if the form is a "MODAL" (WindowState = Modal), it will stay on that form until it is closed (or set to hidden) and returns back to calling source to continue execution.
Showing some context of the form, procedure might help other options.

can I edit Xcode code completion suggestions?

I love the code completion in Xcode, it saves me a lot of typing work. Also, it confirms my code is probably error-free in real time. However, to me, some code suggestions are disturbing. For example, when I type else after an if-statement, Xcode suggests this:
else {
statement
}
I'd like to change this to just:
else
statement
Because, I quite often just want to use one line of code there, and adding curled brackets goes much faster than removing them. The other annoying thing is the fact that using such a suggestion takes the return key, while a new line does as well. So, if I would want to use my preferred way as shown above, I would first have to press the escape key in order to stop Xcode suggesting it, and then press the return key. Not a real pain, but I think it's unnecessary.
There are some other code suggestions which I would like to change, but I think I have made my point already. Is there a way to change these code suggestions? I know Apple doesn't provide an easy way within Xcode itself, but I'm willing to dive into the finder for the file with suggestions and change it manually. Thanks!
in your example, it would work to add a space after typing else. Doing that removes the brace suggestion and you can just hit enter.

How to simulate pressing enter in html text input with Selenium?

In a web interface, I've got a text field. When user enters text and accepts with enter, application performs an action.
I wanted to test the behavior with Selenium. Unfortunately, invoking 'keypress' with chr(13) insert representation of the character into the field.
Is there a way other then submitting the form? I'd like to mimic intended user interaction, without any shortcuts...
This Java code works for me:
selenium.keyDown(id, "\\13");
Notice the escape. You probably need something like chr(\13)
I ended up using selenium.keyPress(id, "\\13");
Though I haven't tested this I imagine you can use "\r\n" appended to a string to simulate a new line. If not look for the languages equivalent to "Environment.NewLine;" ?
It's been a while since I've had to do this, but I seem to recall having to use a javascript snippet to execute the carrage return as opposed to using the Selenium keypress function.
you can use
Webelement.sendkeys(Keys.Enter);

Resources