Why does "continue numbering" behave unexpectedly? - libreoffice-writer

I have an example document that uses nested numbered lists that are continued (the sample document is much simplified, but it shows the same problem).
When I want the last list item to continue the numbering at the same (very first) level, the indentation changes and the number is not what it should be.
Maybe I just don't understand the concepts as the online documentation is very poor.
It could be a bug in list management, also.
So here is how the numbering looks like before trying to fix the last number (item marked red):
And here is how it looks after I tried to continue the numbering for the last list item (item marked red).
I expected the item to be "2.":
Unfortunately I have no idea how to provide the test document.
Alternate explanation of the problem
If I have two concurrent numbered lists (outlines), how would I format such avoiding direct formatting as much as possible?
Example:
1) First Step of some procedure A (A1), possibly with sub-steps
2) Step A2
1) First step of procedure B (B1), possibly with sub-steps
3) Next step of procedure A (A3), ...
...
(the list may change between procedure A and procedure B multiple times)
I suspect that LibreOffice has a bug where the actual numbering format, and not the levels of the outlines determine which counters are incremented.
Even after reading the long manual, I didn't understand the concepts behind.

Can't really explain the strange numbering you encountered, as I was unable to reproduce the effect. However, the "Alternate explanation of the problem" concerning how to provide interleaved lists with proper numbering for each list can be addressed using List Styles.
In the example shown below, I created two new custom List Styles, entitled "Numbering α" and "Numbering β" (with intentionally distinctive notation after each number). To start, I double-clicked Numbering α in the "Styles and Formatting" pane to start an α list.
To start a β list, I got the insertion point to a blank line and double-clicked Numbering β.
Then, whenever I wanted to continue a list or switch from one list to the other, I would double-click the appropriate List Style as needed.
Also, if the insertion point is on an item from, say, list α, double-clicking Numbering β switches the item to the other list, with any subsequent items in each of the lists renumbered as needed. (Note: if a document has a very large quantity of list items, you may need to hit F9 or select Tools > Update > Fields for renumbering to be properly displayed.)
Creating and customizing new lists is pretty straightforward; you can right-clicked in the empty area of the "Styles and Formatting" pane, select "New...", and tweak stuff for a new list as needed. For specific info, see the "Creating custom (new) styles" and "Working with list styles" sections of Writer 6.0 Guide : Chapter 9 - Working with Styles.

Related

Visual Studio Code select same position above and below not the whole line before and after (see image)

I'm using visual studio code and run into a weird problem. I'm not sure how I got here - I could have accidently pressed a shortcut unknowingly.
I'm trying to select a phrase, link or anything that crosses multiple lines (whether the lines are true lines or due to word wrap). When I select multiple lines, it doesn't automatically select the text at the start and end between the two points. Rather, it just selects the length of text for that line and repeats it in the subsequent lines. See the image below to understand.
Image of issue
As you can see, I am trying to select the words from "the" to the end of "sub". Instead of selecting all the words between the two, it selects the text "the instru" and selects every line with the same amount of characters/length.
In order to show what I am expecting, I have pasted the text into Notepad and done the same thing.
What I am expecting
As you can see, all the words between "the" and "sub" are selected.
If anyone has any idea about how to fix this, I would be greatly appreciative.
Below is a copy of the text if the images don't display.
Follow the instructions below for a click guide to retire and/or add 'School'.
Best practice if there is a change in 'School' structure would be to 'retire' any existing school setup that is no longer required and add the new sub school information. The reason why we don't just edit existing school names (typically) is due to leaving historical data intact.
Try using ctrl+shift+P and typing "Toggle Column Selection Mode"

Is it possible to type different value for multiple cursors?

When doing multi cursor selection, often you need to type a different value for each, you've to cancel selection even though all cursors are where you want them to be.
Is it possible to activate some sort of mode and press tab to automatically iterate through each one by one on every tab and type your value. Esc to cancel the mode.
Note: how in end I had to type 1, 2, 3, 4 manually. Those could have been food categories, clothing size, select options etc.
For the special case of when you want to insert values that follow a sequence at your multiple cursor locations, then the powerful Insert Nums package for Sublime Text can help.
Insert Nums can fill in numbered blanks (1,2,3,4, ... 10), and much more. Just about anything you could write as a for loop can be generated and inserted at the multiple cursors. This includes integer/float/string, count up/down, arbitrary start/stop/step values, and formatting to hex, binary, etc., representation. You can also evaluate an expression at each index, so for example you can create a geometric or power series or a pattern of bit shifts.
The default case for Insert Nums is integers, starting at 1, incrementing by 1, and ending when all selections are filled. For the example problem in the question of numbering Items, all you'd have to do is Ctrl+Alt+N, then Return. The numbers 1 through 5 would be filled in.
In case you don't want to install extension, you can copy sample data (which is generated by your favorite scripts or tools, for example) then paste it to the current cursors.
For example, I generate numbers by a cent JavaScript:
Array(10).fill(0).map((a, i) => i + 1).join('\n')
Then,
I can only answer for Sublime, and there core Sublime can't do this out of the box, but you can add the capability to do it to via a third party package.
The PowerCursors package is one way to go with this. With it installed it's as simple as Alt+[ and Alt+] to cycle between existing cursors (the binds use Ctrl instead if you're on MacOS) and type what you like, amongst other capabilities.
There may well be other packages that incorporate something similar as well, so it may be worth casting around a little bit on packagecontrol.io to see what you can dig up.
For CudaText editor, plugin "Carets Numbering" exists, which does this job. You enter starting number, etc, and it inserts increasing numbers at multi-carets positions.
Text Pastry is a vscode extension which does exactly these type of things.

Select one word, then have all matching words automatically select?

I have been working in Notepad++ recently, and last night, spent at least an hour manually selecting many of the same phrase with Ctrl+Select. I needed to select all occurrences of 'yyty' (Just a phrase so I could easily find it), but could not see or find a quick way to do that. I ended up just using the Ctr+Select method, but when doing this 80 times, it gets quite annoying. I need something that will allow me to select a word, then have all matching words become selected (NOT highlighted or marked, as I need to be able to run the column editor tool on the selection to auto-number all of the selections) automatically (by automatically, I mean after clicking something to run the auto-selector). I am willing to install a plugin for NP++ if needed.

Eclipse-RCP: Hide lines of text permanently, keep correct line numbers

I have text files which contain code inside an Editor. The user can run an analysis on a certain part of his code, which will result in a set of lines which should be hidden. Next I want to present the user with only the remaining lines, but with correct linenumbers, as from the original document. Possible solutions I thought of:
Open a new Editor which does not contain the hidden lines, but *somehow* still has correct line numbers
Hide the lines in the original editor, and offer a button for the user to 'unhide'. Probably a similar solution required as in 1.
I don't really know how to go about this. Folds would be a weird solution, because they can be unfolded individually, and seem to be more semantically tied to things like methods or classes. Also, simply creating a new document without the hidden lines results in wrong linenumbers.
Use a ProjectionViewer and reflection to invoke the private method ProjectionViewer.collapse(int offset int length). This method is only used internally to hide a certain portion of the text, by manipulating the ProjectionDocument (see http://eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html).
After this, folding text in the editor using the annotations(the little +/- icons) WILL break everything, so this solution and regular folding are mutually exclusive.

ignore differences in syntax in beyondcompare

In a branch of code I have changed all of the code from obj.varname to obj("varname") and when I compare the code I would like to ignore these differences since varname is the same.
I have a regular expression that I think I need but unfortunately can't get the comparison to be ignored using Beyond Compare from Scooter
^obj\("\w*"\)|obj\.\w*$
I am following this tutorial http://www.scootersoftware.com/support.php?zz=kb_unimportantv3
So my question: is this even possible with beyond compare? If yes, please share a solution including either instructions or post your screenshots.
Beyond Compare 3's Professional edition supports this through its Text Replacements feature. If you've already purchased a Standard edition license you need to revert to trial mode to test it: http://www.scootersoftware.com/suppo...?zz=kb_evalpro
Load your two files in the Text Compare.
Open the Session Settings dialog from the the Session menu, and on the Replacements tab click New to create a new replacement.
In the Text to find edit, use (\w+)\.(\w+)
In the Replace with edit, use $1("$2")
Check the Regular expression checkbox.
The alternative would be to mark any instance of obj.varname and obj("varname") as unimportant. The basic steps would be this:
Load your two files in the Text Compare.
Open the Session Settings dialog from the Session menu, and on the Importance tab click the Edit Grammar... button.
In the next dialog click the New... button below the top listbox.
Change the Element name field to something useful (say, "PropertyAccess").
Change the Category* to List.
In the Text in list* edit, add these two lines:
obj.varname
obj("varname")
Click OK to close the Grammar Item dialog and then click OK again to close the Text Format* grammar item.
Uncheck "PropertyAccess" (or whatever you named it) in the Grammar elements listbox in the Session Settings dialog, then click OK to close it.
This approach isn't as flexible or clean. In the steps above you're matching specific, hardcoded object and variable names, so obj.varname is unimportant but obj.othervar isn't, even if it's aligned against obj("othervar"). If text on both sides is unimportant the difference will be unimportant; if one side is important it will be an important difference. So, with the above steps, obj.varname and obj("varname") will be unimportant everywhere, but it will work correctly since they'll either be matched to other cases that also match those definitions (and thus unimportant) or will be matched to something else that doesn't match that definition, which will be important and will make the difference important.
You can use regular expressions to match more general text categories, but you probably don't want to. For example, if you wanted to match all text that followed that pattern you could use these two lines instead:
\w+\.\w+
\w+\("\w+"\)
And then check the Regular expressions checkbox in the Grammar Item dialog so they're matched that way.
The upside/downside to that is that any text that matches those patterns is then unimportant. abc.newvar vs. def.varname would be considered an unimportant difference because both sides match the unimportant definition. That's good for things like comments or whitespace changes, but probably isn't what you want to do here.