Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fleet #973

Merged
merged 34 commits into from
Aug 23, 2024
Merged

Fleet #973

Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e038356
Make ExEntryAction public
lippfi Aug 19, 2024
da4cf04
Support <BS> in command mode
lippfi Aug 19, 2024
be859b7
Support <DEL> in command mode
lippfi Aug 19, 2024
98dc35b
Support <C-B>, <Home> in command mode
lippfi Aug 19, 2024
b1d73f4
Support <C-E>, <End> in command mode
lippfi Aug 19, 2024
22b5998
Support <C-H> in command mode
lippfi Aug 19, 2024
52f8458
Support <Left> in command mode
lippfi Aug 19, 2024
5d3e59b
Support <Right> in command mode
lippfi Aug 19, 2024
900eece
Fix unwanted beep when can't perform an action
lippfi Aug 19, 2024
5f52959
Remove swing bindings that are already implemented
lippfi Aug 19, 2024
0bfbac0
Register all shortcuts without references on ExKeyBindings
lippfi Aug 19, 2024
2dee324
Update methods to support searching in any text, not just Editor content
lippfi Aug 19, 2024
f52c02b
Fix failing tests
lippfi Aug 19, 2024
29037c8
Support <C-Left>, <S-Left> in command mode
lippfi Aug 19, 2024
4a01b7a
Support <C-Right>, <S-Right> in command mode
lippfi Aug 19, 2024
ed4169a
Support <C-W> in command mode
lippfi Aug 19, 2024
88d0afe
Support <Insert> in command mode
lippfi Aug 19, 2024
599212e
Remove some old bindings
lippfi Aug 19, 2024
408ee9b
Support history in VimCommandLine
lippfi Aug 19, 2024
c6f12f1
Support <Up>, <S-Up>, <C-P>, <PageUp> in command mode
lippfi Aug 19, 2024
6fe5ce7
Support <Down>, <S-Down>, <C-N>, <PageDown> in command mode
lippfi Aug 19, 2024
e6025e1
Support <C-U> in command mode
lippfi Aug 19, 2024
db5bc29
Save last entry on every command line text update
lippfi Aug 19, 2024
cf872f1
Remove some old bindings
lippfi Aug 19, 2024
4084e8b
Better reset
lippfi Aug 19, 2024
913da58
Add entry to history on <Esc> in COMMAND mode
lippfi Aug 19, 2024
7bcfcd9
Move some Executor logic to its base class
lippfi Aug 19, 2024
05682cb
Fix tests
lippfi Aug 19, 2024
d37ab18
Remove package-info.java
lippfi Aug 19, 2024
f16f76a
Remove currentAction and some unused code
lippfi Aug 20, 2024
f4bca24
Exclude generated files from .gitignore
lippfi Aug 21, 2024
9b347c9
Support more flexible command line restrictions for Fleet
lippfi Aug 21, 2024
71be802
Make closing command line safer
lippfi Aug 22, 2024
0a15d0a
Respect emojis and don't assume that every character is a single offset
lippfi Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for a few days or send it to a friend for testing.
If you are looking for:

- Vim commands (`w`, `<C-O>`, `p`, etc.):
- Any particular command: `package-info.java`.
- Any particular command: `engine_commands.json` + `intellij_commands.json` (this files are generated during compilation, please run `gradle build` to generate them manually).
lippfi marked this conversation as resolved.
Show resolved Hide resolved
- How commands are executed in common: `EditorActionHandlerBase`.
- Key mapping: `KeyHandler.handleKey()`.

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ etc

See also:

* [The list of all supported commands](src/main/java/com/maddyhome/idea/vim/package-info.java)
* [Top feature requests and bugs](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
* [Vimscript support roadmap](vimscript-info/VIMSCRIPT_ROADMAP.md)
* [List of supported in-build functions](vimscript-info/FUNCTIONS_INFO.MD)
Expand Down
1 change: 0 additions & 1 deletion qodana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ exclude:
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/JavaText.kt
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/LoremText.kt
- src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/SimpleText.kt
- src/main/java/com/maddyhome/idea/vim/package-info.java
- vim-engine/src/main/java/com/maddyhome/idea/vim/regexp/parser/generated
- vim-engine/src/main/java/com/maddyhome/idea/vim/parser/generated
- src/main/java/com/maddyhome/idea/vim/group/SearchGroup.java
Expand Down
46 changes: 31 additions & 15 deletions src/main/java/com/maddyhome/idea/vim/group/HistoryGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.history.HistoryBlock;
import com.maddyhome.idea.vim.history.HistoryEntry;
import com.maddyhome.idea.vim.history.VimHistoryBase;
import com.maddyhome.idea.vim.history.*;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -35,21 +33,20 @@ public void saveData(@NotNull Element element) {
logger.debug("saveData");
Element hist = new Element("history");

saveData(hist, SEARCH);
saveData(hist, COMMAND);
saveData(hist, EXPRESSION);
saveData(hist, INPUT);
for (Type type : getHistories().keySet()) {
saveData(hist, type);
}

element.addContent(hist);
}

private void saveData(@NotNull Element element, String key) {
final HistoryBlock block = getHistories().get(key);
private void saveData(@NotNull Element element, VimHistory.Type type) {
final HistoryBlock block = getHistories().get(type);
if (block == null) {
return;
}

final Element root = new Element("history-" + key);
final Element root = new Element("history-" + typeToKey(type));

for (HistoryEntry entry : block.getEntries()) {
final Element entryElement = new Element("entry");
Expand All @@ -67,10 +64,10 @@ public void readData(@NotNull Element element) {
return;
}

readData(hist, SEARCH);
readData(hist, COMMAND);
readData(hist, EXPRESSION);
readData(hist, INPUT);
for (Element child : hist.getChildren()) {
String key = child.getName().replace("history-", "");
readData(hist, key);
}
}

private void readData(@NotNull Element element, String key) {
Expand All @@ -80,7 +77,7 @@ private void readData(@NotNull Element element, String key) {
}

block = new HistoryBlock();
getHistories().put(key, block);
getHistories().put(getTypeForString(key), block);

final Element root = element.getChild("history-" + key);
if (root != null) {
Expand All @@ -94,6 +91,25 @@ private void readData(@NotNull Element element, String key) {
}
}

private String typeToKey(VimHistory.Type type) {
if (type instanceof VimHistory.Type.Search) {
return SEARCH;
}
if (type instanceof VimHistory.Type.Command) {
return COMMAND;
}
if (type instanceof VimHistory.Type.Expression) {
return EXPRESSION;
}
if (type instanceof VimHistory.Type.Input) {
return INPUT;
}
if (type instanceof VimHistory.Type.Custom) {
return ((Type.Custom) type).getId();
}
return "unreachable";
}

@Nullable
@Override
public Element getState() {
Expand Down
718 changes: 0 additions & 718 deletions src/main/java/com/maddyhome/idea/vim/package-info.java

This file was deleted.

263 changes: 0 additions & 263 deletions src/main/java/com/maddyhome/idea/vim/ui/ex/ExActions.kt

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/com/maddyhome/idea/vim/ui/ex/ExDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ExDocument extends PlainDocument {
void toggleInsertReplace() {
VimCommandLine commandLine = injector.getCommandLine().getActiveCommandLine();
if (commandLine != null) {
commandLine.toggleReplaceMode();
((ExEntryPanel) commandLine).isReplaceMode = !((ExEntryPanel)commandLine).isReplaceMode;
}
overwrite = !overwrite;
}
Expand Down
Loading
Loading