Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Fixes for use with React editor - #235

Merged
benogle merged 6 commits into
masterfrom
bo-tues-fixes
Jun 11, 2014
Merged

benogle merged 6 commits into
masterfrom
bo-tues-fixes

Conversation

@benogle

@benogle benogle commented Jun 11, 2014

Copy link
Copy Markdown
Contributor

There were a number of issues with the react editor. Most of them were related to the marker views.

There is one left, and I cant figure out what is happening:

  • open 2 files
  • open find, search for something common in both files
  • it should show the marker views (highlights around results)
  • switch to the other file -> no marker views are shown
  • now move the cursor -> marker views show up! WTF
  • really you can even unfocus from the editor, and they will show

marker-view-issue

So all the nodes that need to be in place are there. And by the looks of it nothing changes on those nodes when the cursor moves. Seems like it shows them when EditorComponent::render() is called. @nathansobo any ideas?

I'm ok with marker views sucking a little right now. I'd rather not put any more time into these and instead add them to core and get rid of all this junk.

Fixes #232

benogle added 6 commits June 10, 2014 12:25
You could

* focus replace box and enter replacement
* hit enter in replace box to do the replacement
* it would focus the find box

Frustrating, but fixed.
It was no longer highlighting the current find result
This was broken by the react editor not emitting the dom event for 
selection changes.

refs #232
When you’d split-open a file, the react editor wasn’t attached or 
rendered yet. So there was no under layer, and when you’d try to request
a display update, it would call functions on objects that weren’t there.

So I hack this with a delay. This is not a pretty fix. It will all go 
away when there are marker views in core.

refs #232
* open fnr
* run a search
* split a file
* close the split
* no more search markers ever!

When a pane was destroyed, it would remove the .search-results node
with it. This would call the FindResultsView.unsubscribe() fn which 
would unsubscribe it from all marker changes. 

refs #232
@nathansobo

Copy link
Copy Markdown
Contributor

I'd be interested in adding marker highlight decorations now and using those for the React editor rather than the old rendering to just completely work around this problem. I'm reluctant to sink a lot more time into fixing this stuff rather than just fixing the problem once and for all. The only question is how easy it will be to use the different API conditionally while we're supporting both editors.

@benogle

benogle commented Jun 11, 2014

Copy link
Copy Markdown
Contributor Author

I'm with you. I actually think it's in a state where we can ship without the marker decoration highlights for now. When we rip the old editor out, we can add the marker decoration highlights. What do you think about that? There is the weird issue in the gif, but I think it's fine for a bit.

@nathansobo

Copy link
Copy Markdown
Contributor

I'm somewhat inclined to add the marker view stuff before we flip the switch so package authors have another tool in their arsenal for fixing any breakage they encounter. It sweetens the deal on the switch.

@benogle

benogle commented Jun 11, 2014

Copy link
Copy Markdown
Contributor Author

Ah, yeah, that makes sense.

I'm going to merge this

benogle added a commit that referenced this pull request Jun 11, 2014
Fixes for use with React editor
@benogle
benogle merged commit b5dbb8b into master Jun 11, 2014
@benogle
benogle deleted the bo-tues-fixes branch June 11, 2014 16:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with React editor

2 participants