Qownnotes: Feature request: use QScintilla

Created on 8 Nov 2019  ยท  23Comments  ยท  Source: pbek/QOwnNotes

Pros & Cons

Pros

  • IMHO, QScintilla is the most powerful editor for Qt
  • multiple cursors (#766)
  • code folding
  • highlighting all founded occurrences
  • and more features ...

Cons

  • More work
  • Increase the number of dependencies
  • Increase the size of binaries
Low Support

Most helpful comment

What's problem?

E.g. sqlitebrowser uses QScintilla with three lexers only.

Using Scintilla means we have to re-implement all of Markdown highlighting.

Scintilla has Markdown lexer.

Imagine building a house and after 3 years you decide to change the base of the house for some reason. How would that go? The whole house will have to be demolished for the base to be changed and then reconstructed afterwards.

The text editor is the beating heart of this application. If we take it out or try switching, QON is definitely gonna get some huge shocks.

This is severely out of scope.

All 23 comments

Thank you for your suggestion, so far I've seen no clues that QScintilla is available for C++: https://qscintilla.com/#intro/installation

More work

You have no idea how much work that would be to make it run on all platforms with qmake and cmake and how much of the current functionality that would break (starting with the most recent spellchecker)!

Pros & Cons

Pros

* IMHO, QScintilla is the most powerful editor for Qt

* multiple cursors (#766)

...

QScintilla/ Scintilla is indeed very powerful and fast. However there are some problems, one of which @pbek already mentioned.

  • With all it's power and speed, it doesn't have the kind of syntax highlighting QMarkdownTextEdit has. Using Scintilla means we have to re-implement all of Markdown highlighting.
  • Multiple cursors may not be an important thing in QON because at the end of the day it's a plain text note taking app and note a code editor.

    • Spellchecking is another thing which will have to be reintegrated, and it's going to be a ton of work. Right now we use regex based parsing and highlight stuff block by block. While its not the most accurate and fastest solution, but it's getting the job done and it is quite stable and matured now. Scintilla as far as i know uses lexers, a LOT of things will require to be readjusted to work with that.

I think it's better to stick with what we have and try to make it even better and faster.

Even Kdevelop / Qtcreator is using QPlainTextEdit. It does the job quite well.

... not even to talk about all the editing capabilities that were added to QMarkdownTextEdit and QOwnNotesMarkdownTextEdit

Thank you for your suggestion, so far I've seen no clues that is available for C++

https://www.riverbankcomputing.com/software/qscintilla/download

You have no idea how much work that would be to make it run on all platforms with qmake and cmake

What's problem?

E.g. sqlitebrowser uses QScintilla with three lexers only.

Using Scintilla means we have to re-implement all of Markdown highlighting.

Scintilla has Markdown lexer.

What's problem?

E.g. sqlitebrowser uses QScintilla with three lexers only.

Using Scintilla means we have to re-implement all of Markdown highlighting.

Scintilla has Markdown lexer.

Imagine building a house and after 3 years you decide to change the base of the house for some reason. How would that go? The whole house will have to be demolished for the base to be changed and then reconstructed afterwards.

The text editor is the beating heart of this application. If we take it out or try switching, QON is definitely gonna get some huge shocks.

This is severely out of scope.

I guess we can close that for now, but thank you for the suggestion, @data-man!

@Waqar144
Why do you answer me again and again? I don't write to your repositories.
But ok.

Imagine building a house and after 3 years you decide to change the base of the house for some reason.

The very poor analogy. Are you really comparing a physical object with a set of bytes?
Ok, I'll continue:

The text editor is the beating heart of this application.

If a heart doesn't work well, even people change it.

@pbek
Very sadly.

@Waqar144
Why do you answer me again and again?

Because he was the only one seriously considering implementing it.
I already disliked Scintilla almost 20 years ago when I wrote the E-Script lexer for Scite. ๐Ÿ˜†

I don't write to your repositories.

But he is into this one! @Waqar144 is the most important contributor to QOwnNotes and makes impossible things possible!
If you take a look at the commit history then you might have recognized it.

The very poor analogy. Are you really comparing a physical object with a set of bytes?

The analogy is very valid if you look at the internals of QOwnNotes.

And I hope he isn't as grumpy as I'm now. ๐Ÿ˜ฌ

I ain't leaving the project so easily ๐Ÿคฃ
This is a great app, there's not a better native note taking app on linux than this one, and if people knew how much work has gone into this app, and that only one person has been managing everything, the code, all the cross platform building, supporting a couple of dozen Linux distros, flatpaks, appimages, snaps, there'd be a lot more contributors and a lot more respect for @pbek

But sure if someone doesn't want me to reply, I won't ๐Ÿ’โ€โ™‚๏ธ

@pbek

I already disliked Scintilla almost 20 years ago

But in those days, Qt was also not perfect, isn't it?

@Waqar144

Even Kdevelop / Qtcreator is using QPlainTextEdit. It does the job quite well.

Yes, but there are almost all the Scintilla's features.
E.g. code-folding, multi-cursors and multi-selection.
How hard is it to do this in QMarkdownTextEdit / QOwnNotesMarkdownTextEdit?

This is a great app, there's not a better native note taking app on linux than this one, and if people knew how much work has gone into this app, and that only one person has been managing everything, the code, all the cross platform building, supporting a couple of dozen Linux distros, flatpaks, appimages, snaps, there'd be a lot more contributors and a lot more respect for @pbek

:bowing_man: :heart:

But sure if someone doesn't want me to reply, I won't tipping_hand_man

Well... I want. :grin: You post much more educated replies than me. :laughing:

How hard is it to do this in QMarkdownTextEdit / QOwnNotesMarkdownTextEdit?

It's the other way around. The question is how hard it would be to make QScintilla work at all and to re-implement everything that went into the editor again. I certainly would look at a pull request from you, @data-man

Well... I want. ๐Ÿ˜ You post much more educated replies than me. ๐Ÿ˜†

I will keep at it then ๐Ÿคฃ

@Waqar144

Even Kdevelop / Qtcreator is using QPlainTextEdit. It does the job quite well.

Yes, but there are almost all the Scintilla's features.
E.g. code-folding, multi-cursors and multi-selection.
How hard is it to do this in QMarkdownTextEdit / QOwnNotesMarkdownTextEdit?

Not very hard(except multiple cursors maybe) , but it definitely requires some code in there. These features don't come ready made in Qt.

Plus, there would need to be a use case for

  • code folding
  • multiple cursor
  • multi selection
    in QOwnNotes. You need to remember that this is a note taking app with mark down syntax. Do you have a use case or an example where these features could be used?

The question that needs to be asked is: What advantages do we get from using Qscintilla? And what disadvantages?

@Waqar144

You need to remember that this is a note taking app with mark down syntax. Do you have a use case or an example where these features could be used?

Sure. E.g. try open awesome-cpp/README.md in QON.
I keep and edit many such awesomes in QON.

What advantages do we get from using Qscintilla? And what disadvantages?

In the first message.

try open awesome-cpp/README.md in QON

I did, seems to work fine. What was your point with the file?

Sure. E.g. try open awesome-cpp/README.md in QON.
I keep and edit many such awesomes in QON.

I will look into implementing highlight all occurrences.
Multi cursors, probably not.
Code folding? I don't know what we'll be folding since we don't have braces or such things in Markdown. Fold on headings maybe? But I have never seen such stuff in Markdown and it seems a little out of place in a note taking app.

Right now, what I want most is

  • a better preview (with support for custom styles) and direct markdown rendering instead of relying on Hoedown
  • maybe synonyms/thesaurus support? Or is that possible with a script I wonder ๐Ÿค”

maybe synonyms/thesaurus support? Or is that possible with a script I wonder

It would be possible. e.g. with http://docs.qownnotes.org/en/develop/scripting/README.html#autocompletionhook

@pbek

What was your point with the file?

There are much larger and editing them is inconvenient.
Hiding unneeded sections would be very useful.

@Waqar144

I will look into implementing highlight all occurrences.

It would be great!

Fold on headings maybe?

Yes!

BTW I often use ghostwriter.
May be useful for you.

BTW I often use ghostwriter.
May be useful for you.

It's a great project.
Interestingly, it also uses Qplaintext. Does it provide you with all the features you asked for?
Though it's a markddown editor and not a note taking app :)

Fold on headings maybe?

Yes!

If you want quick navigation, I think there's a navigation panel which you can use to navigate around the document quickly.

Was this page helpful?
0 / 5 - 0 ratings