Comments (1)
There are 2 types:
- Search and replace within a document
- Search and replace within a project
1. Search and replace within a document
UI
- Input Boxes: Search box, replace box
- Buttons: Replace, Find & Replace, Replace All, Switch to Project Search
Approach
-
Create the UI in qml
-
Whenever a keypress happens, the "Find" action is triggered
-
When "Find" is triggered:
-
Create and use
lveditor/DocumentHandler::findText
to find the text for the document-
If the search text is different than the previous search text:
- Clear the previous highlighting model
- Search the text and create the new model
- Reghighlight the doucment with each of those sections
-
Return the next index
-
-
Place the cursor on the index of the next highlight
-
-
When "Replace" is triggered:
- Create and use
lveditor/DocumentHandler::replace
to replace the cursor index of the document
- Create and use
-
When "Find & Replace" is triggered:
-
Create and use
lveditor/ProjectDocument::replace
to replace the cursor index of the document -
Return the next index
-
Place the cursor on the index of the next highlight
-
-
When "Replace all" is triggered:
-
Create and use
lveditor/ProjectDocument::replaceAll
to replace all the instances -
Clear all highlighting
-
2. Search and replace within a project
UI
- Input Boxes: Search box, Replace Box
- Buttons: Find, Replace All
Approach
-
Create the UI in qml
-
When "Find" is triggered:
-
Create and use
lveditor/Project::findText
to find the text in the project, a ListModel with the items
is returned. The ListModel contains the path to the file, then the findings in the
file, like line number, offset and fragment with the actual text -
The model is displayed as a List of files and when collpsed, the findings are displayed
-
-
When "Replace all" is triggered:
-
Use
lveditor/Project::replaceText
to replace the text in the project -
Clear the current model
-
from livekeys.
Related Issues (20)
- Add module indexing.
- Horizontal and vertical scrollbar missing.
- [OT] browser and congrats HOT 3
- Project ERROR: opencv4 development package not found
- Cannot get running on Ubuntu 20.04 HOT 1
- Add package manager.
- Add an advanced code assist box. HOT 1
- Review naming for classes, imports and namespaces.
- Segmentation fault when trying to edit property
- qmake Plugin Path in plugin.pri
- Use ArrayBuffer to access mat data
- Add pan and zoom component.
- Create ItemStream
- Create WindowCapture
- Has it been tested in mobile? HOT 3
- lcvcore plugin HOT 2
- Module not installed HOT 3
- Linux Standalone Install link gives 404 HOT 2
- Add Documentation within Editor
- Add support for loading multiple palettes into view. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livekeys.