Page MenuHome

Horizontal Find & Replace for the Text Editor
AbandonedPublic

Authored by Peter Fog (tintwotin) on Aug 13 2019, 6:04 PM.

Details

Summary

In conversation with @William Reynish (billreynish) we found a way to make the Find & Replace a horizontal function, like most modern IDEs, by moving it into the Text Editor footer:

Gif:

This patch removed the F&S in the sidebar and assigns Ctrl + F to the new operator.

If the toggle operator should be moved into a Pyhon operator, I would need help doing that. I mean in this folder(but currently there is no Text Editor python operator file):
blender\release\scripts\startup\bl_operators

Also I need help to switch it off as default.

Diff Detail

Event Timeline

Peter Fog (tintwotin) edited the summary of this revision. (Show Details)Aug 13 2019, 7:08 PM
  • The text field is no longer active upon pressing Ctrl-F.
  • If you want to enable wrap for Ctrl-G (next selected). There is no longer an obvious way to do this.
  • If you're finding long words, the text fields are quite small and there is no way to make them bigger.
  • This removes use of iface_ for translating File.
  • There is no reason to add this property to the window manager as far as I can see.

I think the main question is if this kind of design is worth pursuing? This is more like a test of concept and in the end of the day, it may not the best idea to actually code the operator in Python ex. with no text.get_selection in the API(for adding selection to find box), and the other things @Campbell Barton (campbellbarton) points out here.

I think it's a good point @Campbell Barton (campbellbarton) has: that the width can't be changed this way. What do you say @William Reynish (billreynish) ?

A major downside however, with the current sidebar implementation is that you need to waste quite a lot of screen estate just for doing Find&Replace.

I think it's a nice overall goal to do it this way, more like dedicated text and code editors. So if the issues can do handled, I do think it makes sense to do something like this.

I think it's a nice overall goal to do it this way, more like dedicated text and code editors. So if the issues can do handled, I do think it makes sense to do something like this.

I don't really agree that this is more like dedicated text editors. In VS Code it is actually more similar to the current implementation. That is not to say, that this would not be an improvement, just for other reasons maybe.

It's also a question of if we really want to use the footer for this. It is a completely new usage of headers/footers in Blender.

Peter Fog (tintwotin) added a comment.EditedAug 14 2019, 8:48 AM

An alternative way would be if the scrollbar was moved to the right of the side bar and the unused part of the sidebar was made transparent, like the 3D View:

And if the search terms are very long the sidebar could be streched out like this and the the coding could continue below the sidebar(which now works as a multiline "topbar"):


(The layout could be restyled to fit this purpose)

For F&R reference:
PyCharm:

VScode:

I think it's a nice overall goal to do it this way, more like dedicated text and code editors. So if the issues can do handled, I do think it makes sense to do something like this.

I don't really agree that this is more like dedicated text editors. In VS Code it is actually more similar to the current implementation. That is not to say, that this would not be an improvement, just for other reasons maybe.

QtCreator also doesn't use this kind of search replace, in fact I've only seen this used in web browsers.

Would prefer this be handled as a design task before going though code review.

Campbell Barton (campbellbarton) requested changes to this revision.Aug 14 2019, 11:05 AM

Setting as requesting changes, although it might be better to close the patch since the design hasn't been agreed on.

This revision now requires changes to proceed.Aug 14 2019, 11:05 AM

Now this patch has been abandoned, who has a better solution, and how/where to discuss it?