We could implement this by using the public scopes member function though this function includes dynamic scopes such as misspelled ranges which would change the current semantics of the to_xml helper function.
It might actually make sense to make this change, but I’m avoiding functional changes while refactoring.
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.
The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.
Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
We only use the last empty line when there are more than a single line break in the string to be inserted.
The use-case here is having multiple carets and then running a command like “echo foo”. Here we receive “foo\n” which is split into (“foo”, “”), so every second caret would get the empty string inserted.
Previously we only looked at the last caret, and if this one was not a selection then we would treat the multiple carets (selection ranges) as nothing being selected, and thus, a command replacing the carets, would not leave anything selected.
When pasting or using Filter Through Command with multiple carets, we ignore a potential final empty line, this is because our text will be something like “foo\nbar\n” and we split on the newline, so we end up with (“foo”, “bar”, “”) and if we have more than two carets, then we insert the empty string for every third caret.
For a command though we expect there is a 1:1 between number of carets and newlines in the result, so we should never skip the last element.
If there are multiple (discontinuous) selections then this action will drop the last one.
If there are multiple carets (with no selections) then this action will drop all but the first caret.
This makes it possible to combine the “Use Selection for Find / Replace” with a non-simple find action (e.g. “Replace All”).
If any find options are set (case sensitive, regular expression, etc.) then these will trump the options set for the entry on the find clipboard.
This is only when the command input requested is “selection”. In theory it probably should also do this when input is character, word, or line, but in this case, we can end up with overlapping input ranges.
We still enable it when a custom completion command provides us with completion candidates. For example user might hit escape in a context where a file name should be inserted, without providing any initial prefix or suffix (as the number of expected candidates is small).
Previously we would set a mark, mutate the buffer, and then restore selection based on how the mark was moved.
When a mutation was changing the buffer to its existing value (e.g. toggling case of a space character) then the buffer would effectively ignore the mutation, and the mark would not be properly updated, meaning for “toggle case of character” the caret would not be moved forward.
Additionally we previously always moved to the end of a mutation, even if it was done on a user selection. We now only move to the end if the user didn’t select anything (but ran the mutation on an implicitly selected unit, like a word). The “toggle case of word” action is affected by this.
For example selecting a column of numbers and selecting “Add Numbers in Selection” will now always insert the result at a logical position rather than on the defined end points of the selection.
This is generally desired when the indent of a new line does not (necessarily) depend on lines above it, but where we otherwise do want indent corrections, e.g. HTML.
For example in ruby inserting ‘env⇥’, deleting the initially selected letter, and typing B or S, would insert an additional caret (it was actually inserted in the previous step, but not visible since it was overlapping the existing caret).
The API lack proper support for returning the new caret range so we are using a heuristic to figure out which of the returned ranges correspond to our caret. Ideally the API would be updated.