From: Eugene S. <eug...@gm...> - 2013-03-22 21:59:03
|
> On March 22, 2013, 9:47 p.m., Michel Ludwig wrote: > > Thanks for looking at this! > On March 22, 2013, 9:47 p.m., Michel Ludwig wrote: > > src/editorextension.cpp, line 2361 > > <http://git.reviewboard.kde.org/r/109623/diff/2/?file=120753#file120753line2361> > > > > Why is this necessary? Unless startline == 0, won't startline only contain whitespaces anyway? > > > > The same for endline. Michel, I do not understand the question, sorry. The idea if this patch is to make selectParagraph() select the text only. Without any spaces and EOLs. After that one can invoke "Join lines". With current selectParagraph(), "Join lines" joins together paragraphs, separated by one empty line. On March 22, 2013, 9:47 p.m., Eugene Shalygin wrote: > > The 'Join Lines' action from the 'Tools' menu (i.e. also the one that is called from within the scripts) originates from KatePart. Hence, any change to its behaviour will have to be done in KatePart. I don't want to change behavior of "Join lines". I want "Select paragraph" which selects _just_ paragraph text. Perhaps, a new function "Select Paragraph text" or "Select paragraph body" would be more appropriate? - Eugene ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/109623/#review29739 ----------------------------------------------------------- On March 20, 2013, 10:53 p.m., Eugene Shalygin wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/109623/ > ----------------------------------------------------------- > > (Updated March 20, 2013, 10:53 p.m.) > > > Review request for Kile and Michel Ludwig. > > > Description > ------- > > 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. > > > Diffs > ----- > > doc/scripting.docbook 9e87bee > src/editorextension.h e963129 > src/editorextension.cpp fc3906b > src/scripting/kilescriptview.h b822c0f > src/scripting/kilescriptview.cpp bd875c7 > > Diff: http://git.reviewboard.kde.org/r/109623/diff/ > > > Testing > ------- > > Manual > > > Thanks, > > Eugene Shalygin > > |