@Saiapatsu said in [feature request] Move tab to beginning / end:
Here are LuaScript functions for this, which don’t seem too difficult to port to other scripting plugins
Indeed; here’s a PythonScript version:
# -*- coding: utf-8 -*- # references: # https://community.notepad-plus-plus.org/topic/24799 # for newbie info on PythonScripts, see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript from Npp import * def get_number_of_tabs(view=None): retval = 0 if view is None: retval = len(notepad.getFiles()) else: for (pathname, buffer_id, index, v) in notepad.getFiles(): if v == view: retval += 1 return retval curr_view = notepad.getCurrentView() curr_doc_index = notepad.getCurrentDocIndex(curr_view) if 1: # move tab to end positions_to_move = get_number_of_tabs(curr_view) - curr_doc_index - 1 for __ in range(positions_to_move): notepad.menuCommand(MENUCOMMAND.VIEW_TAB_MOVEFORWARD) else: # move tab to beginning positions_to_move = curr_doc_index for __ in range(positions_to_move): notepad.menuCommand(MENUCOMMAND.VIEW_TAB_MOVEBACKWARD)