mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
if editor has selection, reformat only selected lines, when reformat dialog is not shown. Do not take into account processChangedText flag
This commit is contained in:
@@ -174,7 +174,7 @@ public class ReformatCodeAction extends AnAction implements DumbAware {
|
||||
}
|
||||
|
||||
final TextRange range;
|
||||
if (!processWholeFile && editor != null && editor.getSelectionModel().hasSelection()){
|
||||
if (!processWholeFile && hasSelection) {
|
||||
range = TextRange.create(editor.getSelectionModel().getSelectionStart(), editor.getSelectionModel().getSelectionEnd());
|
||||
}
|
||||
else{
|
||||
@@ -185,7 +185,7 @@ public class ReformatCodeAction extends AnAction implements DumbAware {
|
||||
new OptimizeImportsProcessor(new ReformatCodeProcessor(project, file, null, processChangedTextOnly)).run();
|
||||
}
|
||||
else {
|
||||
new ReformatCodeProcessor(project, file, range, processChangedTextOnly).run();
|
||||
new ReformatCodeProcessor(project, file, range, !hasSelection && processChangedTextOnly).run();
|
||||
}
|
||||
|
||||
if (rearrangeEntries && file != null && editor != null) {
|
||||
|
||||
Reference in New Issue
Block a user