移动和消失代码行;与Eclipse的XML编辑器的麻烦 [英] Moving and vanishing lines of code; trouble with Eclipse's XML Editor

查看:131
本文介绍了移动和消失代码行;与Eclipse的XML编辑器的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我的代码会自动移动,或者直接在Eclipse XML编辑器中消失。

Sometimes my code moves on its own or just disappears in the Eclipse XML editor.

当我突出显示受影响的代码时,突出显示的行会尝试更正自己。但当我滚动或拖动鼠标在相反的方向,代码再次移动。在本质上,我会重复,缺少,虚拟代码的代码是从其他无错误的文件显示的。受影响的文件 do 编译,如果我关闭/重新打开它们,这个问题暂时消失。关于发生什么的任何想法?

When I highlight the affected code, the highlighted lines try to correct themselves. But when I scroll or drag the mouse in the opposite direction the code shifts again. In essence I will have repeating, missing, and broken lines of code being displayed from an otherwise error free file. The files affected do compile and if I close / re-open them this problem goes away, for the moment. Any ideas on what's happening?

添加:
Jeff Axelrod 提供了一个链接到新的错误报告与Google。

Addition: Jeff Axelrod provided a link to a new bug report with Google.

推荐答案

(最后)在ADT 21中修复。该修复程序现在可在ADT 21 Preview 9中发布,几分钟前发布在这里: https://android-review.googlesource.com/#/c/44936/1

This bug is (finally) fixed in ADT 21. The fix is now available in ADT 21 Preview 9, posted a few minutes ago, here: https://android-review.googlesource.com/#/c/44936/1

你得到奇怪的视觉工件的原因是如果一个文件包含破坏的DOS行结尾(多个回车,每个回车没有换行),Eclipse很困惑。这是Eclipse问题 https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421

The reason you get weird visual artifacts is that if a file contains broken DOS line endings (multiple carriage returns without a newline for each carriage return), Eclipse gets very confused. That's Eclipse issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421 .

修复有两个部分:
(1)首先,ADT被修复,使其不再引入这些\r\ r序列到文档中。这样可以确保您不会获得触发奇怪编辑行为的新文档,但是它不会追溯性地修复旧的文档,因此如果您打开它们,您仍然会遇到奇怪的编辑行为。

There are two parts to the fix: (1) First, ADT was fixed such that it no longer introduces these \r\r sequences into the document. This makes sure that you don't get new documents which triggers the weird editing behavior, but it does not retroactively fix older documents with these line endings, so if you open them, you still get weird editing behavior.

(2)第二,有一个新的绒毛检查,寻找文档中的虚线结尾。这会逐步运行,所以如果你编辑一个有这个问题的XML文件,ADT会为这个问题添加一个错误标记 - 以及一个quickfix文件来执行手术以修复它。

(2) Second, there's a new lint check which looks for broken line endings in documents. This runs incrementally, so if you edit an XML file which has this problem, ADT will add an error marker for this problem -- along with a quickfix to perform surgery on the document to fix it.

简而言之:
获取ADT 21 Preview 9;在您的项目上运行Lint,并查找有关包含虚线结尾的文件的任何投诉,如果找到任何内容,请应用该quickfix。从现在开始,布局编辑器的进一步编辑应该保持文件格式一致。

In short: Get ADT 21 Preview 9; run Lint on your projects and look for any complaints about files containing broken line endings, and if it finds any, apply the quickfix. From now on, further edits with the layout editor should keep the files consistently formatted.

FYI,相关修复在这里:https://android-review.googlesource.com/#/c/44936/

FYI, the relevant fix is here: https://android-review.googlesource.com/#/c/44936/

用于轻松更新SDK Tools和Eclipse ADT插件的说明如下: http://tools.android.com/preview-channel

Instructions for easily updating SDK Tools and the Eclipse ADT plugin are here: http://tools.android.com/preview-channel

- Tor
(来自Android工具组)

-- Tor (from the Android tools team)

这篇关于移动和消失代码行;与Eclipse的XML编辑器的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆