Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Inline editor incorrectly updates visual range when preceding line is deleted #493

Closed
jasonsanjose opened this issue Mar 27, 2012 · 5 comments

Comments

@jasonsanjose
Copy link
Member

  1. Open this project https://gist.github.com/b045aac6ba362b4f0974
  2. Open index.html and open an inline editor at <div>
  3. Open styles.css
  4. Place cursor at line 4, Shift+ArrowDown, then delete to fully delete line 4 and the trailing line break

Observe the inline editor for styles.css is hiding the first line of the CSS rule. Also Editor._visibleRange returns [5,6] instead of [4,6]. See xit test in InlineEditorProviders-test "should sync deletions from the full editor and update the visual range of the inline editor"

jasonsanjose added a commit that referenced this issue Mar 27, 2012
@peterflynn
Copy link
Member

I believe this is the issue that user story task 2.6 is meant to address ("Handle edge case where entire rule or beginning of rule is deleted")

@njx
Copy link

njx commented Mar 29, 2012

Yup. Fixing as part of 2.6. To be clear, the "fix" is to collapse the inline editor, rather than to update its visible range. I'll update the unit test.

@njx
Copy link

njx commented Mar 29, 2012

Hmmm, actually, this is a real bug that won't be fixed by my fix. The issue is that even though the deletion crosses over onto the first line, it isn't deleting any content from that line (just the newline before it), so we should just fix up the start of the range. I'll fix it during this task.

@peterflynn
Copy link
Member

Fixed by pull #508

@jasonsanjose
Copy link
Member Author

Confirmed fixed. Inline editor now closes when deleting this range.

gideonthomas pushed a commit to gideonthomas/brackets that referenced this issue Aug 31, 2017
* Using CSSProperties to check if any rule is of type color

* === instead of ==

* Removed unnecessary console log and remaned cursorLine2 to cssPropertyName

* Added CSSProperties.json file

* Changing include syntax of CSSProperties.json file

* Lots of improvements

* Renamed CSSProperties.json to ColorProperties.json and removed all non-color styles

* Added a default color value which would be returned when the first style of type color is written

* Added some comments, used try-catch while including files, checked if cssPropertyName is non-null and renamed some variables

* Restored the original color picker logic and modified the logic for checking css rules of type color

* Removed the hashPos variable

* Writing the default color value to a new css rule of type color and handling the case of empty color string for a css color rule

* Modified logic with color value check

* Removed 'type: color' from ColorProperties.json and made some small changes

* Using the replaceRange function of codeMirror instead of the setLine function
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants