Getting ideavimrc shortcuts to work in visual mode with multiple lines selected - intellij-idea

I'm editing my .ideavimrc to emulate spacemacs-like key bindings in IdeaVim. This is working well for the most part, but when I try to apply this to a multi-line selection it just applies the action to the last line.
Minimal example:
let mapleader = " "
nmap <leader>cl :action CommentByLineComment<CR>
vmap <leader>cl :<Backspace><Backspace><Backspace><Backspace><Backspace>action CommentByLineComment<CR>
When I comment one line in insert mode it works great, but when I select several lines it just applies the comment to the last line. I assume it's losing the selection along the way, is there any way to get this to work?

That action isn't implemented by ideaVim, and is (I assume) unlikely to be implemented since IntelliJ already has this functionality.
Open "Preferences", select "Keymap" and search for "Comment with Line Comment", and set the hotkey to whatever you want. Admittedly, you'll have to use another keybind than <leader>cl, but this does work with multiple lines selected in visual mode.
If you require a vim solution, you'll have to vote for it on youtrack, as the commenter suggested.

Related

Problem with line breaks in PDF document generated by BIRT

I have some cell texts in a BIRT report which do not flow as nicely as I hoped.
For example,
The text is Long value resultwithaverylongname whichcannotbreak and I had hoped that it would be displayed like this:
Long value
resultwithaverylongname
whichcannotbreak
The render options are as follows:
renderOptions.setOutputFormat(IPDFRenderOption.OUTPUT_FORMAT_PDF);
renderOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);
renderOptions.setOption(IPDFRenderOption.PDF_TEXT_WRAPPING, true);
renderOptions.setOption(IPDFRenderOption.PDF_WORDBREAK, true);
It seems to me that my desired output is physically possible but I don't know why BIRT does not break on a whitespace and breaks in the middle of the word.
I am using BIRT 4.16 (from Sourceforge). The texts contain normal whitespace (no non-breakable spaces) and are displayed via a data object.
3.Sep.21
I now have an example project which I am trying to commit to Github. In the meantime here is a screenshot showing breaks which look good and others which are not...
The git repo is here: https://github.com/pramsden/test.wordbreak
If the text "resultwithaverylongname" physically fits, then you are right:
BIRT should not break it in the middle of the word.
Your renderOptions seem right (depending of what BIRT version you are using).
At first glance this looks like a bug.
But: In German language, we often have quite long words, and I've created a lot of (complex) PDF reports with BIRT, but I never saw this issue.
So I guess it is a tiny silly detail which causes this.
Just to double-check:
Are the spaces between "Long", "value", "result..." normal spaces (0x20)? or non-breaking spaces?
Which BIRT release are you using?
Are you using a data item or a dynamic text item and if so, is it HTML or plain text?
Can you create a reproducible simple test case and post the rptdesign file somewhere?
well i don use BIRT , but try to use (\n),
in my case I use PDFFlow library to generate pdf docs, and to make a line-break i just use \n
this is a simple example code to create a pdf file and use line break
var DocumentBuilder.New()
.AddSection()
.AddParagraphToSection("Hello world! \n go to the next line")
.ToDocument()
.Build("Result.PDF");
try it and tell me if it works

Scripts connected to an Image in EggPlant

I have LoginButton.png that is being used across the whole suite in different scripts. I want to edit the name or move it to a new folder, without breaking all the scripts. So is there a way to list all the scripts that are using this image or to refactor the name/path across the whole suite?
Find option (Edit>Find) it's the closest to what I want, but it only looks at the open script, not the whole suite, and replaces anything with similar naming convention eg: Find "LoginButton" and replace with "NewButton", if you have "LoginButton", "LoginButton1", "LoginButton2" after the replace you will end up with "NewButton", "NewButton1", "NewButton2", and i just want to change "LoginButton" not "LoginButton1" and "LoginButton2".
Thanks
Unfortunately, you've found the closest solution. One of Eggplant's major drawbacks is that you're locked into a single, (rather feature-less) IDE. If you're having issues matching other words with your search query, you can try including spaces, i.e. " LoginButton ", on the outside of the word.

verifyText using *text* instead of verifyTextPresent (deprecated)

I'm kind of new to selenium IDE and automated test and I don't know much about programming languages. I have a question concerning verifyText command as verifyTextPresent is deprecated. If I put the target word/text in * * will it work as if I was using verifyTextPresent? Could waitForText work?
I am trying to verify that the search function of a website is working as expected. I search the word "client" and I want to verify that the word is present in the results.
clickAndWait css=div.cf-tooltip-text
type id=edit-global-search client
clickAndWait id=edit-submit-global-search
verifyText id=content-column *client*
This works, but in the Log I can not understand what it really does. Also if I try the word on its own "client" I get an error which I understand because it compares it to the text of the whole column. I also tried to put an irrelevant word between asterisks such as youwillnotfindthetext (just to make sure that everything between asterisks will pass the test) and there I had an error too.
So it seems to be working somehow but I want to ask some of you expert guys.
Thanks
If you put a * in starting and ending means it will look for the inner text containing in the specific element. If a text is present as you given in the script it will return a pass. If the text u specified in the script is not present, it will throw an error. That's what happens when you put youwillnotfindthetext in between the *.
Check this link Selenium: test if element contains some text

Copy language content to another

I'm on IP 4.0.11.
Is it possible to copy all content of a language to another (ie to edit only texts and not style or html)? Is there an option or perhaps in database?
Thanks in advance.
At this time you can only copy pages. In your case I'd do like this:
Create a new language.
Create same menus in new language (same name and alias).
Then go to an original language.
Select page (copying parent copies children, too)
Click "copy" icon.
Go to a new language.
Select required menu.
Click "paste" icon.
Repeat 3-8.
It's a bit of manual work, but it's a fool-proof. It shouldn't take you very long. Changing a database may create many errors.
Thanks for answer, Audrius. This works fine with one caveat: The pages pasted into the new language still gets prepended with the old language's language prefix.
Example: copied english page "home" to Norwegian and set the url to "hjem". The new page now got the url /en/hjem instead of no/hjem as expected.
I'm on 4.0.16. Thankful for any hints.
Update May 21st:
Did some debugging. Apparently there is nothing in the code of Ip\Internal\Pages copySinglePage() that cares about changing the $copy['languageCode'] for the new page to be inserted.
Line 93 and onwards (referring to 4.0.16):
unset($copy['id']);
$copy['parentId'] = $newParentId;
$copy['pageOrder'] = $newIndex;
$copy['urlPath'] = UrlAllocator::allocatePath($copy['languageCode'], $copy['urlPath']);
whereas I'd also expect some logic setting
$copy['languageCode'] = something;
Hope this reaches the developers

Formatting output so that Intellij Idea shows diffs for two texts

I would like to be able to print in the logs a message for which intellij idea would present a nice way of comparing two objects (strings). This happens automatically for the error message logged by a failed junit assert:
assertEquals("some\nString", "another\nString");
=>
org.junit.ComparisonFailure: <Click to see difference>
at org.junit.Assert.assertEquals(Assert.java:123)
at org.junit.Assert.assertEquals(Assert.java:145)
at com.something.DummyTest.testDummy(DummyTest.java:89)
The <Click to see difference> entry is actually displayed as a link in the output window of the Intellij Idea. When you click on the link, a compare window opens which shows the two values (just like you would compare two files).
Simply throwing an exception is not acceptable because I would like to log multiple objects to compare. I already tried logging a text, but I wasn't able to convince idea to compare the two texts.
IntelliJ IDEA is using the hardcoded regular expression. If the text matches the pattern, it will suggest to click to view the difference.
The pattern is:
expected:<bla-blah> but was:<blah-blah-blah>
Output should match the format of assertEquals or assertThat.
The exact patterns are somewhat scattered around the code in IDEA, but some are e.g. here.
I had the same Problem and found the solution in https://github.com/joel-costigliola/assertj-core/issues/1364#issuecomment-440800958
You should throw an org.junit.ComparisonFailure. Then IntelliJ will display the <Click to see difference>