1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-08-18 01:31:44 +02:00

Compare commits

..

8 Commits
0.38 ... 0.39

Author SHA1 Message Date
Andrey Vlasovskikh
6752058922 Version 0.39 2014-12-03 16:07:30 +03:00
Andrey Vlasovskikh
b965108dad Updated changelog 2014-12-03 16:06:20 +03:00
Andrey Vlasovskikh
6bf0f36567 Merge remote-tracking branch 'dezgeg/fixes/vim-702-fix-substitute-infinite-loop' 2014-12-03 15:59:43 +03:00
Andrey Vlasovskikh
69f1a70968 VIM-848 Show line numbers if they are enabled in the settings and there is no 'set number' 2014-12-03 15:42:59 +03:00
Tuomas Tynkkynen
47edfcac5e VIM-702 Fix infinite loop on s/$/\r/g
If the replacement contains newlines, the line number of the current
search position needs to be adjusted. Without this, e.g. s/$/\r/g would
get into an infinite loop.
2014-12-03 14:00:31 +02:00
Andrey Vlasovskikh
c34599b954 Updated the changelog 2014-12-01 16:03:12 +03:00
Andrey Vlasovskikh
48b371c985 Don't show line numbers in non-file editors 2014-12-01 15:54:48 +03:00
Andrey Vlasovskikh
47165e7b9d EA-63002 Don't update line numbers in the caret movement event listener
This update may require moving the caret.
2014-12-01 15:54:31 +03:00
6 changed files with 49 additions and 14 deletions

View File

@@ -4,6 +4,19 @@ The Changelog
History of changes in IdeaVim for the IntelliJ platform. History of changes in IdeaVim for the IntelliJ platform.
0.39, 2014-12-03
----------------
A bugfix release.
Bug fixes:
* VIM-848 Show line numbers if they are enabled in the settings and there is
no `set number`
* VIM-702 Fix infinite loop on `s/$/\r/g`
* EA-63022 Don't update line numbers in the caret movement event listener
0.38, 2014-12-01 0.38, 2014-12-01
---------------- ----------------

View File

@@ -1,4 +1,4 @@
version-id:0.38 version-id:0.39
platform-version:135.0 platform-version:135.0
idea.download.url=http://download.jetbrains.com/idea/ideaIU-14.0.1.zip idea.download.url=http://download.jetbrains.com/idea/ideaIU-14.0.1.zip
build.number=dev build.number=dev

View File

@@ -3,6 +3,10 @@
<id>IdeaVIM</id> <id>IdeaVIM</id>
<change-notes> <change-notes>
<![CDATA[ <![CDATA[
<p>0.39:</p>
<ul>
<li>Various bug fixes</li>
</ul>
<p>0.38:</p> <p>0.38:</p>
<ul> <ul>
<li>Support for <code>:action</code> and <code>:actionlist</code> for executing arbitrary IDE actions</li> <li>Support for <code>:action</code> and <code>:actionlist</code> for executing arbitrary IDE actions</li>
@@ -30,18 +34,6 @@
<ul> <ul>
<li>Various bug fixes</li> <li>Various bug fixes</li>
</ul> </ul>
<p>0.33:</p>
<ul>
<li>Support for <code>:map</code> key mapping commands</li>
<li>New keyboard shortcuts handler that doesn't require a separate keymap for Vim emulation</li>
<li>Support for <code>:source</code> command</li>
<li>Support for <code>:sort</code> command</li>
<li>Various bug fixes</li>
</ul>
<p>0.32:</p>
<ul>
<li>Fixed API compatibility with IntelliJ platform builds 132.1052+</li>
</ul>
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p> <p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
]]> ]]>
</change-notes> </change-notes>

View File

@@ -136,12 +136,27 @@ public class EditorGroup {
} }
private void updateLineNumbers(@NotNull Editor editor) { private void updateLineNumbers(@NotNull Editor editor) {
if (!EditorData.isFileEditor(editor)) {
return;
}
final Options options = Options.getInstance(); final Options options = Options.getInstance();
final boolean relativeLineNumber = options.isSet(Options.RELATIVE_NUMBER); final boolean relativeLineNumber = options.isSet(Options.RELATIVE_NUMBER);
final boolean lineNumber = options.isSet(Options.NUMBER); final boolean lineNumber = options.isSet(Options.NUMBER);
final EditorSettings settings = editor.getSettings(); final EditorSettings settings = editor.getSettings();
settings.setLineNumbersShown(lineNumber && !relativeLineNumber); final boolean showEditorLineNumbers = (EditorData.isLineNumbersShown(editor) || lineNumber) && !relativeLineNumber;
if (settings.isLineNumbersShown() ^ showEditorLineNumbers) {
// Update line numbers later since it may be called from a caret listener
// on the caret move and it may move the caret internally
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
settings.setLineNumbersShown(showEditorLineNumbers);
}
});
}
if (relativeLineNumber) { if (relativeLineNumber) {
final EditorGutter gutter = editor.getGutter(); final EditorGutter gutter = editor.getGutter();

View File

@@ -375,6 +375,7 @@ public class SearchGroup {
lastMatch = startoff; lastMatch = startoff;
newpos = EditorHelper.offsetToCharacterPosition(editor, newend); newpos = EditorHelper.offsetToCharacterPosition(editor, newend);
lnum += newpos.line - endpos.line;
line2 += newpos.line - endpos.line; line2 += newpos.line - endpos.line;
} }
} }

View File

@@ -75,6 +75,20 @@ public class SubstituteCommandTest extends VimTestCase {
"one\n.two\n.three\n"); "one\n.two\n.three\n");
} }
// VIM-702 |:substitute|
public void testEndOfLineToNL() {
doTest("%s/$/\\r/g",
"<caret>one\ntwo\nthree\n",
"one\n\ntwo\n\nthree\n\n");
}
// VIM-702 |:substitute|
public void testStartOfLineToNL() {
doTest("%s/^/\\r/g",
"<caret>one\ntwo\nthree\n",
"\none\n\ntwo\n\nthree\n");
}
private void doTest(final String command, String before, String after) { private void doTest(final String command, String before, String after) {
myFixture.configureByText("a.java", before); myFixture.configureByText("a.java", before);
typeText(commandToKeys(command)); typeText(commandToKeys(command));