D17128: DocumentPrivate: Remove comment mark when joining lines

2018-12-26 Thread Christoph Cullmann
cullmann requested changes to this revision.
cullmann added a comment.
This revision now requires changes to proceed.


  As said above, I think some "smart wrap" option and that can be used for it.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor, cullmann
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, 
michaelh, ngraham, bruns, demsking, head7, kfunk, sars


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-12-09 Thread Christoph Cullmann
cullmann added a comment.


  I think we could do that in two steps:
  
  1. Introduce some "smart wrap" setting and using generic code like the above 
for that
  2. If then still we have too many issues, one could outsource that to a js 
function (if there, like Dominik proposed).

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, 
michaelh, ngraham, bruns, demsking, head7, kfunk, sars


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-12-08 Thread loh tar
loh.tar added a comment.


  Thanks for your input Dominik. 
  In the meanwhile I noticed (again) these "Smart-Return" function (I noticed, 
and used that a couple of years for a short time period, but forgot that 
somehow) A reverse version of that should be nice. And somehow the possibility 
to use that automatically without to todo some special key-stroke when join 
lines by simple remove the newline character by Del-Key.
  
  But how that all could be done in sane way I have no idea. Currently I tend 
to make a new "Smart-Wrap-Paragraph" function, as suggested by Christoph. 
Because that's new, I can try to be as smart as I like without to change old 
behaviour.
  
  As said is from my point of view the existing wrap function broken, not only 
due to the behavior described in that bug report 135737 but also because the 
whole file is wrapped when no selection is done. That's not handy. This way you 
can't wrap quickly only a paragraph by shortcut without to select them 
previous. I have often scrambled a code file when I only want to warp some 
comment block.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, 
michaelh, ngraham, bruns, demsking, head7, kfunk, sars


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-12-07 Thread Dominik Haumann
dhaumann added a comment.


  As background: inserting the '*' automatically is done by the indenter in 
cstyle.js. Theorwtically, we could even add a joinLines function to the 
indenters as well and call it if it exists, and if not use the default 
implementation. Just an idea... Usually, the motivation for moving something 
into an indenter boils down to whether a specific behavior is related only to a 
specific programming language, i.e. when a general purpose solution cannot be 
done.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, 
michaelh, ngraham, bruns, demsking, head7, kfunk, sars


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-11-25 Thread Christoph Cullmann
cullmann added a comment.


  > An extra action looks to me at first sight a little overdone, but an option 
how join behaves may appropriate.
  
  An option in the settings would work for me, too.
  I just don't want to destroy the work-flow of people that rely on the current 
behavior.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, michaelh, 
ngraham, bruns, demsking, head7, kfunk, sars, dhaumann


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-11-25 Thread loh tar
loh.tar added a comment.


  > I am not sure if the normal join lines should try to be that clever.
  
  But consider the "auto comment" feature after you hit "Return", it's also 
somehow "special clever" but very useful. This tries to add the corresponding 
functionality. Well, the true opposite would be when you hit "Del" at the on of 
a line. Yeah, sounds good, will look at that too but it is (almost, see next 
note) independent from this aim.
  
  I'm currently digging into the wrap functionally which is broken since a 
decade BUG135737 . Sometimes it 
works already pretty well (with normal text) but sometimes it drives nuts 
(without selection in a code file). Very strange. Why I mention this? There I 
have follow a suggestion posted in that bug report, just o trigger a "Return" 
input at the right place. Now, while writing this text I came up with this 
"Del" idea. So, it may a good idea to re-design this patch (?)
  
  > It would make more sense to have an extra action for such a "smart" variant 
in my eyes.
  
  An extra action looks to me at first sight a little overdone, but an option 
how join behaves may appropriate. Let me know where to place that in the Edit 
Options page if you (and other) like that idea

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, michaelh, 
ngraham, bruns, demsking, head7, kfunk, sars, dhaumann


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-11-24 Thread Christoph Cullmann
cullmann added a comment.


  Whereas I think such an extension is good, I am not sure if the normal join 
lines should try to be that clever.
  ATM it is very "deterministic" what happens and I think people like that.
  It would make more sense to have an extra action for such a "smart" variant 
in my eyes.
  What do others think?

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, michaelh, 
ngraham, bruns, demsking, head7, kfunk, sars, dhaumann


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-11-23 Thread loh tar
loh.tar added a comment.


  This works so far in most cases I have tried.
  
  - C/C++, // and /* */ works, but sadly not Oxygen style comments. Guess the 
single star is not as special marked. Could that be fixed in the highlight 
stuff?
  - Bash, # works
  - Ruby, # works
  - Python, # works
  - PHP, // works, # works NOT which surprised me because they are as comment 
colored
  - Tcl, # works, backslash comment continuation works not but it's not 
surprising

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

To: loh.tar, #ktexteditor
Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, michaelh, ngraham, bruns, 
demsking, head7, cullmann, kfunk, sars, dhaumann


D17128: DocumentPrivate: Remove comment mark when joining lines

2018-11-23 Thread loh tar
loh.tar created this revision.
loh.tar added a reviewer: KTextEditor.
loh.tar added a project: KTextEditor.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
loh.tar requested review of this revision.

REVISION SUMMARY
  ...from the next line when current line is comment.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17128

AFFECTED FILES
  src/document/katedocument.cpp

To: loh.tar, #ktexteditor
Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, michaelh, ngraham, bruns, 
demsking, head7, cullmann, kfunk, sars, dhaumann