Is it possible to draw vertical lines in the editor that descend from the start of an indented statement, like in IntelliJ IDEA?
public...
| while...
| |
| | for...
| | |
Or if not natively, is there a plugin for this?
You cannot use vertical bars as indent marker character AFAIK, however, in Preferences > General > Editor > Text Editors, you can enable whitespaces markers, and tabs can be rendered as ยป , well aligned and so on, providing I believe a similar feeling than the | of intellij
Related
When I copy this, for example:
<AdmobComponent/>
It pastes as:
< AdmobComponent / >
Does anyone have any suggestions? I don't even know where to start to fix this.
From within the IDE:
Go to File | Preferences | Settings and then click Text Editor | Formatting.
The top option should be FormatOnPaste, make sure this is unchecked.
If you are using the Prettier extension, then this is a known issue.
For anyone having a similar problem in Visual Studio 2019 it can be fixed as follows:
Go to Tools | Options | Text Editor | {language}
Now depending on the Language the options that need to be changed could be in a few different places or missing. But for C# and JavaScript go to Code Style | Formatting
Once there there are a few options. If "Automatically format on paste" is unticked it will completely remove any reformatting on paste.
Or for a more limited impact go into the "Spacing" section and change "Set spacing for operators" to "Ignore spaces around binary operators". By doing this some automatic reformatting is lost but I think it's worth it not to have all those spaces inserted into stuff like Kebab case variables.
I would like to use Radare2 to learn about how C is assembled into assembly but I am having trouble with the layout. I think the V! mode would be very handy as you can watch the registers update as the instruction pointer moves through the program, but I don't understand the layout.
This is an example of they layout I would like:
It seems when I add a window (like Stack or Registers in this photo) it appears offscreen and I have to try closing different and splitting windows until the layout kind of falls into place. Is there an easy way to change exactly what is in each window?
I know "X" closes a window, "z" switches the current window to the front, and "-" / "|" split a window.
I have tried looking at the help but can't seem to figure out any other commands related to this issue.
ENVIRONMENT
radare2: 4.2.0-git 23712 # linux-x86-64 git.4.1.1-97-g5a48a4017
commit: 5a48a401787c0eab31ecfb48bebf7cdfccb66e9b build: 2020-01-09__21:44:51
system: Ubuntu 18.04.3 LTS
SOLUTION
This problem can be solved in a variety of ways and this is just one example.
To create the layout you have described change the commands shown in the default layout by:
Clicking inside/selecting the panel you wish to change.
Right clicking in the panel and select new command or
Enter "e" then type the new command. (Ex: Registers = dr)
The further documentation shown below can be found here: https://radare.gitbooks.io/radare2book/visual_mode/visual_panels.html
|Visual Ascii Art Panels:
| | split the current panel vertically
| - split the current panel horizontally
| : run r2 command in prompt
| _ start the hud input mode
| ? show this help
| ?? show the user-friendly hud
| ! run r2048 game
| . seek to PC or entrypoint
| * show pseudo code/r2dec in the current panel
| / highlight the keyword
| ( toggle snow
| & toggle cache
| [1-9] follow jmp/call identified by shortcut (like ;[1])
| ' ' (space) toggle graph / panels
| tab go to the next panel
| a toggle auto update for decompiler
| b browse symbols, flags, configurations, classes, ...
| c toggle cursor
| C toggle color
| d define in the current address. Same as Vd
| D show disassembly in the current panel
| e change title and command of current panel
| g go/seek to given offset
| G show graph in the current panel
| i insert hex
| hjkl move around (left-down-up-right)
| J scroll panels down by page
| K scroll panels up by page
| H scroll panels left by page
| L scroll panels right by page
| m select the menu panel
| M open new custom frame
| nN create new panel with given command
| pP seek to next or previous scr.nkey
| q quit, back to visual mode
| r toggle jmphints/leahints
| sS step in / step over
| t rotate related commands in a panel
| uU undo / redo seek
| w start Window mode
| V go to the graph mode
| X close current panel
| z swap current panel with the first one
EXAMPLE
Open visual panels
user#host:~$ r2 /bin/ls
[0x00005850]> aaaa
...
[0x00005850]> s main
[0x00003e90]> V!
Default view after opening visual panels
Select top right panel then right click and select registers
Select lower right panel then right click and select stack
Final view
When I press Enter this happens:
def spend_cash
self.totals[order.type] = if order.cash > 0
// cursor is here
order.cash / order.price
end
end
How do I fix something like this?
I want it inline with order.cash
This area might be the one to experiment with:
Preferences | Editor | Code Style | Ruby
... then try the settings on the Tabs and indents tab to see which works best for you.
It's probably the checkbox Use indents relative to expression start
Is there a way to change the color of this little marker of the occurrence, on the right of the scroll?
Check this: http://www.eclipse.org/pdt/help/html/mark_occurrences.htm (Window | Preferences | General | Editors | Text Editors | Annotations - Occurrences), but it seems it also changes the color of the hightlighted text.
I am having problems correctly aligning my content in DecoratorPanel in GWT.
Using the following code snippet, all the content appears to be vertically aligned to the middle (?)
DecoratorPanel decor = new DecoratorPanel();
decor.setHeight("100%");
decor.add(new Label("Test"));
Diagram to explain:
-------- --------
I get this: | | I want this: |test |
| | | |
|test | | |
| | | |
| | | |
-------- --------
I have tried decor.getElement().getStyle().setVerticalAlign(VerticalAlign.TOP);, but it does not seem to affect anything.
How do I align the content to the top of the panel?
Update:
I have notice that if I use a LayoutPanel instead of a DecorPanel everything seems to align properly.
Could the problem be that I am using regular Panels with LayoutPanels? If so, why am i having problems?
A DecoratorPanel uses a HTML table, while the other use a div. So with the DecoratorPanel you set the vertical style on the table element instead of the content, which explains what you see and a reason for not to use this panel. So you either should use a div based panel or set the alignment on the label or the td (which is label.getElement().getParent(), but that's a bit ugly and prone to future bugs).
Get the td element.
... . getElement().setStyleName("myStyle");
Then in your css
.myStyle td{
vAlign : centre;
}
DecoratorPanel is 9-box panel which is used to place images around, specially for rounded corner effect of widgets it mostly useful, there is a a cells around you widget when you set 100% it might be applying some width and height of all cells you are seeing the label in center.