How to make “formats” dropdown apply to only the selected text?

How can I make the format styles dropdown in the classic editor apply to ONLY the selected text? Right now it is applying to the nearest line break from the selected text, I don’t like that.

Here is the code in my functions.php file:

function add_style_select_buttons( $  buttons ) {     array_unshift( $  buttons, 'styleselect' );     return $  buttons; } // Register our callback to the appropriate filter add_filter( 'mce_buttons_2', 'add_style_select_buttons' ); //add custom styles to the WordPress editor function my_custom_styles( $  init_array ) {        $  style_formats = array(           // These are the custom styles         array(               'title' => 'Fancy Words',               'block' => 'div',               'classes' => 'fancywords',             'wrapper' => true,         )     );       // Insert the array, JSON ENCODED, into 'style_formats'     $  init_array['style_formats'] = json_encode( $  style_formats );        return $  init_array;    }  // Attach callback to 'tiny_mce_before_init'  add_filter( 'tiny_mce_before_init', 'my_custom_styles' );