This would happen if dragging a tab into an unmodified document (in the same window) while holding down control (to insert the path of the dragged tab).
Here the document would change state to “modified” which would trigger a tab bar view reload, but since the drag session isn’t completed, we reload the tabs while one of them is “outside” the bar, which causes it to be added, and once the drag session completes, the original tab outside the bar, will be re-added, leading to two copies of the same tab.
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.
Since we are doing a literal (byte-by-byte) subset match we need to have the filter string use the same unicode normalization form as the items it is matched against.
For favorites and the file chooser, the items are file system names, which default to the decomposed form.
Ideally the filtering algorithm would know about diacritics, but in practice the current solution should work for most actual scenarios, and is much simpler (thus faster).
The new version of clang (Apple LLVM version 6.1.0) as shipped with Xcode 6.3, disabled TLS. According to http://clang.llvm.org/cxx_status.html, in order to support `thread_local`, the C++ runtime library from g++-4.8 or later is needed.
For now, we can use the boost `thread_specific_ptr`. This is probably a reasonable solution since 1) it should be portable with old and future versions of (Apple's) clang and 2) requires no additional dependencies.
The static `std::map` instance (named just `map`, on line 79) had its initializer template params in the wrong order, which kept it from compiling. Swapping them as per this PR lets `indent` build and run with no issues.
When command-clicking an existing selection we remove the selection and insert a single caret.
When double/triple-clicking we remove existing carets/selections in the range that gets selected.
This is instead of adding “copy” to the base name.
This is useful when you use a previous (dated) document as template for a new one, e.g. an invoice, meeting minutes, or similar.