Let selectParagraph() perform exact selection

Review Request #109623 - Created March 20, 2013 and submitted

Information
Eugene Shalygin
kile
master
Reviewers
kile
mludwig
I store my LaTeX sources in SCM and thus do not use dynamic line breaks. Because of that I want to use "Join lines" Kate function quite frequently. To do that one needs to select a paragraph and execute "Join lines". Thanks to the scripting for the current paragraph it is possible to write a script like:

view.selectParagraph()
document.joinLines()

and bind it to a key shortcut.
But it will not work as expected because selectParagraph() will include trailing EOL symbol, and join operation will join current paragraph with the next one. 

The patch adds a parameter to selectParagraph() function (in both scripting and EditorExtension) to specify do we want exact selection or whole-line selection. So the following script

view.selectParagraph(false)
document.joinLines()

does what is expected.

P.P.S. Perhaps the new behaviour (wholeLines = false) should be the default one in order to be executed from the Kile menu action also? At least I find it more logical.
Manual

Issues

  • 1
  • 0
  • 0
  • 1
Description From Last Updated
Why is this necessary? Unless startline == 0, won't startline only contain whitespaces anyway? The same for endline. Michel Ludwig Michel Ludwig
Michel Ludwig
Eugene Shalygin
Eugene Shalygin
Michel Ludwig
Eugene Shalygin
Review request changed

Status: Closed (submitted)

Loading...