Clion jumps instead of inserting tab or removing spaces - clion

I'm having a problem with a Clions indention when I use a function with parameters that continue over multiple lines. For example:
example = example_function(param1, param2->param2_2 * param3->param3_2 - param4, TEST_MACRO);
If I know add a new line in front of param3->param4_2 and TEST_MACRO I get:
example = example_function(param1, param2->param2_2 *
param3->param3_2 - param4,
TEST_MACRO);
It looks differently for me than here since I use a tab size of 8. My problem is that if I try to delete a tab in front of param3->param4_2 it works once but the second time all tabs infront are deleted. Also if I try to add a tab infront of TEST_MACRO the cursor instead jumps in front of the first parameter.
I couldn't find anything in the settings and on google and don't know how this feature is called and how it can be turned off. It's driving me crazy. Thanks for any help!

Related

Why is VS Code adding many blank lines at the end of all my files?

I just installed Win 10 1809 on my Dell PC, and it seems to run okay. But the first thing I did was start up VS Code. I wanted to run yarn start for my React project, but I had to type it way down in the terminal window, while the prompt was at the top. It worked though.
And when I open any project file, there seems to be approximately 100 blank lines appended at the end of each. But the line numbers don't go down that far and the cursor stops at the last line number. But the scroll bar acts as if those blank lines are there.
So I'm guessing the same number of blank lines are being added to the terminal too. But in the terminal window, the cursor is positioned at the bottom of the scrollable window.
What's going on? Is there a fix?
EDITED:
I see that I can scroll the file's window up until the cursor and last line is at the top, but no further, regardless of the window size. Maybe this has always be the case, and I never noticed. But now because of my terminal problem, I am suspicious of everything and checking for any abnormalities. So I don't think that extra blank lines are being added to my files. Sorry for the mistake.
But the terminal problem persists. The screen clip below shows the terminal display after I enter "yarn start". The typed input shows up way down from the initial prompt, and the blank area is a long string of "0D0A" characters. Sometimes I can click on "kill Terminal" and then start a new one and the new one works correctly. But not always.
Still trying to figure this out.
Can you share snapshots for your problems?
This is some hint for your problem
In VS Code, type
Linux / Windows: Ctrl + Shift + P
MacOS: Cmd + Shift + P
Type Settings to go Settings
At settings, search end of file, at here you can configure something for your problem with auto append blank lines each file
I hope it will help you :)
Your Terminal Problem is described as Bug in VS Code Issues.
As of July 2019 the intergration is pending due to stability problems.
https://github.com/Microsoft/vscode/issues/57803
Addendum (August 2019):
The Problem seams to be fixed with VS Code 1.37.1 and Windows 10 Patchlevel 1903
Did you try uninstalling and reinstalling?
Going back to your questions.
What's going on? No idea.
Fix. Use this extension https://marketplace.visualstudio.com/items?itemName=rintoj.blank-line-organizer
or
Open Visual Studio project and collapse all the folder and make it handy.
Now press ā€œ Control + Shift + H ā€œ key combination and you can see the Popup which shows Find and Replace options.
In the Find place input ā€œ^&\nā€ combination and select Use Regular Expression checkbox without fail as this input will mainly work with the regular expressions only.
In the replace field leave it empty so nothing will be replaced rather remove the empty blank lines.
In the input Find field we have give ^ for Start of the line and $ for end of line and \n which is for new line break.
source for second solution: http://www.f5debug.net/post/2015/01/03/How-to-remove-Blank-lines-between-codes-in-Visual-Studio-Code-editor.aspx
The extension will be useful overall especially when working in a team project where a lot of people might be leaving too many empty lines. Good luck

RStudio tab functionality working differently

On my desktop computer, tab quickly moves a comment or command across over 4 spaces in rapid succession. On my laptop, tab brings up a message that says "(No matches)", then when I hit tab again, it moves 4 spaces, then another message, then another 4 spaces. I cannot quickly move text to the right. I imagine this is a setting I can turn on and off but I cannot figure it out.
I am using 0.99.903
Odds are you need to tweak two settings:
Insert spaces for tab
Use tab for multiline autocompletions
You can find each in the Global Options pane:

Set Value for ace editor without selecting the whole editor

So you can set value of an ace editor with setValue but after setting the value, the editor will select the whole value of the editor. How do you disable this? This mean when I set value of ace editor to Hello world, it won't highlight Hello world
You can use the second parameter to control cursor position after setValue
editor.setValue(str, -1) // moves cursor to the start
editor.setValue(str, 1) // moves cursor to the end
You can even use clearSelection() after you do an setValue();
editor.setValue("Hello World");
editor.clearSelection(); // This will remove the highlight over the text
I'm not sure if editor.setValue() is a remnant from the old days or what, but the proper way to set an editor's content is
editor.session.setValue(text);
or
editor.getSession().setValue(text);
This will NOT select the text, so there's no need to do any of the things mentioned on this page.
editor.setValue() explicitly selects all (and forgets to unselect it); but there's no reason to use it.
This works for me!
editor.setValue(editor.getValue(), 1);
I've been having your same issue.
Even though you can set the second parameter to either 1 or -1, I think you should also check this: https://ace.c9.io/api/editor.html#Editor.setValue
Editor.setWrapBehavioursEnabled(Boolean enabled)
Use this right after creating the editor.
This works very well for me.
The difference between this method and the one shared by a user is that the caret's position is not changed, you can move it yourself using Editor.selection.moveTo(row, column), this way the user won't experience weird caret position changes when using, say, CTRL+Z to undo an action :)
var prevtext = $("#editor").val();
prevtext = prevtext + "<br/>";
$("#editor").val(prevtext).blur();

Change hard-coding number along all my code

I have to take some long code that I wrote when I didn't know too much and change all the hard-coded numbers to something else .
The numbers are positions on screen, and now I need to make them relative to screen size.
So every 160 on code should turn into winSize.width/2, and 80 = winSize.width/4.
Is there a simple way to do that in Xcode?
Press
Command+F
when you are ion the file which needs changes.
You will see a bar at the top. On left side there is Find written. Click on it. Yoy will get an option Replace.
Choose Replace.
In String Matching write 160.
In below filed write winSize.width/2. Click on Replace All button.
Do it for value 80 as well.
Or Right Click -> Refactor... -> Rename also works as well as F&R. It gives you an automatic diff like preview of the changes as well, which I think F&R does but you have to click an additional button to get at it.
You can use the Find and Replace from the Project Navigator view

Xcode Return key places cursor in middle of line

In Xcode 3.2.5 I hit Ctrl + L to center the content (just testing out some shortcuts) and now whenever I hit Return, the cursor starts in the centre of the next line, instead of at the beginning. (Almost like an invisible tab stop in Pages)
How do I get my normal Return functionality back?
I had the same problem and was able to fix it like this:
Xcode>Preferences>Indentation>Syntax-aware-indenting>automatically indented characters: UNCHECK RETURN box.
Apply
This worked for me, otherwise it would always position cursor in the middle of the new line.
For me, I forgot to close a parentheses.

Resources